/* Loading Overlay */
.loading-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.95);
    z-index: 100;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 16px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

@media (prefers-reduced-motion: reduce) {
    .spinner {
        animation: none;
    }
}

/* Offline Badge */
.offline-badge {
    background-color: #e67e22;
    color: white;
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: bold;
}

/* Search Bar */
.search-bar {
    padding: 12px;
    background: white;
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: 0;
    z-index: 5;
}

.search-bar-body {
    display: block;
}

.search-bar input {
    width: 100%;
    padding: 10px;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    font-size: 1rem;
    margin-bottom: 8px;
}

.panel-mobile-header {
    display: none;
}

/* Filter Controls */
.filter-controls {
    display: flex;
    gap: 0;
    background: #f1f2f6;
    border-radius: 4px;
    overflow: hidden;
    margin-top: 8px;
    flex-wrap: wrap;
}

.filter-tab {
    flex: 1;
    min-height: 40px;
    padding: 8px 10px;
    border: none;
    font-size: 0.85rem;
    background: #f1f2f6;
    color: var(--text-muted);
    transition: all 0.2s;
}

.filter-tab:hover {
    background: #e1e2e6;
}

.filter-tab:focus-visible {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}

.filter-tab.active {
    background: white;
    color: var(--primary-color);
    font-weight: bold;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.list-status-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 4px 12px;
    background: #f9f9f9;
    font-size: 0.8rem;
    color: var(--text-muted);
    border-bottom: 1px solid var(--border-color);
}

.sort-control {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 0.8rem;
    color: var(--text-muted);
}

.list-controls-toggle {
    display: none;
}

.sort-control select {
    border: 1px solid var(--border-color);
    border-radius: 6px;
    padding: 4px 8px;
    font-size: 0.8rem;
    background: white;
    color: var(--text-color);
}

/* Exhibitor List */
.exhibitor-list {
    flex: 1;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

.list-empty-state {
    display: grid;
    place-items: center;
    gap: 0.5rem;
    min-height: 220px;
    padding: 2rem;
    color: var(--text-muted);
    text-align: center;
}

.list-empty-state i {
    font-size: 1.5rem;
    color: var(--primary-color);
}

.list-empty-state strong {
    color: var(--text-color);
}

.exhibitor-item {
    padding: 12px 16px;
    border-bottom: 1px solid var(--border-color);
    transition: background-color 0.1s;
}

.exhibitor-item:hover {
    background-color: #f8f9fa;
}

.exhibitor-item.selected {
    background-color: #eaf2f8;
    border-left: 4px solid var(--primary-color);
    padding-left: 12px;
}

.ex-header {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    margin-bottom: 4px;
}

.ex-card-action {
    display: block;
    width: 100%;
    padding: 0;
    border: 0;
    background: transparent;
    color: inherit;
    font: inherit;
    text-align: left;
    cursor: pointer;
}

.ex-card-action:focus-visible {
    outline: 2px solid var(--primary-color);
    outline-offset: 4px;
    border-radius: 4px;
}

.ex-name {
    font-weight: 600;
    color: var(--text-color);
    font-size: 1rem;
}

.ex-stand {
    font-size: 0.8rem;
    color: var(--text-muted);
    font-family: monospace;
    background: #eee;
    padding: 2px 4px;
    border-radius: 3px;
    margin-left: 8px;
}

.ex-desc {
    width: 100%;
    font-size: 0.85rem;
    color: #666;
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    margin-bottom: 8px;
}

.ex-controls {
    display: flex;
    gap: 8px;
    margin-top: 8px;
    flex-wrap: wrap;
}

.status-separator {
    width: 1px;
    align-self: stretch;
    background: #d8e0e8;
    border-radius: 999px;
    flex: 0 0 1px;
}

.ex-notes {
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px dashed var(--border-color);
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.ex-notes-label {
    font-size: 0.8rem;
    color: var(--text-muted);
}

.ex-notes-input {
    width: 100%;
    padding: 8px 10px;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    font: inherit;
    resize: vertical;
}

.status-btn {
    min-height: 36px;
    padding: 4px 10px;
    border: 1px solid var(--border-color);
    border-radius: 12px;
    background: white;
    font-size: 0.75rem;
    color: var(--text-muted);
}

.status-btn:hover {
    border-color: #ccc;
}

/* Active Status Styles */
.status-btn[data-status="visited"].active {
    background-color: var(--accent-visited);
    color: #172026;
    border-color: var(--accent-visited);
}

.status-btn[data-status="yes"].active {
    background-color: var(--accent-yes);
    color: white;
    border-color: var(--accent-yes);
}

.status-btn[data-status="maybe"].active {
    background-color: var(--accent-maybe);
    color: #172026;
    border-color: var(--accent-maybe);
}

/* Dialogs */
dialog {
    border: none;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    padding: 24px;
    max-width: 520px;
    max-height: calc(100dvh - 2rem);
    width: 90%;
    margin: auto; /* Ensure centering in viewport */
    overflow: auto;
}

/* Onboarding */
.onboarding-overlay {
    border: 0;
    background: transparent;
    padding: 20px;
    max-width: 560px;
    max-height: calc(100dvh - 2rem);
    width: min(560px, calc(100% - 32px));
    overflow: auto;
}

.onboarding-overlay::backdrop {
    background: rgba(0, 0, 0, 0.5);
}

.onboarding-card {
    background: white;
    border-radius: 12px;
    max-width: 520px;
    max-height: calc(100dvh - 40px);
    width: 100%;
    padding: 20px 22px;
    box-shadow: 0 8px 24px rgba(0,0,0,0.2);
    display: flex;
    flex-direction: column;
    gap: 12px;
    overflow: auto;
}

.onboarding-step {
    font-size: 0.8rem;
    color: var(--text-muted);
}

.onboarding-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-top: 8px;
}

.onboarding-nav {
    display: flex;
    gap: 8px;
}
dialog::backdrop {
    background: rgba(0,0,0,0.4);
}
.dialog-content h2 {
    margin-bottom: 12px;
}
.dialog-content p {
    margin-bottom: 20px;
    color: #555;
    line-height: 1.5;
}

.route-directions ol {
    margin: 8px 0 0 18px;
    padding-left: 18px;
    font-size: 0.95rem;
}

.route-directions li {
    font-size: 0.95rem;
    line-height: 1.4;
}


.about-list {
    margin: 0 0 16px 18px;
    color: #555;
    line-height: 1.5;
}

.about-version {
    font-size: 0.85rem;
    color: #888;
}
.data-actions {
    display: flex;
    gap: 12px;
    margin-bottom: 8px;
}

.import-status {
    min-height: 1.5em;
    margin-bottom: 0;
    font-size: 0.9rem;
}

.success-msg {
    color: #1e7e34;
}

.privacy-note {
    font-size: 0.9rem;
    color: var(--text-muted);
}

.dialog-actions {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
}

.route-planner {
    padding: 16px;
}
.route-inputs .input-group {
    margin-bottom: 12px;
    position: relative;
}
.route-inputs label {
    display: block;
    font-size: 0.8rem;
    margin-bottom: 4px;
    font-weight: 600;
}
.route-inputs input {
    width: 100%;
    min-height: 44px;
    padding: 10px 12px;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-size: 1rem;
}

.route-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
    margin-top: 8px;
}

.route-actions .primary-btn {
    flex: 1 1 160px;
}

.route-actions .primary-btn {
    min-height: 44px;
}

.route-inputs .primary-btn {
    width: 100%;
    margin-top: 8px;
}
.suggestions {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: white;
    border: 1px solid #ddd;
    border-top: none;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    list-style: none;
    max-height: 150px;
    overflow-y: auto;
    z-index: 20;
}
.suggestion-item {
    padding: 8px;
    font-size: 0.9rem;
    cursor: pointer;
    border-bottom: 1px solid #eee;
}
.suggestion-item:hover {
    background-color: #f1f1f1;
}

.route-results {
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid #eee;
}

.route-error {
    color: #c0392b;
    font-weight: 600;
}

.route-info {
    color: var(--text-muted);
    line-height: 1.5;
}

.route-summary {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.route-summary-grid {
    display: grid;
    gap: 10px;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
}

.route-summary-grid p {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 10px 12px;
    margin: 0;
    border-radius: 10px;
    background: #f8fafc;
    border: 1px solid #e6ebf0;
}

.route-summary-label {
    font-size: 0.78rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.route-directions {
    padding: 12px 14px 14px;
    border: 1px solid #dde5ed;
    border-radius: 12px;
    background: #fff;
}

.route-directions h4 {
    margin: 0 0 10px;
    color: var(--secondary-color);
}

.route-directions ol {
    margin-top: 0;
}

@media (max-width: 768px) {
    .panel-mobile-header {
        display: block;
        padding: 14px 16px 10px;
        border-bottom: 1px solid #e7ebef;
        background: linear-gradient(180deg, #ffffff 0%, #f7fafc 100%);
    }

    .panel-mobile-eyebrow {
        display: inline-block;
        margin-bottom: 6px;
        font-size: 0.72rem;
        font-weight: 700;
        letter-spacing: 0.08em;
        text-transform: uppercase;
        color: var(--primary-color);
    }

    .panel-mobile-header h2 {
        margin: 0;
        font-size: 1.15rem;
        line-height: 1.2;
        color: var(--secondary-color);
    }

    .panel-mobile-header p {
        margin: 6px 0 0;
        font-size: 0.84rem;
        line-height: 1.4;
        color: #66737f;
    }

    .search-bar input,
    .sort-control select,
    .ex-notes-input,
    .route-inputs input {
        font-size: 16px;
    }

    .search-bar {
        top: 0;
        z-index: 6;
        padding: 12px 16px 14px;
        box-shadow: 0 6px 16px rgba(44, 62, 80, 0.06);
    }

    #list-panel:not(.list-controls-expanded) .search-bar-body {
        display: none;
    }

    #list-panel:not(.list-controls-expanded) .search-bar {
        padding: 0;
        border-bottom: none;
        box-shadow: none;
    }

    .list-controls-toggle {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        gap: 8px;
        min-height: 44px;
        padding: 8px 12px;
        border: 1px solid #d8e0e8;
        border-radius: 10px;
        background: #ffffff;
        color: var(--secondary-color);
        font-size: 0.84rem;
        font-weight: 600;
        box-shadow: 0 2px 8px rgba(44, 62, 80, 0.06);
    }

    .list-controls-toggle i {
        font-size: 0.9rem;
    }

    .filter-controls {
        gap: 6px;
        overflow: visible;
        background: transparent;
    }

    .filter-tab {
        flex: 1 1 calc(33.333% - 6px);
        min-height: 44px;
        border-radius: 10px;
        border: 1px solid #d8e0e8;
        background: #f7f9fb;
        font-size: 0.84rem;
    }

    .filter-tab.active {
        border-color: rgba(52, 152, 219, 0.35);
        box-shadow: 0 4px 12px rgba(52, 152, 219, 0.15);
    }

    .list-status-bar {
        position: sticky;
        top: 86px;
        z-index: 5;
        flex-wrap: wrap;
        align-items: center;
        padding: 10px 16px;
        gap: 10px;
        background: rgba(249, 249, 249, 0.96);
        backdrop-filter: blur(10px);
    }

    .sort-control {
        width: 100%;
        justify-content: space-between;
        font-size: 0.82rem;
    }

    #list-panel:not(.list-controls-expanded) .sort-control {
        width: auto;
        flex: 1;
    }

    .sort-control select {
        min-height: 44px;
        padding: 8px 12px;
    }

    .exhibitor-list {
        padding-bottom: 24px;
    }

    .exhibitor-item {
        padding: 14px 16px;
    }

    .exhibitor-item.selected {
        padding-left: 14px;
        background: linear-gradient(180deg, #eef7ff 0%, #ffffff 100%);
    }

    .ex-header {
        align-items: flex-start;
        gap: 10px;
    }

    .ex-name {
        font-size: 1.02rem;
        line-height: 1.3;
    }

    .ex-stand {
        margin-left: 0;
        white-space: nowrap;
    }

    .ex-desc {
        -webkit-line-clamp: 1;
        margin-bottom: 10px;
    }

    .exhibitor-item.selected .ex-desc {
        -webkit-line-clamp: 2;
    }

    .status-btn {
        flex: 1 1 0;
        min-height: 44px;
        font-size: 0.82rem;
    }

    .status-separator {
        flex: 0 0 1px;
        width: 1px;
        height: auto;
    }

    .ex-notes {
        margin-top: 12px;
        padding-top: 12px;
    }

    .ex-notes-input {
        min-height: 108px;
    }

    .route-planner {
        position: sticky;
        top: 0;
        z-index: 6;
        padding: 14px 16px;
        background: linear-gradient(180deg, #f9fbfc 0%, rgba(249, 251, 252, 0.94) 100%);
        border-bottom: 1px solid #e6ebef;
        box-shadow: 0 6px 16px rgba(44, 62, 80, 0.06);
    }

    .route-planner > h2,
    .route-autocomplete-help {
        display: none;
    }

    .route-inputs label {
        font-size: 0.92rem;
    }

    .route-results {
        margin-top: 0;
        padding: 16px 16px calc(120px + env(safe-area-inset-bottom, 0px));
        border-top: none;
    }

    .route-summary-grid {
        grid-template-columns: 1fr;
    }

    .route-directions-mobile {
        padding-bottom: 28px;
    }
}

/* Exhibitor Notes */
.exhibitor-notes {
    padding: 16px;
}
