html {
    scroll-behavior: smooth;
}

body {
    overflow-y: auto;
    padding: 3rem 2rem;
    height: auto;
    min-height: 100vh;
}

.admin-container {
    max-width: 1000px;
    margin: 0 auto;
}

.admin-card {
    background: var(--card-bg);
    border: 1px solid var(--glass-border);
    padding: 2rem;
    border-radius: 12px;
    margin-bottom: 3rem;
    backdrop-filter: blur(10px);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
}

.form-group {
    margin-bottom: 1.5rem;
}

label {
    display: block;
    margin-bottom: 0.5rem;
    color: var(--text-secondary);
    font-size: 0.9rem;
    font-weight: 600;
}

/* Improved spacing for sub-panels within cards */
.admin-sub-panel {
    padding: 1.5rem;
    border-radius: 12px;
    margin-top: 2rem;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

input,
select,
textarea {
    width: 100%;
    padding: 0.8rem;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--glass-border);
    color: var(--text-primary);
    border-radius: 6px;
    font-family: inherit;
}

/* Light theme form adjustments */
body.light-theme input,
body.light-theme select,
body.light-theme textarea {
    background: rgba(0, 0, 0, 0.05);
}

select option {
    background: var(--bg-color);
    color: var(--text-primary);
}

body.light-theme select option {
    background: #fff;
    color: #1e293b;
}

textarea {
    height: 80px;
    resize: vertical;
}

.btn {
    background: var(--accent-blue);
    color: #000;
    border: none;
    padding: 0.8rem 1.5rem;
    border-radius: 6px;
    font-weight: bold;
    cursor: pointer;
    transition: transform 0.2s;
}

.btn:hover {
    transform: scale(1.02);
}

.btn-danger {
    background: var(--accent-red);
    color: white;
}
.version-tag {
    font-size: 0.65rem;
    font-weight: 400;
    color: var(--text-muted);
    background: rgba(255, 255, 255, 0.05);
    padding: 0.1rem 0.4rem;
    border-radius: 4px;
    vertical-align: middle;
    margin-left: 0.5rem;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.stands-list {
    margin-top: 1rem;
}

.stand-edit-row {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1rem;
    margin-bottom: 2rem;
    align-items: end;
    background: rgba(255, 255, 255, 0.02);
    padding: 1.5rem;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.nav-links {
    margin-bottom: 2rem;
}

.nav-links a {
    color: var(--accent-blue);
    text-decoration: none;
    font-weight: bold;
}

/* Sticky Admin Nav */
.admin-nav {
    position: sticky;
    top: 0;
    z-index: 1000;
    background: var(--bg-color);
    padding: 0.75rem 0;
    border-bottom: 1px solid var(--glass-border);
    margin-bottom: 2rem;
    backdrop-filter: blur(10px);
}

.admin-nav ul {
    display: flex;
    justify-content: center;
    /* Center the menu items */
    list-style: none;
    gap: 1.5rem;
    margin: 0;
    padding: 0;
    overflow-x: auto;
    scrollbar-width: none;
}

.admin-nav a {
    text-decoration: none;
    color: var(--text-primary);
    font-weight: 600;
    transition: all 0.2s;
    position: relative;
    display: inline-block;
}

.admin-nav a:hover,
.admin-nav a.active-nav {
    color: var(--accent-blue);
    font-weight: bold;
    transform: translateY(-2px);
}

.admin-nav a::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 10%;
    width: 0;
    height: 2px;
    background: var(--accent-blue);
    transition: width 0.3s;
}

.admin-nav a.active-nav::after {
    width: 80%;
}

/* Collapsible Sections */
.collapsible-header {
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.collapsible-header::after {
    content: '▼';
    font-size: 0.8rem;
    transition: transform 0.3s;
}

.collapsed .collapsible-header::after {
    transform: rotate(-90deg);
}

.collapsible-content {
    max-height: 5000px;
    overflow: hidden;
    transition: max-height 0.4s ease-out, opacity 0.3s;
    opacity: 1;
}

.collapsed .collapsible-content {
    max-height: 0;
    opacity: 0;
    margin-bottom: 0;
}

.admin-card.collapsed {
    margin-bottom: 1rem;
    padding-bottom: 1rem;
}

/* Back to top button */
.back-to-top {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    background: var(--accent-blue);
    color: #000;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    font-weight: bold;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
    z-index: 999;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    opacity: 0;
    visibility: hidden;
    transform: translateY(20px);
}

.back-to-top.visible {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.back-to-top:hover {
    transform: scale(1.1) translateY(-5px);
    background: #fff;
}

/* Category Selectors - Visual Improvement */
.category-wrapper {
    position: relative;
    display: flex !important;   /* override global label{display:block} */
    flex-direction: column;
    min-width: 0;
    width: 100%;                /* fill the grid cell */
}

.category-checkbox {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

.category-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.35rem;
    padding: 0.6rem 0.4rem;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--glass-border);
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    text-align: center;
    width: 100%;
    box-sizing: border-box;
    /* Fixed height for uniform square-ish tiles */
    height: 90px;
    overflow: hidden;
}

.category-card:hover {
    background: rgba(255, 255, 255, 0.1);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.category-checkbox:checked+.category-card {
    background: rgba(245, 158, 11, 0.2);
    border-color: var(--accent-amber);
    box-shadow: 0 0 0 1px var(--accent-amber), 0 4px 15px rgba(245, 158, 11, 0.2);
}

.category-icon {
    font-size: 1.6rem;
    margin-bottom: 0.1rem;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.3));
    line-height: 1;
}

.category-name {
    font-weight: 600;
    font-size: 0.78rem;
    color: var(--text-secondary);
    transition: color 0.3s;
    line-height: 1.2;
}

.category-checkbox:checked+.category-card .category-name {
    color: #fff;
    text-shadow: 0 0 10px rgba(245, 158, 11, 0.5);
}

/* Checkmark indicator */
.category-card::after {
    content: '✓';
    position: absolute;
    top: 10px;
    right: 10px;
    font-size: 0.8rem;
    background: var(--accent-amber);
    color: black;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transform: scale(0);
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    font-weight: bold;
}

.category-checkbox:checked+.category-card::after {
    opacity: 1;
    transform: scale(1);
}

/* Filter Buttons for Unavailabilities */
.btn-filter {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--glass-border);
    color: var(--text-secondary);
    padding: 0.5rem 1rem;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-filter:hover {
    background: rgba(255, 255, 255, 0.1);
}

.btn-filter.active {
    background: rgba(56, 189, 248, 0.2);
    border-color: var(--accent-blue);
    color: #fff;
    font-weight: bold;
}

/* Color Accent Cards */
.card-amber {
    border-left: 5px solid var(--accent-amber) !important;
}

.card-red {
    border-left: 5px solid var(--accent-red) !important;
}

.card-blue {
    border-left: 5px solid var(--accent-blue) !important;
}

.card-purple {
    border-left: 5px solid #8b5cf6 !important;
}

.card-green {
    border-left: 5px solid #10b981 !important;
}

.card-indigo {
    border-left: 5px solid #6366f1 !important;
}

.card-pink {
    border-left: 5px solid #ec4899 !important;
}


/* Sub-panels with background colors - Base class */
.panel-amber,
.panel-red,
.panel-blue,
.panel-purple,
.panel-green,
.panel-indigo,
.panel-pink {
    padding: 1.5rem;
    border-radius: 12px;
    border-width: 1px;
    border-style: solid;
}

.panel-amber {
    background: linear-gradient(135deg, rgba(251, 191, 36, 0.1), rgba(245, 158, 11, 0.05));
    border-color: rgba(251, 191, 36, 0.3);
}

.panel-red {
    background: rgba(239, 68, 68, 0.1);
    border-color: rgba(239, 68, 68, 0.3);
}

.panel-blue {
    background: rgba(56, 189, 248, 0.1);
    border-color: rgba(56, 189, 248, 0.3);
}

.panel-purple {
    background: rgba(139, 92, 246, 0.1);
    border-color: rgba(139, 92, 246, 0.3);
}

.panel-green {
    background: rgba(16, 185, 129, 0.1);
    border-color: rgba(16, 185, 129, 0.3);
}

.panel-indigo {
    background: rgba(99, 102, 241, 0.1);
    border-color: rgba(99, 102, 241, 0.3);
}

.panel-pink {
    background: rgba(236, 72, 153, 0.1);
    border-color: rgba(236, 72, 153, 0.3);
}

/* Layout Utilities */
.grid-2-col {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

.grid-3-col {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
}

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

.flex-between {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.flex-end {
    display: flex;
    justify-content: flex-end;
    align-items: flex-end;
    gap: 1rem;
}

.section-title {
    margin: 0 0 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    padding-bottom: 0.75rem;
}

.panel-amber .section-title {
    color: var(--accent-amber);
    border-color: rgba(251, 191, 36, 0.2);
}

.panel-red .section-title {
    color: var(--accent-red);
    border-color: rgba(239, 68, 68, 0.2);
}

.panel-blue .section-title {
    color: var(--accent-blue);
    border-color: rgba(56, 189, 248, 0.2);
}

.panel-purple .section-title {
    color: #8b5cf6;
    border-color: rgba(139, 92, 246, 0.2);
}

.panel-green .section-title {
    color: #10b981;
    border-color: rgba(16, 185, 129, 0.2);
}

.panel-indigo .section-title {
    color: #6366f1;
    border-color: rgba(99, 102, 241, 0.2);
}

.panel-pink .section-title {
    color: #ec4899;
    border-color: rgba(236, 72, 153, 0.2);
}

/* Notification System */
.notification {
    position: fixed;
    top: 20px;
    right: 20px;
    background: var(--card-bg);
    border: 1px solid var(--glass-border);
    border-radius: 8px;
    padding: 1rem 1.5rem;
    display: flex;
    align-items: center;
    gap: 1.2rem;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
    z-index: 10000;
    transform: translateX(450px);
    opacity: 0;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    min-width: 300px;
    max-width: 450px;
    backdrop-filter: blur(15px);
}

.notification.show {
    transform: translateX(0);
    opacity: 1;
}

.notification-icon {
    font-size: 1.8rem;
    flex-shrink: 0;
}

.notification-content {
    flex: 1;
}

.notification-title {
    font-weight: 700;
    font-size: 1rem;
    margin-bottom: 2px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.notification-message {
    font-size: 0.9rem;
    color: var(--text-secondary);
    line-height: 1.4;
}

.notification-success {
    border-left: 6px solid var(--accent-green);
}

.notification-error {
    border-left: 6px solid var(--accent-red);
}

.notification-warning {
    border-left: 6px solid var(--accent-amber);
}

.notification-info {
    border-left: 6px solid var(--accent-blue);
}

.notification-close {
    background: none;
    border: none;
    font-size: 1.8rem;
    cursor: pointer;
    color: var(--text-secondary);
    padding: 0;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
    transition: color 0.2s;
}

.notification-close:hover {
    color: white;
}

/* Accessibility Styles */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border-width: 0;
}

.skip-link {
    position: absolute;
    top: -40px;
    left: 0;
    background: var(--accent-blue);
    color: white;
    padding: 8px;
    z-index: 10000;
    transition: top 0.3s;
    text-decoration: none;
    font-weight: bold;
    border-radius: 0 0 5px 0;
}

.skip-link:focus {
    top: 0;
}

/* ============================================
   UTILITY CLASSES
   Reusable helpers to reduce inline styles
   ============================================ */

/* Spacing - Margins */
.mt-0 { margin-top: 0 !important; }
.mt-05 { margin-top: 0.5rem !important; }
.mt-075 { margin-top: 0.75rem !important; }
.mt-1 { margin-top: 1rem !important; }
.mt-1_5 { margin-top: 1.5rem !important; }
.mt-2 { margin-top: 2rem !important; }
.mb-0 { margin-bottom: 0 !important; }
.mb-05 { margin-bottom: 0.5rem !important; }
.mb-1 { margin-bottom: 1rem !important; }
.mb-1_5 { margin-bottom: 1.5rem !important; }
.mb-2 { margin-bottom: 2rem !important; }

/* Spacing - Padding */
.p-05 { padding: 0.5rem !important; }
.p-1 { padding: 1rem !important; }
.p-2 { padding: 2rem !important; }
.py-05 { padding-top: 0.5rem !important; padding-bottom: 0.5rem !important; }
.px-1 { padding-left: 1rem !important; padding-right: 1rem !important; }

/* Text */
.text-center { text-align: center !important; }
.text-left { text-align: left !important; }
.text-muted { color: var(--text-secondary) !important; }
.text-sm { font-size: 0.85rem !important; }
.text-xs { font-size: 0.75rem !important; }
.text-lg { font-size: 1.1rem !important; }
.fw-bold { font-weight: bold !important; }

/* Visibility */
.hidden { display: none !important; }
.invisible { visibility: hidden !important; }

/* Width helpers */
.w-auto { width: auto !important; }
.w-full { width: 100% !important; }

/* Grid column overrides */
.grid-cols-1-1-auto {
    grid-template-columns: 1fr 1fr auto !important;
}
.grid-cols-2-1 {
    grid-template-columns: 2fr 1fr !important;
}

/* Collapsible header button (ARIA-friendly) */
.collapsible-header button {
    all: unset;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    width: 100%;
    font: inherit;
    color: inherit;
}
.collapsible-header button:focus-visible {
    outline: 2px solid var(--accent-blue);
    outline-offset: 4px;
    border-radius: 4px;
}

/* File input hidden utility */
.input-hidden {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

/* Modal Styles */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 11000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    backdrop-filter: blur(8px);
}

.modal-overlay.show {
    opacity: 1;
    visibility: visible;
}

.modal-container {
    background: var(--card-bg);
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    width: 90%;
    max-width: 800px;
    max-height: 80vh;
    padding: 2rem;
    position: relative;
    transform: translateY(30px);
    transition: transform 0.3s ease;
    overflow-y: auto;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5);
}

.modal-overlay.show .modal-container {
    transform: translateY(0);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    padding-bottom: 1rem;
}

.modal-close {
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 2rem;
    cursor: pointer;
    line-height: 1;
}

.modal-close:hover {
    color: white;
}

.modal-body {
    line-height: 1.6;
}

.modal-title {
    margin: 0;
    font-size: 1.25rem;
    color: var(--accent-amber);
}

.notam-full-text {
    background: rgba(0, 0, 0, 0.3);
    padding: 1.5rem;
    border-radius: 8px;
    font-family: 'Courier New', Courier, monospace;
    white-space: pre-wrap;
    font-size: 0.95rem;
    border: 1px solid rgba(255, 255, 255, 0.05);
    color: #fff;
    margin-top: 1rem;
}

/* NOTAM Category Grid — 4-column square tiles */
.grid-notam-categories {
    display: grid !important;
    grid-template-columns: repeat(4, 1fr) !important;
    gap: 0.6rem !important;
    width: 100%;
}

@media (max-width: 860px) {
    .grid-notam-categories {
        grid-template-columns: repeat(3, 1fr) !important;
    }
}

@media (max-width: 560px) {
    .grid-notam-categories {
        grid-template-columns: repeat(2, 1fr) !important;
    }
}

/* NOTAM list — scrollable when list is long */
#notams-list {
    max-height: 420px;
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: rgba(245,158,11,0.4) transparent;
    padding-right: 0.25rem;
}

#notams-list::-webkit-scrollbar {
    width: 5px;
}

#notams-list::-webkit-scrollbar-track {
    background: transparent;
}

#notams-list::-webkit-scrollbar-thumb {
    background: rgba(245,158,11,0.4);
    border-radius: 3px;
}

/* Airline IATA badge — fallback when logo URL is unavailable */
.airline-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 20px;
    background: rgba(99,102,241,0.25);
    color: #a5b4fc;
    border-radius: 4px;
    font-size: 0.65rem;
    font-weight: 700;
    letter-spacing: 0.05em;
    margin-right: 2px;
    vertical-align: middle;
}

/* Connection status bar */
.connection-status-bar {
    padding: 0.5rem 0.75rem;
    border-radius: 6px;
    font-size: 0.8rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: rgba(0, 0, 0, 0.25);
    border: 1px solid rgba(255, 255, 255, 0.08);
}
.connection-status-bar.status-ok {
    border-color: rgba(34, 197, 94, 0.35);
    color: var(--accent-green);
}
.connection-status-bar.status-error {
    border-color: rgba(239, 68, 68, 0.35);
    color: var(--accent-red);
}
.connection-status-bar.status-warn {
    border-color: rgba(245, 158, 11, 0.35);
    color: var(--accent-amber);
}
.connection-status-bar .status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
    background: currentColor;
}
.connection-status-bar .status-dot.pulse-live {
    animation: pulse-dot 1.5s infinite;
}
@keyframes pulse-dot {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.3; }
}
