/**
 * Flight Display System - Frontend Styles
 */

:root {
    --fds-primary: #004b6c;
    --fds-secondary: #121b39;
    --fds-accent: #f8fafc;
    --fds-on-time: #10b981;
    --fds-delayed: #f59e0b;
    --fds-cancelled: #ef4444;
    --fds-boarding: #3b82f6;
    --fds-border: rgba(0, 0, 0, 0.1);
    --fds-text: #111827;
    --fds-text-light: #4b5563;
}

.fds-wrapper {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: linear-gradient(to bottom right, var(--fds-accent), #f1f5f9);
    padding: 0.75rem;
    min-height: 500px;
}

.fds-container {
    max-width: 1500px;
    margin: 0 auto;
}

/* Header */
.fds-header {
    background: white;
    border-radius: 0.5rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    padding: 0.75rem;
    margin-bottom: 0.75rem;
}

.fds-header-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.75rem;
    flex-wrap: wrap;
    gap: 0.75rem;
}

.fds-title-section {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.fds-icon {
    background: linear-gradient(135deg, var(--fds-primary), var(--fds-secondary));
    color: white;
    padding: 0.5rem;
    border-radius: 0.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

.fds-title {
    font-size: 1.125rem;
    font-weight: 700;
    color: var(--fds-secondary);
    margin: 0;
    line-height: 1.2;
}

.fds-status {
    display: flex;
    align-items: center;
    gap: 0.375rem;
    font-size: 0.813rem;
    color: var(--fds-text-light);
    margin-top: 0.125rem;
}

.fds-status-icon {
    width: 1rem;
    height: 1rem;
    color: var(--fds-on-time);
}

.fds-controls {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.fds-btn {
    padding: 0.5rem 1rem;
    border: none;
    border-radius: 0.375rem;
    cursor: pointer;
    font-size: 0.875rem;
    font-weight: 500;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.fds-btn-primary {
    background: linear-gradient(135deg, var(--fds-primary), var(--fds-secondary));
    color: white;
}

.fds-btn-primary:hover {
    opacity: 0.9;
}

.fds-btn-secondary {
    background: white;
    color: var(--fds-text);
    border: 1px solid var(--fds-border);
    font-size: 0.8125rem !important;
    padding: 0.3rem 0.75rem !important;
}

.fds-btn-secondary:hover {
    background: var(--fds-accent);
    color: var(--fds-primary);
    border-color: rgba(0, 75, 108, 0.25);
}

.fds-btn-icon {
    padding: 0.5rem;
    background: transparent;
    color: var(--fds-primary);
}

.fds-btn-icon:hover {
    background: var(--fds-accent);
}

.fds-btn-icon span {
    display: inline;
}

.fds-language-toggle {
    display: flex;
    gap: 0.25rem;
    background: var(--fds-accent);
    padding: 0.25rem;
    border-radius: 0.375rem;
}

.fds-lang-btn {
    padding: 0.375rem 0.75rem;
    border: none;
    background: transparent;
    border-radius: 0.25rem;
    cursor: pointer;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--fds-text);
    transition: all 0.2s;
}

.fds-lang-btn.active {
    background: white;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

/* Footer Bar */
.fds-footer-bar {
    background: white;
    border-radius: 0.5rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
    margin-top: 0.75rem;
    padding: 0.5rem 0.75rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
}

.fds-footer-actions {
    display: flex;
    gap: 0.375rem;
}

.fds-footer-action-btn {
    padding: 0.375rem 0.875rem !important;
    border-radius: 0.375rem !important;
    font-size: 0.8125rem !important;
    font-weight: 500 !important;
    display: inline-flex !important;
    align-items: center !important;
    gap: 0.375rem !important;
    cursor: pointer !important;
    transition: all 0.15s ease !important;
    border: 1px solid var(--fds-border) !important;
    background: white !important;
    color: var(--fds-text) !important;
    text-decoration: none !important;
    line-height: 1.3 !important;
}

.fds-footer-action-btn:hover {
    background: var(--fds-accent) !important;
    border-color: rgba(0, 75, 108, 0.25) !important;
    color: var(--fds-primary) !important;
}

.fds-footer-action-btn i,
.fds-footer-action-btn svg {
    width: 0.875rem !important;
    height: 0.875rem !important;
    flex-shrink: 0 !important;
    opacity: 0.6;
}

.fds-footer-action-btn:hover i,
.fds-footer-action-btn:hover svg {
    opacity: 1;
}

#fds-find-flight-btn .fds-btn-icon-search,
#fds-find-flight-btn .fds-btn-icon-plane {
    display: inline-flex;
    align-items: center;
    transition: opacity 0.2s ease, transform 0.2s ease;
}

#fds-find-flight-btn .fds-btn-icon-plane {
    display: none;
}

#fds-find-flight-btn:hover .fds-btn-icon-search {
    display: none;
}

#fds-find-flight-btn:hover .fds-btn-icon-plane {
    display: inline-flex;
    animation: fds-plane-fly 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

#fds-find-flight-btn.fds-footer-action-btn {
    background: var(--fds-primary) !important;
    color: white !important;
    border: 1px solid var(--fds-primary) !important;
}

#fds-find-flight-btn.fds-footer-action-btn i,
#fds-find-flight-btn.fds-footer-action-btn svg {
    opacity: 0.85;
}

#fds-find-flight-btn.fds-footer-action-btn:hover {
    background: var(--fds-secondary) !important;
    border-color: var(--fds-secondary) !important;
    color: white !important;
    box-shadow: 0 4px 12px rgba(0, 75, 108, 0.25) !important;
    transform: translateY(-1px);
}

#fds-find-flight-btn.fds-footer-action-btn:hover i,
#fds-find-flight-btn.fds-footer-action-btn:hover svg {
    opacity: 1;
}

@keyframes fds-plane-fly {
    0%   { transform: translate(0, 0) rotate(0deg) scale(1); opacity: 1; }
    15%  { transform: translate(2px, -2px) rotate(-10deg) scale(1.1); opacity: 1; }
    40%  { transform: translate(18px, -10px) rotate(-15deg) scale(0.6); opacity: 0; }
    41%  { transform: translate(-18px, 8px) rotate(10deg) scale(0.4); opacity: 0; }
    60%  { transform: translate(-8px, 4px) rotate(5deg) scale(0.8); opacity: 0.6; }
    80%  { transform: translate(-2px, 1px) rotate(2deg) scale(1); opacity: 1; }
    100% { transform: translate(0, 0) rotate(0deg) scale(1); opacity: 1; }
}

.fds-footer-meta {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-shrink: 0;
}

.fds-footer-status {
    display: flex;
    align-items: center;
    gap: 0.375rem;
    font-size: 0.75rem;
    color: #6b7280;
}

.fds-footer-status .fds-status-icon {
    width: 0.875rem;
    height: 0.875rem;
    color: var(--fds-on-time);
}

.fds-footer-status .fds-last-update {
    font-size: 0.75rem;
    color: #6b7280;
}

.fds-footer-bar .fds-language-toggle {
    display: flex;
    gap: 0.125rem;
    background: #f3f4f6;
    padding: 0.125rem;
    border-radius: 0.25rem;
    border: 1px solid rgba(0, 0, 0, 0.05);
}

.fds-footer-bar .fds-lang-btn {
    padding: 0.1875rem 0.5rem;
    font-size: 0.6875rem;
    font-weight: 600;
    color: #9ca3af;
    letter-spacing: 0.03em;
    border: none;
    background: transparent;
    border-radius: 0.1875rem;
    cursor: pointer;
    transition: all 0.15s;
}

.fds-footer-bar .fds-lang-btn:hover {
    color: #6b7280;
}

.fds-footer-bar .fds-lang-btn.active {
    background: var(--fds-primary);
    color: white;
    box-shadow: 0 1px 2px rgba(0, 75, 108, 0.15);
}

@media (max-width: 600px) {
    .fds-footer-bar {
        flex-wrap: wrap;
    }

    .fds-footer-actions {
        width: 100%;
    }

    .fds-footer-action-btn {
        flex: 1 !important;
        justify-content: center !important;
        font-size: 0.75rem !important;
    }

    .fds-footer-meta {
        width: 100%;
        justify-content: space-between;
    }
}


.fds-airport-selector {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

/* Archive has 3 airport buttons: "All" on row 1, the two airports on row 2 */
#fds-archive-display .fds-airport-selector {
    flex-wrap: wrap;
}

#fds-archive-display .fds-airport-selector .fds-airport-btn:first-child {
    width: 100%;
}

#fds-archive-display .fds-airport-selector .fds-airport-btn:not(:first-child) {
    flex: 1;
}

.fds-airport-btn {
    flex: 1;
    padding: 0.3rem 0.6rem !important;
    border: 1px solid var(--fds-border) !important;
    background: white !important;
    border-radius: 0.375rem !important;
    cursor: pointer;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 0.3rem !important;
    font-weight: 600 !important;
    font-size: 0.813rem !important;
    transition: all 0.2s;
    line-height: 1 !important;
}

.fds-airport-btn i {
    width: 0.875rem !important;
    height: 0.875rem !important;
}

.fds-airport-btn.active {
    background: linear-gradient(135deg, var(--fds-primary), var(--fds-secondary)) !important;
    color: white !important;
    border-color: transparent !important;
    box-shadow: 0 2px 4px rgba(0, 75, 108, 0.2) !important;
}

/* Search */
.fds-search-wrapper {
    position: relative;
}

.fds-search-icon {
    position: absolute;
    left: 0.75rem;
    top: 50%;
    transform: translateY(-50%);
    width: 1rem;
    height: 1rem;
    color: var(--fds-text-light);
}

.fds-search {
    width: 100%;
    padding: 0.625rem 0.75rem 0.625rem 2.5rem;
    border: 1px solid var(--fds-border);
    border-radius: 0.5rem;
    font-size: 0.875rem;
}

.fds-search:focus {
    outline: none;
    border-color: var(--fds-primary);
}

/* Main Content */
.fds-main {
    background: white;
    border-radius: 0.5rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    overflow: hidden;
}

.fds-tabs-header {
    background: white !important;
    border-bottom: 1px solid rgba(0, 0, 0, 0.06);
    padding: 0.5rem 0.75rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.375rem;
}

.fds-tabs {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.25rem;
    background: #f3f4f6;
    padding: 0.1875rem;
    border-radius: 0.375rem;
    border: 1px solid rgba(0, 0, 0, 0.06);
    min-width: 0;
}

.fds-tab {
    padding: 0.3rem 1rem !important;
    border: none !important;
    background: transparent !important;
    border-radius: 0.25rem !important;
    cursor: pointer;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 0.3rem !important;
    font-size: 0.8rem !important;
    font-weight: 600 !important;
    color: #6b7280 !important;
    transition: all 0.15s;
    line-height: 1 !important;
    white-space: nowrap !important;
}

.fds-tab i {
    width: 0.8125rem !important;
    height: 0.8125rem !important;
}

.fds-tab.active {
    background: var(--fds-primary) !important;
    color: white !important;
    box-shadow: 0 1px 3px rgba(0, 75, 108, 0.2) !important;
}

.fds-filters {
    display: flex;
    gap: 0.375rem;
    align-items: center;
    flex-wrap: wrap;
}

.fds-filters > span {
    font-size: 0.813rem !important;
    font-weight: 600 !important;
    line-height: 1 !important;
}

.fds-select {
    padding: 0.3rem 0.6rem !important;
    border: 1px solid var(--fds-border) !important;
    border-radius: 0.25rem !important;
    font-size: 0.813rem !important;
    font-weight: 600 !important;
    background: white !important;
    cursor: pointer;
    line-height: 1 !important;
}

.fds-input {
    width: 100%;
    max-width: 100%;
    padding: 0.625rem 0.75rem;
    border: 1px solid var(--fds-border);
    border-radius: 0.375rem;
    font-size: 0.875rem;
    font-family: inherit;
    background: white;
    transition: all 0.2s;
    outline: none;
    box-sizing: border-box;
}

.fds-input:focus {
    border-color: var(--fds-primary);
    box-shadow: 0 0 0 3px rgba(0, 75, 108, 0.1);
}

.fds-input::placeholder {
    color: #9ca3af;
}

.fds-input[type="date"] {
    cursor: pointer;
    min-width: 0;
    /* Strip native mobile date picker chrome so it matches text inputs */
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    line-height: 1.4;
    height: auto;
    /* iOS adds internal padding — override it */
    padding: 0.625rem 0.75rem;
    color: var(--fds-text);
}

.fds-active-filters {
    display: flex;
    gap: 0.375rem;
    flex-wrap: wrap;
    align-items: center;
}

.fds-filter-tag {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.25rem 0.5rem;
    background: linear-gradient(135deg, var(--fds-primary), var(--fds-secondary));
    color: white;
    border-radius: 0.25rem;
    font-size: 0.75rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    position: relative;
}

.fds-filter-tag:hover {
    opacity: 0.9;
    padding-right: 1.5rem;
}

.fds-filter-tag-close {
    display: none;
    position: absolute;
    right: 0.25rem;
    width: 0.875rem;
    height: 0.875rem;
    color: white;
    opacity: 0.9;
}

.fds-filter-tag:hover .fds-filter-tag-close {
    display: block;
}

/* Flight Table */
.fds-flight-table {
    padding: 0.5rem;
    max-height: calc(10 * 3rem + 3rem);
    overflow-y: auto;
    overflow-x: hidden;
    position: relative;
    scroll-behavior: smooth;
}

/* Custom scrollbar styling for limited height containers */
.fds-flight-table[style*="max-height"] {
    scrollbar-width: thin;
    scrollbar-color: #cbd5e1 #f1f5f9;
    border-radius: 0 0 0.5rem 0.5rem;
}

.fds-flight-table[style*="max-height"]::-webkit-scrollbar {
    width: 8px;
}

.fds-flight-table[style*="max-height"]::-webkit-scrollbar-track {
    background: #f1f5f9;
    border-radius: 4px;
}

.fds-flight-table[style*="max-height"]::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 4px;
}

.fds-flight-table[style*="max-height"]::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

/* Fade effect at bottom when scrollable */
.fds-flight-table[style*="max-height"]::after {
    content: '';
    position: sticky;
    bottom: 0;
    left: 0;
    right: 0;
    height: 40px;
    background: linear-gradient(to top, rgba(255, 255, 255, 0.95), transparent);
    pointer-events: none;
    display: block;
    z-index: 5;
}

.fds-table {
    width: 100%;
    border-collapse: collapse;
    table-layout: auto;
}

.fds-table thead {
    position: sticky;
    top: 0;
    z-index: 20;
}

.fds-table th {
    padding: 0.5rem 0.625rem;
    text-align: left;
    font-size: 0.75rem;
    font-weight: 600;
    color: #111827;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    white-space: nowrap;
    line-height: 1.3;
    background: #f8fafc;
    position: sticky;
    top: 0;
    z-index: 20;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.06);
}

.fds-airline-cell {
    display: flex;
    align-items: center;
    gap: 0.625rem;
}

.fds-airline-logo {
    width: 2rem;
    height: 2rem;
    object-fit: contain;
    border-radius: 0.25rem;
    flex-shrink: 0;
}

.fds-flight-number {
    font-family: monospace;
    font-weight: 700;
    font-size: 0.9rem;
    color: #004b6c;
}

.fds-status-badge {
    display: inline-block;
    padding: 0.25rem 0.5rem;
    border-radius: 0.25rem;
    font-size: 0.75rem;
    font-weight: 600;
    color: white;
    white-space: nowrap;
    line-height: 1.3;
}

.fds-status-scheduled { background: #6b7280; }
.fds-status-on-time { background: var(--fds-on-time); }
.fds-status-delayed { background: var(--fds-delayed); }
.fds-status-cancelled { background: var(--fds-cancelled); }
.fds-status-boarding { background: var(--fds-boarding); }
.fds-status-departed, .fds-status-arrived { background: #10b981; }
.fds-status-check-in { background: #3b82f6; }
.fds-status-gate-open { background: #8b5cf6; }
.fds-status-gate-closed { background: #6366f1; }
.fds-status-standby { background: #f97316; }

/* Disclaimer banner */
.fds-disclaimer {
    display: flex;
    align-items: flex-start;
    gap: 0.625rem;
    margin-top: 0.75rem;
    padding: 0.75rem 1rem;
    background: #f0f9ff;
    border: 1px solid #bae6fd;
    border-radius: 0.5rem;
    color: #0c4a6e;
}

.fds-disclaimer-icon {
    width: 1rem;
    height: 1rem;
    flex-shrink: 0;
    margin-top: 0.125rem;
    color: #0284c7;
}

.fds-disclaimer-text {
    margin: 0;
    font-size: 0.75rem;
    line-height: 1.6;
    color: #075985;
}

@media (max-width: 480px) {
    .fds-disclaimer {
        padding: 0.625rem 0.75rem;
    }
    .fds-disclaimer-text {
        font-size: 0.6875rem;
    }
}

/* Loading */
.fds-loading {
    text-align: center;
    padding: 3rem;
    color: var(--fds-text-light);
    position: relative;
    min-height: 200px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.fds-loading-animation {
    position: relative;
    width: 80px;
    height: 80px;
    margin: 0 auto 1.5rem;
}

.fds-loader-icon {
    width: 64px;
    height: 64px;
    color: var(--fds-primary);
    animation: spin 1.2s linear infinite;
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }
    100% {
        transform: rotate(360deg);
    }
}

@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.fds-table tbody tr {
    border-bottom: 2px solid #e5e7eb;
    transition: all 0.2s;
    min-height: 3rem;
    background: white;
    animation: fadeInUp 0.4s ease-out forwards;
}

.fds-table tbody tr:nth-child(even) {
    background: #f9fafb;
}

.fds-table tbody tr:hover {
    background: rgba(0, 75, 108, 0.04) !important;
    transform: scale(1.005);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.fds-table td {
    padding: 0.75rem 0.875rem;
    font-size: 0.9rem;
    color: #1f2937;
    vertical-align: middle;
    line-height: 1.4;
}

.fds-mobile-card {
    animation: fadeInUp 0.4s ease-out forwards;
}

/* Empty State */
/* Empty State */
.fds-empty {
    text-align: center;
    padding: 3rem;
    color: var(--fds-text-light);
}

/* Modal */
.fds-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 10000;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    overflow-y: auto;
}

.fds-modal.active {
    display: flex;
}

.fds-modal-content {
    background: white;
    border-radius: 0.5rem;
    width: 90%;
    max-width: 500px;
    max-height: calc(100vh - 2rem);
    overflow-y: auto;
    margin: auto;
}

.fds-modal-header {
    padding: 1rem;
    border-bottom: 1px solid var(--fds-border);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.fds-modal-header h3 {
    margin: 0;
    font-size: 1.125rem;
    font-weight: 600;
}

.fds-modal-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--fds-text-light);
}

.fds-modal-body {
    padding: 1rem;
    overflow-x: hidden;
}

/* Prevent date/text inputs from overflowing the modal body */
.fds-modal-body .fds-input {
    max-width: 100%;
    width: 100%;
    box-sizing: border-box;
}

.fds-filter-group {
    margin-bottom: 1rem;
}

.fds-filter-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-size: 0.875rem;
    font-weight: 500;
}

.fds-filter-group select {
    width: 100%;
    padding: 0.5rem;
    border: 1px solid var(--fds-border);
    border-radius: 0.375rem;
    font-size: 0.875rem;
}

.fds-modal-footer {
    padding: 1rem;
    border-top: 1px solid var(--fds-border);
    display: flex;
    justify-content: flex-end;
    gap: 0.5rem;
}

/* Mobile */
.fds-mobile-card {
    display: none;
}

@media (max-width: 1024px) {
    .fds-table {
        display: none;
    }
    
    /* Single scroll container on mobile — eliminates nested-scroll trap.
       .fds-flight-table scrolls; .fds-mobile-cards flows inside it.
       Browser scroll-chaining propagates to the page at boundaries. */
    .fds-flight-table {
        max-height: 70vh !important; /* Override inline styles from shortcode attributes */
        overflow-y: auto !important;
        overflow-x: hidden !important;
        -webkit-overflow-scrolling: touch;
        overscroll-behavior-y: auto; /* Allow scroll chaining to page */
    }
    
    .fds-mobile-cards {
        max-height: none;
        overflow: visible;
        padding-right: 0.5rem;
    }
    
    .fds-mobile-card {
        display: block;
        border: 2px solid #e5e7eb;
        border-radius: 0.5rem;
        margin-bottom: 1rem;
        overflow: hidden;
        background: white;
        box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
    }
    
    .fds-mobile-card:nth-child(even) {
        background: #f9fafb;
    }
    
    .fds-mobile-header {
        padding: 0.875rem;
        background: inherit;
        cursor: pointer;
        display: flex;
        justify-content: space-between;
        align-items: start;
        transition: all 0.2s ease;
    }
    
    .fds-mobile-header:hover {
        background: rgba(0, 75, 108, 0.04);
    }
    
    .fds-mobile-details {
        padding: 0.875rem;
        background: rgba(0, 75, 108, 0.02);
        border-top: 2px solid #e5e7eb;
        display: none;
    }
    
    .fds-mobile-details.active {
        display: block;
    }
    
    .fds-tabs {
        width: 100%;
    }
    
    .fds-tab {
        padding: 0.4rem 0.5rem !important;
    }
    
    .fds-filters {
        width: 100%;
        flex-direction: column;
        align-items: stretch;
    }
    
    #fds-filter-btn {
        width: 100%;
        justify-content: center;
    }
    
    .fds-active-filters {
        width: 100%;
        justify-content: flex-start;
    }
}

/* Archive Specific Styles */
.fds-date-range {
    display: flex;
    align-items: flex-end;
    gap: 0.5rem;
    margin-top: 0.75rem;
}

.fds-date-range-field {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.fds-date-range-label {
    font-size: 0.6875rem;
    font-weight: 600;
    color: var(--fds-text-light);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    padding-left: 0.125rem;
}

.fds-date-range input[type="date"] {
    width: 100%;
    min-width: 0;
    box-sizing: border-box;
    flex: unset;
}

.fds-date-range-sep {
    padding-bottom: 0.4rem;
    color: var(--fds-text-light);
    font-weight: 500;
    flex-shrink: 0;
}

.fds-pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.5rem;
    padding: 1rem;
    flex-wrap: wrap;
}

.fds-pagination-btn {
    padding: 0.5rem 0.75rem;
    border: 1px solid var(--fds-border);
    background: white;
    border-radius: 0.375rem;
    cursor: pointer;
    font-size: 0.875rem;
    font-weight: 600;
    transition: all 0.2s;
}

.fds-pagination-btn:hover:not(:disabled) {
    background: var(--fds-accent);
    border-color: var(--fds-primary);
}

.fds-pagination-btn.active {
    background: linear-gradient(135deg, var(--fds-primary), var(--fds-secondary));
    color: white;
    border-color: transparent;
}

.fds-pagination-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.fds-pagination-info {
    font-size: 0.875rem;
    color: var(--fds-text);
    padding: 0 0.5rem;
}

/* Data Staleness Notification */
.fds-staleness-notification {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.875rem 1rem;
    margin: 1rem 0.5rem 0.5rem;
    background: linear-gradient(135deg, #fef3c7, #fde68a);
    border: 1px solid #fbbf24;
    border-radius: 0.5rem;
    box-shadow: 0 2px 4px rgba(251, 191, 36, 0.1);
    animation: fadeInUp 0.4s ease-out;
}

.fds-staleness-icon {
    flex-shrink: 0;
    width: 2rem;
    height: 2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(245, 158, 11, 0.15);
    border-radius: 50%;
    color: #d97706;
}

.fds-staleness-icon i {
    width: 1.25rem;
    height: 1.25rem;
}

.fds-staleness-content {
    flex: 1;
}

.fds-staleness-title {
    font-weight: 600;
    font-size: 0.875rem;
    color: #92400e;
    line-height: 1.3;
}

.fds-staleness-time {
    font-size: 0.75rem;
    color: #78350f;
    margin-top: 0.125rem;
    line-height: 1.3;
}

@media (max-width: 768px) {
    .fds-staleness-notification {
        margin: 1rem 0 0.5rem;
        padding: 0.75rem;
    }
    
    .fds-staleness-icon {
        width: 1.75rem;
        height: 1.75rem;
    }
    
    .fds-staleness-icon i {
        width: 1rem;
        height: 1rem;
    }
    
    .fds-staleness-title {
        font-size: 0.813rem;
    }
    
    .fds-staleness-time {
        font-size: 0.688rem;
    }
    
    /* Mobile font size adjustments for better readability */
    .fds-table td {
        font-size: 0.85rem;
        padding: 0.625rem 0.5rem;
    }
    
    .fds-table th {
        font-size: 0.7rem;
        padding: 0.4rem 0.5rem;
    }
    
    .fds-flight-number {
        font-size: 0.85rem;
    }
    
    .fds-airline-logo {
        width: 1.75rem;
        height: 1.75rem;
    }
    
    .fds-status-badge {
        font-size: 0.7rem;
        padding: 0.2rem 0.4rem;
    }
    
    /* Modal adjustments for mobile */
    .fds-modal-content {
        width: 95%;
        max-width: 95vw;
    }
    
    .fds-modal-body {
        padding: 0.75rem;
    }
    
    .fds-modal-footer {
        padding: 0.75rem;
    }
    
    .fds-filter-group {
        margin-bottom: 0.75rem;
    }
    
    /* Date input: enforce identical appearance to text inputs on mobile */
    .fds-input[type="date"] {
        -webkit-appearance: none;
        appearance: none;
        max-width: 100%;
        width: 100%;
        min-width: 0;
        box-sizing: border-box;
        font-size: 0.875rem;
        padding: 0.625rem 0.75rem;
        line-height: 1.4;
        color: var(--fds-text);
    }
}

/* ─── Tablet (≤ 768px) ── Airport, Date range, Tabs ────────────────────────── */
@media (max-width: 768px) {
    /* Airport selector: stack vertically, truncate long names */
    .fds-airport-selector {
        flex-direction: column;
        gap: 0.375rem;
    }

    .fds-airport-btn {
        justify-content: flex-start !important;
        font-size: 0.75rem !important;
        padding: 0.5rem 0.75rem !important;  /* larger touch target */
        min-height: 2.5rem;
    }

    .fds-airport-btn span {
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
        min-width: 0;
    }

    /* Date range: stack vertically */
    .fds-date-range {
        flex-direction: column;
        gap: 0.375rem;
    }

    .fds-date-range-sep {
        display: none;
    }

    .fds-date-range-field {
        width: 100%;
    }

    .fds-date-range input[type="date"] {
        padding: 0.5rem 0.625rem !important;
        font-size: 0.875rem !important;
        min-height: 2.5rem;
    }

    /* Tabs: ensure they fit, increase touch targets */
    .fds-tabs {
        min-width: 0 !important;
        width: 100%;
    }

    .fds-tab {
        padding: 0.5rem 0.375rem !important;
        min-height: 2.25rem;
        font-size: 0.75rem !important;
    }

    .fds-tab span {
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }
}

/* ─── Phone (≤ 480px) ── Compact layout ───────────────────────────────────── */
@media (max-width: 480px) {
    .fds-wrapper {
        padding: 0.375rem;
    }

    .fds-header {
        padding: 0.5rem;
    }

    /* Airport buttons: icon + short text */
    .fds-airport-btn {
        font-size: 0.6875rem !important;
        padding: 0.4375rem 0.5rem !important;
    }

    /* Tabs: hide text on tiny screens, show icons only */
    .fds-tab span {
        display: none !important;
    }

    .fds-tab {
        padding: 0.5rem !important;
        justify-content: center !important;
    }

    .fds-tab i {
        width: 1rem !important;
        height: 1rem !important;
    }

    /* Footer buttons — keep text visible on phones, just reduce size */
    .fds-footer-action-btn {
        padding: 0.4375rem 0.625rem !important;
        font-size: 0.6875rem !important;
    }

    .fds-footer-bar {
        padding: 0.375rem 0.5rem;
    }

    /* Search input */
    .fds-search {
        font-size: 0.8125rem;
        padding: 0.5rem 0.5rem 0.5rem 2.25rem;
    }

    /* Mobile card spacing */
    .fds-mobile-card {
        margin-bottom: 0.625rem;
    }

    .fds-mobile-header {
        padding: 0.625rem !important;
    }

    .fds-mobile-details {
        padding: 0.625rem !important;
    }

    /* Pagination compact */
    .fds-pagination {
        gap: 0.25rem;
        padding: 0.625rem 0.25rem;
    }

    .fds-pagination-btn {
        padding: 0.375rem 0.5rem;
        font-size: 0.75rem;
    }

    .fds-pagination-info {
        font-size: 0.75rem;
    }

    /* Filter modal: full-width but stays centered */
    .fds-modal-content {
        width: calc(100% - 1rem);
        max-width: 100%;
        border-radius: 0.5rem;
        margin: auto;
        max-height: 85vh;
    }
}
