﻿.btn-container-icon {
    text-align: center;
    margin-top: 20px;
    display: flex;
    gap: 15px;
    justify-content: center;
    flex-direction: row;
    align-items: center;
}

.btn-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 10px 18px;
    text-decoration: none !important;
    border-radius: 5px;
    font-weight: 500;
    transition: all 0.2s ease;
    font-size: 14px;
    cursor: pointer;
    white-space: nowrap;
    line-height: 1;
}

.btn-primary-icon {
    background-color: #007acc;
    color: white !important;
    border: none;
    padding: 10px 18px;
    border-radius: 5px;
    text-decoration: none !important;
    font-size: 14px;
    font-weight: 500;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    transition: background-color 0.2s ease;
    cursor: pointer;
    white-space: nowrap;
    line-height: 1;
}

    .btn-primary-icon:hover {
        background-color: #0056b3;
        box-shadow: 0 4px 8px rgba(0,122,204,0.3);
        color: white !important;
        text-decoration: none !important;
    }

.btn-icon svg {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
    vertical-align: middle;
}

.btn-save-icon {
    background-color: #00cc52;
    color: white !important;
    border: none;
    padding: 10px 20px;
    border-radius: 4px;
    text-decoration: none !important;
    font-size: 14px;
    font-weight: 500;
    display: inline-block;
    transition: background-color 0.2s ease;
    cursor: pointer;
    margin-top: 30px;
}

.btn-container-icon .btn-save-icon {
    margin-top: 0;
}

.form-buttons.btn-container-icon .btn-save-icon {
    margin-top: 30px;
}

.btn-save-icon.btn-icon {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-top: 0;
}

.form-buttons {
    text-align: center;
    margin-top: 20px;
}

.btn-primary {
    background-color: #007acc;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: background-color 0.2s ease;
}

    .btn-primary:hover {
        background-color: #0056b3;
    }


.btn-save-icon:hover {
    background-color: #00a142;
    box-shadow: 0 4px 8px rgba(0,204,82,0.3);
    color: white !important;
    text-decoration: none !important;
}

.btn-save-icon svg {
    width: 16px;
    height: 16px;
}

.btn-secondary-icon {
    background-color: #6c757d;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 4px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

    .btn-secondary-icon:hover {
        background-color: #545b62;
        box-shadow: 0 4px 8px rgba(108,117,125,0.3);
        color: white !important;
        text-decoration: none !important;
    }


.main-container {
    display: flex;
    gap: 20px;
    margin: 20px 0;
}

.left-panel {
    flex: 1;
    min-width: 50%;
    padding-right: 20px;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
}

.details-content {
    background-color: #f8f9fa;
    padding: 20px;
    border-radius: 6px;
    border: 1px solid #c0c8cf;
    margin-bottom: 20px;
    box-shadow: 0 4px 8px rgb(105 99 99 / 10%);
}

.form-content-box {
    /*width: 50%;*/
    background-color: #f8f9fa;
    padding: 20px;
    border-radius: 6px;
    border: 1px solid #c0c8cf;
    margin-bottom: 20px;
    box-shadow: 0 4px 8px rgb(105 99 99 / 10%);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

    .form-content-box h4 {
        color: #333;
        margin-bottom: 20px;
        text-align: center;
    }

.form-content-box .form-group {
    width: 100%;
    text-align: left;
}

.form-group {
    margin-bottom: 15px;
    display: flex;
    align-items: flex-start;
    gap: 15px;
    max-width: 500px;
    margin-left: auto;
    margin-right: auto;
}

.control-label {
    font-weight: bold;
    color: #495057;
    min-width: 180px;
    width: 180px;
    padding-top: 8px;
    flex-shrink: 0;
}

.form-control {
    flex: 1;
    padding: 8px 12px;
    border: 1px solid #ced4da;
    border-radius: 4px;
    font-size: 14px;
    background-color: white;
    box-sizing: border-box;
}

    .form-control:focus {
        outline: none;
        border-color: #007acc;
        box-shadow: 0 0 5px rgba(0,122,204,0.3);
    }

.form-field {
    flex: 1;
}

.checkbox {
    margin-top: 5px;
}

.text-danger {
    color: #dc3545;
    font-size: 12px;
    margin-top: 5px;
    display: block;
}

.right-panel {
    flex: 1;
    min-width: 45%;
    padding-left: 20px;
    border-left: 2px solid #ddd;
}

.search-container-small {
    margin-bottom: 10px;
}

.search-input-small {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #ccc;
    border-radius: 20px;
    font-size: 13px;
    background-color: #f8f9fa;
    color: #666;
}

    .search-input-small:focus {
        outline: none;
        border-color: #007acc;
        box-shadow: 0 0 5px rgba(0,122,204,0.3);
    }

.sensor-list-container {
    margin-bottom: 30px;
}

    .sensor-list-container h4 {
        color: #333;
        border-bottom: 2px solid #007acc;
        padding-bottom: 5px;
        margin-bottom: 15px;
    }

.sensor-list {
    max-height: 300px;
    overflow-y: auto;
    border: 1px solid #ddd;
    border-radius: 4px;
    padding: 10px;
    background-color: #f9f9f9;
}

.sensor-item {
    background-color: white;
    border: 1px solid #e0e0e0;
    border-radius: 4px;
    padding: 10px;
    margin-bottom: 8px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    transition: all 0.2s ease;
}

    .sensor-item:hover {
        background-color: #f0f8ff;
        border-color: #007acc;
    }

    .sensor-item.clickable {
        cursor: pointer;
    }

        .sensor-item.clickable:hover {
            background-color: #e6f3ff;
            border-color: #0056b3;
            transform: translateY(-1px);
            box-shadow: 0 2px 6px rgba(0,0,0,0.15);
        }

    .sensor-item.current-sensor {
        background-color: #fff3cd;
        border-color: #ffc107;
        box-shadow: 0 2px 6px rgba(255,193,7,0.3);
    }

        .sensor-item.current-sensor:hover {
            background-color: #ffeaa7;
            border-color: #e6ac00;
        }

.sensor-link {
    text-decoration: none;
    color: inherit;
    display: block;
}

    .sensor-link:hover {
        text-decoration: none;
        color: inherit;
    }

.sensor-info {
    font-size: 14px;
    margin-bottom: 4px;
}

.sensor-details {
    font-size: 12px;
    color: #666;
}

    .sensor-details small {
        display: block;
        margin-bottom: 2px;
    }

.no-sensors {
    text-align: center;
    color: #999;
    font-style: italic;
    padding: 20px;
}

/*.sensor-item.hidden {
    display: none;
}*/

textarea {
    width: 100%;
    height: 150px;
    background-color: white;
    border: 1px solid #ced4da;
    padding: 8px 12px;
    font-family: Arial, sans-serif;
    resize: vertical;
    box-sizing: border-box;
}

.dl-horizontal {
    max-width: 400px;
    margin: 0 auto;
}

    .dl-horizontal dt {
        width: 180px;
        font-weight: bold;
        color: #495057;
    }

    .dl-horizontal dd {
        margin-left: 200px;
        padding-bottom: 10px;
    }

.status-badge {
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: bold;
    text-transform: uppercase;
}

    .status-badge.enabled {
        background-color: #d4edda;
        color: #155724;
        border: 1px solid #c3e6cb;
    }

    .status-badge.disabled {
        background-color: #f8d7da;
        color: #721c24;
        border: 1px solid #f5c6cb;
    }



/* Owner Selector Styles */
.owner-selector-container {
    position: relative;
    width: 100%;
}

.owner-search-input {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    margin-bottom: 8px;
}

    .owner-search-input:focus {
        outline: none;
        border-color: #007bff;
        box-shadow: 0 0 0 0.2rem rgba(0, 123, 255, 0.25);
    }

.owner-list-container {
    border: 1px solid #ddd;
    border-radius: 4px;
    max-height: 190px; /* desired height */
    overflow-y: auto;
    background-color: white;
    position: relative;
    scroll-behavior: smooth;
}

.owner-list-item {
    padding: 10px 12px;
    cursor: pointer;
    border-bottom: 1px solid #f0f0f0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: all 0.2s ease;
}

    .owner-list-item:last-child {
        border-bottom: none;
    }

    .owner-list-item:hover {
        background-color: #f8f9fa;
    }

    .owner-list-item[data-selected="true"] {
        background-color: #e3f2fd;
        border-left: 3px solid #007bff;
    }

        .owner-list-item[data-selected="true"]:hover {
            background-color: #bbdefb;
        }

.no-owners-found {
    padding: 15px;
    text-align: center;
    color: #666;
    font-style: italic;
}

/* Custom scrollbar for webkit browsers */
.owner-list-container::-webkit-scrollbar {
    width: 6px;
}

.owner-list-container::-webkit-scrollbar-track {
    background: #f1f1f1;
}

.owner-list-container::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 3px;
}

    .owner-list-container::-webkit-scrollbar-thumb:hover {
        background: #a8a8a8;
    }



/* Keyboard navigation highlight */
.owner-list-item.keyboard-selected {
    background-color: #f0f8ff !important;
    border-left: 3px solid #007bff;
}

/* Selected item styling */
.owner-list-item[data-selected="true"],
.owner-list-item.selected {
    background-color: #e3f2fd;
    border-left: 3px solid #007bff;
    font-weight: 500;
}

    .owner-list-item[data-selected="true"]:hover,
    .owner-list-item.selected:hover {
        background-color: #bbdefb;
    }

/* Selected indicator (checkmark) */
.selected-indicator {
    color: #007bff;
    font-weight: bold;
    font-size: 16px;
    margin-left: 8px;
    flex-shrink: 0;
}


.owner-info {
    flex: 1;
    font-size: 14px;
    text-align: left;
}


.owner-list-item.hidden {
    display: none !important;
}



/* Current Owner */
.form-control-static {
    background-color: #e2e3e5;
    color: #383d41;
    border: 1px solid #d6d8db;
    border-radius: 12px;
    padding: 8px 16px;
    font-size: 14px;
    font-weight: 500;
    display: inline-flex;
    align-items: center;
    box-sizing: border-box;
    font-style: normal;
}


/* Base checkbox styles - for ALL checkboxes */
input[type="checkbox"],
input.check-box {
    -webkit-appearance: none !important;
    -moz-appearance: none !important;
    appearance: none !important;
    width: 16px !important;
    height: 16px !important;
    background-color: white !important;
    border: 2px solid #007acc !important;
    border-radius: 2px !important;
    position: relative !important;
    cursor: pointer !important;
    transition: all 0.2s ease !important;
}

    /* Hover state for unchecked */
    input[type="checkbox"]:hover:not(:checked):not(:disabled),
    input.check-box:hover:not(:checked):not(:disabled) {
        border-color: #0056b3 !important;
        background-color: #f0f8ff !important;
    }

    /* Checked state */
    input[type="checkbox"]:checked,
    input.check-box:checked {
        background-color: #007acc !important;
        border-color: #007acc !important;
    }

        /* Checkmark for checked state */
        input[type="checkbox"]:checked::after,
        input.check-box:checked::after {
            content: '\2713' !important;
            position: absolute !important;
            top: -2px !important;
            left: 1px !important;
            color: white !important;
            font-size: 12px !important;
            font-weight: bold !important;
        }

    /* Disabled state */
    input[type="checkbox"]:disabled,
    input.check-box:disabled {
        opacity: 0.6 !important;
        cursor: not-allowed !important;
        background-color: #e9ecef !important;
    }

        /* Disabled and checked */
        input[type="checkbox"]:disabled:checked,
        input.check-box:disabled:checked {
            background-color: #007acc !important;
            border-color: #007acc !important;
        }

    input[type="checkbox"]:focus,
    input.check-box:focus {
        outline: 2px solid #007acc !important;
        outline-offset: 2px !important;
    }


/* Pagination styling */
.pagination a,
.pagination span {
    color: #007acc !important;
    border-color: #007acc !important;
}

    .pagination a:hover {
        background-color: #007acc !important;
        color: white !important;
        border-color: #007acc !important;
    }

.pagination .active a,
.pagination .active span {
    background-color: #007acc !important;
    border-color: #007acc !important;
    color: white !important;
}

.pagination .disabled a,
.pagination .disabled span {
    color: #6c757d !important;
    border-color: #dee2e6 !important;
}

/* PagedList specific styling */
.pagedList a {
    color: #007acc !important;
    text-decoration: none;
    padding: 6px 12px;
    margin: 0 2px;
    border: 1px solid #007acc;
    border-radius: 4px;
    transition: all 0.2s ease;
}

    .pagedList a:hover {
        background-color: #007acc !important;
        color: white !important;
    }

.pagedList .current {
    background-color: #007acc !important;
    color: white !important;
    padding: 6px 12px;
    margin: 0 2px;
    border: 1px solid #007acc;
    border-radius: 4px;
}

.pagedList .disabled {
    color: #6c757d !important;
    padding: 6px 12px;
    margin: 0 2px;
    border: 1px solid #dee2e6;
    border-radius: 4px;
}

.container {
    margin-left: 1%;
    margin-right: 1%;
    width: 98%;
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px;
}

.main-container-centered {
    display: flex;
    gap: 20px;
    margin: 20px auto;
    width: 50%;
}

.form-group-centered {
    display: flex;
    justify-content: center;
    width: 100%;
    margin-top: 20px;
}

    .form-group-centered .col-md-offset-2,
    .form-group-centered .col-md-10 {
        margin: 0;
        padding: 0;
        width: auto;
        float: none;
    }

.btn-danger-icon {
    background-color: #dc3545;
    color: white !important;
    border: none;
    padding: 10px 20px;
    border-radius: 4px;
    text-decoration: none !important;
    font-size: 14px;
    font-weight: 500;
    display: inline-block;
    transition: background-color 0.2s ease;
    cursor: pointer;
}

    .btn-danger-icon:hover {
        background-color: #c82333;
        box-shadow: 0 4px 8px rgba(220,53,69,0.3);
        color: white !important;
        text-decoration: none !important;
    }


.text-truncate-hover {
    max-width: 200px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    display: inline-block;
    vertical-align: middle;
}

    .text-truncate-hover:hover {
        max-width: none;
        overflow: visible;
        background-color: #f8f9fa;
        padding: 2px 5px;
        border-radius: 3px;
        position: relative;
        z-index: 10;
        box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    }

.form-content-box textarea {
    width: 100%;
    height: 120px;
    min-height: 120px;
    resize: vertical;
    padding: 8px 12px;
    font-family: Arial, sans-serif;
    font-size: 14px;
    line-height: 1.4;
    border: 1px solid #ced4da;
    border-radius: 4px;
    box-sizing: border-box;
}

    .form-content-box textarea:focus {
        outline: none;
        border-color: #007acc;
        box-shadow: 0 0 5px rgba(0,122,204,0.3);
    }



/* Mobile */
@media (max-width: 768px) {
    .container {
        padding: 15px;
    }

    .page-header-enhanced {
        padding: 30px 20px;
    }

        .page-header-enhanced h2 {
            font-size: 1.875rem;
        }

    .wireframe-container {
        gap: 16px;
    }

    .wireframe-panel h3 {
        padding: 16px 20px;
        font-size: 1rem;
    }

    .search-box {
        margin: 16px 20px;
        width: calc(100% - 40px);
        padding: 12px 16px 12px 44px;
    }

    .sensor-item {
        margin: 0 20px 10px;
        padding: 14px 16px;
    }

    .item-list {
        margin: 0 20px 20px;
        max-height: 160px;
    }

    .linking-panel-content {
        padding: 24px 20px;
    }

    .sensor-display-box {
        padding: 20px 16px;
        margin-bottom: 20px;
    }

    .connect-button {
        padding: 14px 28px;
        font-size: 0.95rem;
    }


    .main-container {
        flex-direction: column;
        gap: 20px;
        margin: 10px 0;
    }

    .main-container-centered {
        width: 100%;
    }

    .left-panel {
        flex: none;
        width: 100%;
        padding-right: 0;
        margin-bottom: 20px;
    }

    .right-panel {
        flex: none;
        width: 100%;
        padding-left: 0;
        border-left: none;
        border-top: 2px solid #ddd;
        padding-top: 20px;
    }


    .btn-icon {
        width: 100%;
        max-width: 200px;
        justify-content: center;
    }

    .form-group {
        flex-direction: column;
        gap: 5px;
        align-items: flex-start;
        align-items: center;
    }

    .control-label {
        min-width: auto;
        width: auto;
        padding-top: 0;
    }

    .form-control {
        width: 100%;
    }

    .dl-horizontal {
        max-width: 100%;
    }

        .dl-horizontal dt {
            width: auto;
            margin-bottom: 5px;
        }

        .dl-horizontal dd {
            margin-left: 0;
            margin-bottom: 15px;
            padding-bottom: 5px;
        }

    .sensor-list-container {
        margin-bottom: 25px;
    }

    .sensor-list {
        max-height: 250px;
    }

    .search-input-small {
        padding: 12px 15px;
        font-size: 16px; /* Prevents zoom on iOS */
        border-radius: 25px;
    }
}

/* Tablet breakpoint */
@media (min-width: 769px) and (max-width: 1024px) {
    .main-container {
        gap: 15px;
    }

    .main-container-centered {
        width: 100%;
    }

    .left-panel {
        padding-right: 15px;
    }

    .right-panel {
        padding-left: 15px;
    }

    /* Slightly smaller sensor list on tablets */
    .sensor-list {
        max-height: 280px;
    }
}




body {
    background: linear-gradient(135deg, #f1f5f9 0%, #e2e8f0 100%);
    min-height: 100vh;
    color: #1e293b;
    line-height: 1.6;
}


.page-header-enhanced {
    background: white;
    border-radius: 16px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    padding: 40px;
    margin-bottom: 30px;
    text-align: center;
    border: 1px solid rgba(148, 163, 184, 0.1);
}

    .page-header-enhanced h2 {
        color: #0f172a;
        font-size: 2.25rem;
        font-weight: 700;
        margin-bottom: 8px;
        letter-spacing: -0.025em;
    }

    .page-header-enhanced .subtitle {
        color: #64748b;
        font-size: 1.125rem;
        font-weight: 400;
        margin: 0;
    }

/* Wireframe Container */
.wireframe-container {
    display: grid;
    grid-template-columns: 1fr 320px 1fr;
    grid-template-rows: auto auto;
    gap: 24px;
    margin-bottom: 40px;
}

/* Panel Base Styling */
.wireframe-panel {
    background: white;
    border-radius: 16px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    overflow: hidden;
    transition: all 0.3s ease;
    border: 1px solid rgba(148, 163, 184, 0.1);
    position: relative;
}


/* Status Indicators */
.panel-status {
    position: absolute;
    top: 16px;
    right: 16px;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #ef4444;
    transition: all 0.3s ease;
    z-index: 10;
}

    .panel-status.ready,
    .panel-status.active {
        background: #10b981;
        box-shadow: 0 0 8px rgba(16, 185, 129, 0.4);
    }

/* Panel Headers */
.wireframe-panel h3 {
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
    padding: 22px 24px;
    margin: 0;
    font-size: 1.25rem;
    font-weight: 700;
    color: #0f172a;
    border-bottom: 1px solid rgba(148, 163, 184, 0.1);
    position: relative;
}

    .wireframe-panel h3::before {
        content: '';
        position: absolute;
        left: 24px;
        bottom: 0;
        width: 40px;
        height: 3px;
        background: linear-gradient(135deg, #3b82f6 0%, #1d4ed8 100%);
    }

/* Filter Panel Styling */
.filter-panel {
    grid-row: 1;
}

.linking-panel {
    grid-row: 1 / 3;
    grid-column: 2;
    display: flex;
    flex-direction: column;
    justify-content: center;
    min-height: 500px;
}

.select-panel {
    grid-row: 2;
    min-height: 350px;
}

/* Search Box Styling */
.search-box {
    width: 100%;
    padding: 16px 20px 16px 50px;
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    font-size: 1rem;
    background: #f8fafc;
    transition: all 0.3s ease;
    margin: 20px 24px;
    width: calc(100% - 48px);
    position: relative;
}

    .search-box:focus {
        outline: none;
        border-color: #3b82f6;
        background: white;
        box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
    }

    .search-box::placeholder {
        color: #94a3b8;
        font-size: 0.95rem;
    }

/* Search Icon */
.wireframe-panel:has(.search-box)::before {
    content: '';
    position: absolute;
    left: 44px;
    top: 108px;
    width: 16px;
    height: 16px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%2394a3b8'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='m21 21-6-6m2-5a7 7 0 11-14 0 7 7 0 0114 0z' /%3E%3C/svg%3E");
    z-index: 5;
    pointer-events: none;
}

/* Owner Filter List */
.item-list {
    max-height: 220px;
    overflow-y: auto;
    padding: 10px;
    margin: 0 24px 24px;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    background: #f8fafc;
}

.list-item {
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 16px 20px;
    margin-bottom: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 1rem;
    color: #0f172a;
    font-weight: 600;
    position: relative;
}

    .list-item:last-child {
        margin-bottom: 0;
    }

    .list-item:hover {
        border-color: #94a3b8;
        transform: translateX(4px);
        box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
    }

    .list-item.selected {
        border-color: #3b82f6;
        background: linear-gradient(135deg, #eff6ff 0%, #dbeafe 100%);
        color: #1e40af;
        font-weight: 700;
        transform: translateX(4px);
        box-shadow: 0 4px 20px rgba(59, 130, 246, 0.2);
    }

        .list-item.selected::after {
            content: '';
            position: absolute;
            right: 16px;
            top: 50%;
            transform: translateY(-50%);
            width: 20px;
            height: 20px;
            background: #10b981;
            border-radius: 50%;
            background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='white'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M5 13l4 4L19 7' /%3E%3C/svg%3E");
            background-size: 12px;
            background-position: center;
            background-repeat: no-repeat;
        }

/* Sensor List Styling */
.sensor-item {
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 18px 20px;
    margin: 0 24px 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
}

    .sensor-item:hover {
        border-color: #94a3b8;
        transform: translateX(4px);
        box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
    }

    .sensor-item.selected {
        border-color: #3b82f6;
        background: linear-gradient(135deg, #eff6ff 0%, #dbeafe 100%);
        transform: translateX(4px);
        box-shadow: 0 4px 20px rgba(59, 130, 246, 0.2);
    }

        .sensor-item.selected::after {
            content: '';
            position: absolute;
            right: 16px;
            top: 50%;
            transform: translateY(-50%);
            width: 20px;
            height: 20px;
            background: #10b981;
            border-radius: 50%;
            background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='white'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M5 13l4 4L19 7' /%3E%3C/svg%3E");
            background-size: 12px;
            background-position: center;
            background-repeat: no-repeat;
        }

    .sensor-item > div:first-child {
        font-weight: 700;
        color: #0f172a;
        margin-bottom: 8px;
        font-size: 1.1rem;
    }

    .sensor-item > div:last-child {
        color: #64748b;
        font-size: 0.95rem;
        font-weight: 500;
    }

/* Linking Panel Center Content */
.linking-panel-content {
    padding: 32px 24px;
    text-align: center;
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.sensor-display-label {
    font-weight: 600;
    color: #475569;
    margin-bottom: 12px;
    font-size: 0.875rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.sensor-display-box {
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
    border: 2px dashed #cbd5e1;
    border-radius: 16px;
    padding: 24px 20px;
    margin-bottom: 24px;
    min-height: 80px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

    .sensor-display-box.has-selection {
        background: linear-gradient(135deg, #ecfdf5 0%, #d1fae5 100%);
        border-color: #10b981;
        border-style: solid;
    }

    .sensor-display-box .no-selection {
        color: #94a3b8;
        font-style: italic;
        font-size: 0.9rem;
    }

    .sensor-display-box .selected-info .main {
        font-weight: 700;
        color: #0f172a;
        margin-bottom: 4px;
        font-size: 0.95rem;
    }

    .sensor-display-box .selected-info .sub {
        font-size: 0.8rem;
        color: #64748b;
        font-weight: 500;
    }

/* Connection Arrow */
.connection-arrow {
    font-size: 1.5rem;
    color: #3b82f6;
    margin: 16px 0;
    opacity: 0.7;
}

/* Connect Button */
.connect-button {
    background: linear-gradient(135deg, #3b82f6 0%, #1d4ed8 100%);
    color: white;
    border: none;
    border-radius: 12px;
    padding: 18px 36px;
    font-size: 1.1rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(59, 130, 246, 0.3);
    margin-top: 20px;
    position: relative;
    overflow: hidden;
}



    .connect-button:disabled {
        background: linear-gradient(135deg, #e2e8f0 0%, #cbd5e1 100%);
        color: #94a3b8;
        cursor: not-allowed;
        box-shadow: none;
        transform: none;
    }


/* Form Buttons */
.form-group-centered {
    text-align: center;
    margin-top: 32px;
}




/* Scrollbar Styling */
.item-list::-webkit-scrollbar {
    width: 6px;
}

.item-list::-webkit-scrollbar-track {
    background: #f1f5f9;
    border-radius: 3px;
}

.item-list::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 3px;
}

    .item-list::-webkit-scrollbar-thumb:hover {
        background: #94a3b8;
    }

/* Hidden items */
.hidden {
    display: none !important;
}


/* Mobile Responsive */
@media (max-width: 1200px) {
    .wireframe-container {
        grid-template-columns: 1fr;
        grid-template-rows: repeat(5, auto);
        gap: 20px;
    }

    /* Reset all grid positioning for mobile */
    .filter-panel {
        grid-row: auto;
        grid-column: auto;
    }

    .linking-panel {
        grid-row: auto;
        grid-column: auto;
        min-height: auto;
    }

    .select-panel {
        grid-row: auto;
        grid-column: auto;
        min-height: auto;
    }
}

/* Mobile Responsive */
@media (max-width: 1200px) {
    .wireframe-container {
        grid-template-columns: 1fr;
        grid-template-rows: repeat(5, auto);
        gap: 20px;
    }

    /* Reset grid positioning for mobile */
    .filter-panel {
        grid-row: auto;
        grid-column: auto;
    }

    .linking-panel {
        grid-row: auto;
        grid-column: auto;
        min-height: auto;
    }

    .select-panel {
        grid-row: auto;
        grid-column: auto;
        min-height: auto;
    }


    /* Filter by Tractor Owner */
    .wireframe-container > div:nth-child(1) {
        order: 1;
    }

    /* Available Tractors */
    .wireframe-container > div:nth-child(4) {
        order: 2;
    }

    /* Linking Panel */
    .wireframe-container > div:nth-child(5) {
        order: 3;
    }

    /* Filter by Implement Owner */
    .wireframe-container > div:nth-child(2) {
        order: 5;
    }

    /* Available Implements */
    .wireframe-container > div:nth-child(3) {
        order: 3;
    }
}


@media (min-width: 769px) and (max-width: 1200px) {
    .wireframe-container {
        gap: 20px;
    }

    .item-list {
        max-height: 200px;
    }

    .linking-panel-content {
        padding: 28px 24px;
    }
}

    .page-header-enhanced {
        padding: 30px 20px;
    }

        .page-header-enhanced h2 {
            font-size: 1.875rem;
        }

    .wireframe-container {
        gap: 16px;
    }

    .wireframe-panel h3 {
        padding: 16px 20px;
        font-size: 1rem;
    }

    .search-box {
        margin: 16px 20px;
        width: calc(100% - 40px);
        padding: 12px 16px 12px 44px;
    }

    .sensor-item {
        margin: 0 20px 10px;
        padding: 14px 16px;
    }

    .item-list {
        margin: 0 20px 20px;
        max-height: 160px;
    }

    .linking-panel-content {
        padding: 24px 20px;
    }

    .sensor-display-box {
        padding: 20px 16px;
        margin-bottom: 20px;
    }

    .connect-button {
        padding: 14px 28px;
        font-size: 0.95rem;
    }
}

/* Loading States */
.loading {
    opacity: 0.7;
    pointer-events: none;
}

    .loading::after {
        content: '';
        position: absolute;
        top: 50%;
        left: 50%;
        width: 20px;
        height: 20px;
        margin: -10px 0 0 -10px;
        border: 2px solid transparent;
        border-top: 2px solid currentColor;
        border-radius: 50%;
        animation: spin 1s linear infinite;
    }

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

/* Animation for selections */
@keyframes selectPulse {
    0% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.02);
    }

    100% {
        transform: scale(1);
    }
}

.sensor-item.selected {
    animation: selectPulse 0.3s ease;
}

.row-expired {
    background-color: rgba(255, 0, 0, 0.25) !important; /* Light red */
}

.row-expiring-soon {
    background-color: rgba(255, 165, 0, 0.25) !important; /* Light orange */
}

.row-expiring-three-months {
    background-color: rgba(255, 255, 0, 0.25) !important; /* Light yellow */
}