* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html,
body {
    height: 100%;
    width: 100%;
}

body {
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    font-family: "Unbounded", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

h1 {
    text-align: center;
    color: #1f2937;
    padding: 2rem 1rem 1rem;
    font-size: 2.5rem;
    font-weight: 700;
    letter-spacing: -0.5px;
    flex-shrink: 0;
}

/* Top Bar Statistics */
.top_bar {
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    gap: 1rem;
    padding: 1.5rem;
    justify-content: space-between;
    flex-shrink: 0;
}

.topbar_card {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    flex: 1;
    min-width: 180px;
    background: white;
    padding: 1.5rem;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(6, 51, 70, 0.08);
    transition: all 0.3s ease;
    border-top: 3px solid #3b82f6;
}

.topbar_card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 16px rgba(6, 51, 70, 0.12);
}

.topbar_card h2 {
    font-size: 0.9rem;
    color: #6b7280;
    font-weight: 600;
    margin-bottom: 0.5rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.topbar_card p {
    font-size: 2rem;
    color: #1f2937;
    font-weight: 700;
}

/* Central Block */
.central_block {
    display: flex;
    flex-direction: row;
    gap: 1.5rem;
    padding: 1.5rem;
    background: white;
    margin: 0;
    border-radius: 12px;
    box-shadow: 0 8px 24px rgba(6, 51, 70, 0.12);
    flex: 1;
    overflow: hidden;
    margin: 1rem;
}

/* Left Panel */
.left_panel {
    flex-basis: 28%;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    overflow: hidden;
}

/* Search Panel */
.search_panel {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}
.rte_panel {
    display: flex;
    flex-direction: row;
    gap: 0.75rem;
}
.search-input {
    width: 100%;
    padding: 0.75rem;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    font-family: "Unbounded", sans-serif;
    font-size: 0.9rem;
    transition: all 0.2s ease;
}

.search-input:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
    background-color: #f0f9ff;
}

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

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

.filter-label {
    font-weight: 600;
    color: #6b7280;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    white-space: nowrap;
}

.status-filter {
    flex: 1;
    padding: 0.65rem;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    font-family: "Unbounded", sans-serif;
    font-size: 0.9rem;
    background-color: white;
    cursor: pointer;
    transition: all 0.2s ease;
    color: #1f2937;
}

.status-filter:hover {
    border-color: #3b82f6;
}

.status-filter:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.refresh-btn {
    padding: 0.65rem 0.75rem;
    border: 2px solid #3b82f6;
    border-radius: 8px;
    background-color: #3b82f6;
    color: white;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.2s ease;
    font-weight: 600;
}

.refresh-btn:hover {
    background-color: #2563eb;
    border-color: #2563eb;
    transform: scale(1.05);
}

.refresh-btn:active {
    transform: scale(0.95);
}
.rte-btn {
    padding: 0.65rem 0.75rem;
    border: 2px solid #3b82f6;
    border-radius: 8px;
    background-color: #3b82f6;
    color: white;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.2s ease;
    font-weight: 600;
}

.rte-btn:hover {
    background-color: #2563eb;
    border-color: #2563eb;
    transform: scale(1.05);
    border-radius: 8px;
}

.rte-btn:active {
    transform: scale(0.95);
}
.refresh-btn.loading {
    animation: spin 1s linear infinite;
}

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

    to {
        transform: rotate(360deg);
    }
}

/* Airports List Panel */
.airports_list {
    flex: 1;
    overflow-y: auto;
    border-right: 1px solid #e5e7eb;
    padding-right: 1rem;
    list-style: none;
}

.airports_list::-webkit-scrollbar-track {
    background: #f3f4f6;
    border-radius: 10px;
}

.airports_list::-webkit-scrollbar-thumb {
    background: #d1d5db;
    border-radius: 10px;
}

.airports_list::-webkit-scrollbar-thumb:hover {
    background: #9ca3af;
}

.airport-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    margin-bottom: 0.75rem;
    background: #f9fafb;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    border-left: 3px solid #d1d5db;
}

.airport-item:hover {
    background: #f3f4f6;
    transform: translateX(4px);
}

.airport-item.status-open {
    border-left-color: #22c55e;
}

.airport-item.status-closed {
    border-left-color: #ef4444;
}

.airport-item.status-restricted {
    border-left-color: #eab308;
}

/* Blinking Dot */
.blink-dot {
    display: inline-block;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    flex-shrink: 0;
    animation: pulse 1.5s infinite;
    box-shadow: 0 0 8px currentColor;
}

.blink-dot.status-open {
    background-color: #22c55e;
    color: #22c55e;
}

.blink-dot.status-closed {
    background-color: #ef4444;
    color: #ef4444;
}

.blink-dot.status-restricted {
    background-color: #eab308;
    color: #eab308;
}

@keyframes pulse {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0.3;
    }
}

.airport-info {
    flex: 1;
    min-width: 0;
}

.airport-info strong {
    display: block;
    color: #1f2937;
    font-weight: 600;
    font-size: 0.95rem;
    margin-bottom: 0.25rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.airport-info small {
    color: #9ca3af;
    font-size: 0.75rem;
    font-weight: 500;
}

/* Empty state message */
.empty-message {
    padding: 2rem 1rem;
    text-align: center;
    color: #9ca3af;
    font-size: 0.95rem;
    font-weight: 500;
}

/* Map Container */
.map_module {
    flex: 1;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.1);
}

.map_module .leaflet-container {
    width: 100%;
    height: 100%;
    border-radius: 8px;
}

/* Airport Popup */
.airport-popup {
    font-family: "Unbounded", sans-serif;
    padding: 8px;
}

.airport-popup strong {
    display: block;
    color: #1f2937;
    margin-bottom: 6px;
    font-weight: 600;
}

.airport-popup br {
    margin: 4px 0;
}

.status-badge {
    display: inline-block;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 0.85rem;
    font-weight: 600;
    white-space: nowrap;
}

.status-badge.status-open {
    background: #dcfce7;
    color: #166534;
}

.status-badge.status-closed {
    background: #fee2e2;
    color: #991b1b;
}

.status-badge.status-restricted {
    background: #fef3c7;
    color: #92400e;
}

/* Panel Tabs */
.panel_tabs {
    display: flex;
    border-bottom: 2px solid #e5e7eb;
    margin-bottom: 1rem;
    flex-shrink: 0;
}

.panel-tab {
    flex: 1;
    padding: 0.75rem;
    background: none;
    border: none;
    font-family: "Unbounded", sans-serif;
    font-size: 0.85rem;
    font-weight: 600;
    color: #6b7280;
    cursor: pointer;
    transition: all 0.2s ease;
    border-bottom: 3px solid transparent;
}

.panel-tab:hover {
    color: #3b82f6;
    background-color: #f8fafc;
}

.panel-tab.active {
    color: #3b82f6;
    border-bottom-color: #3b82f6;
}

/* Tab Content Visibility */
.tab_content {
    display: none;
    flex-direction: column;
    gap: 1rem;
    overflow: hidden;
    flex: 1;
}

.tab_content.active {
    display: flex;
}

/* Topbar Card styling adjustments */
.card-ko-total {
    border-top-color: #3b82f6 !important;
}

.card-ko-active {
    border-top-color: #f97316 !important;
    /* Orange border for active restriction */
}

.card-ko-upcoming {
    border-top-color: #9ca3af !important;
    /* Grey border for upcoming restriction */
}

/* KO list custom items */
.ko_list {
    flex: 1;
    overflow-y: auto;
    border-right: none;
    padding-right: 0.5rem;
    list-style: none;
    max-height: 600px;
}

.ko_list::-webkit-scrollbar-track {
    background: #f3f4f6;
    border-radius: 10px;
}

.ko_list::-webkit-scrollbar-thumb {
    background: #d1d5db;
    border-radius: 10px;
}

.ko-item {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
    padding: 0.85rem;
    margin-bottom: 0.75rem;
    background: #f9fafb;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    border-left: 4px solid #d1d5db;
}

.ko-item:hover {
    background: #f3f4f6;
    transform: translateX(4px);
}

.ko-item.cat-full_closure {
    border-left-color: #f97316;
    /* Orange for closures */
}

.ko-item.cat-partial_closure {
    border-left-color: #fb923c;
    /* Lighter orange for partial closures */
}

.ko-item.cat-route {
    border-left-color: #3b82f6;
    /* Blue for routes */
}

.ko-item.status-upcoming {
    border-left-color: #9ca3af !important;
    /* Grey for upcoming */
}

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

.ko-title {
    font-weight: 700;
    color: #1f2937;
    font-size: 0.85rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    flex: 1;
    margin-right: 0.5rem;
}

.ko-badges {
    display: flex;
    gap: 0.25rem;
    align-items: center;
    flex-shrink: 0;
}

.ko-badge {
    font-size: 0.7rem;
    padding: 2px 6px;
    border-radius: 4px;
    font-weight: 600;
    text-transform: uppercase;
}

.ko-badge.badge-active {
    background-color: #ffedd5;
    color: #ea580c;
}

.ko-badge.badge-upcoming {
    background-color: #f3f4f6;
    color: #4b5563;
}

.ko-badge.badge-route {
    background-color: #dbeafe;
    color: #1e40af;
}

.ko-time-range {
    font-size: 0.75rem;
    color: #6b7280;
    font-weight: 500;
}

.ko-desc-snippet {
    font-size: 0.75rem;
    color: #4b5563;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    line-height: 1.25;
}

/* KO Popup styling */
.ko-popup {
    font-family: "Unbounded", sans-serif;
    padding: 4px;
    max-width: 300px;
}

.ko-popup h3 {
    margin-top: 0;
    margin-bottom: 8px;
    font-size: 0.9rem;
    color: #1f2937;
    border-bottom: 1px solid #e5e7eb;
    padding-bottom: 4px;
    font-weight: 700;
}

.ko-popup-row {
    font-size: 0.75rem;
    margin-bottom: 5px;
    color: #4b5563;
}

.ko-popup-desc {
    font-size: 0.75rem;
    background-color: #f9fafb;
    padding: 6px;
    border-radius: 4px;
    border: 1px solid #e5e7eb;
    max-height: 100px;
    overflow-y: auto;
    white-space: pre-wrap;
    margin-top: 8px;
    color: #1f2937;
    line-height: 1.3;
}

/* Responsive Design */
@media (max-width: 1024px) {
    .central_block {
        flex-direction: column;
    }

    .left_panel {
        flex-basis: auto;
        max-height: 300px;
        flex-shrink: 0;
    }

    .airports_list {
        flex: 1;
        border-right: none;
        border-bottom: 1px solid #e5e7eb;
        padding-right: 0;
        padding-bottom: 1rem;
    }

    .map_module {
        flex: 1;
        min-height: 300px;
    }
}

@media (max-width: 768px) {
    h1 {
        font-size: 1.8rem;
    }

    .top_bar {
        flex-direction: column;
    }

    .topbar_card {
        min-width: auto;
    }
}

/* Контейнер для вращающейся плашки трассы */
.airway-label-container {
    display: flex;
    justify-content: center;
    align-items: center;
    width: auto !important;
    height: auto !important;
}

/* Сама плашка (прямоугольник с названием трассы) */
.airway-label {
    background-color: #ffffff;
    border: 2px solid #3b82f6;
    color: #1e3a8a;
    font-weight: 800;
    font-size: 10px;
    padding: 2px 6px;
    border-radius: 4px;
    white-space: nowrap;
    box-shadow: 0 2px 6px rgba(0,0,0,0.15);
    pointer-events: none; /* Пропускает клики сквозь себя на линию */
    user-select: none;
    text-transform: uppercase;
}

/* Стиль для плашки DCT (красный пунктирный стиль) */
.airway-label.dct-label {
    border-color: #ef4444;
    color: #ef4444;
}

/* Карточка сегмента в боковой панели */
.route-leg-card {
    background: #ffffff;
    border-left: 4px solid #3b82f6;
    padding: 12px;
    margin-bottom: 8px;
    border-radius: 0 6px 6px 0;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
}

.route-leg-card:hover {
    transform: translateX(4px);
    box-shadow: 0 3px 8px rgba(0,0,0,0.1);
}

.route-leg-card.leg-dct {
    border-left-color: #ef4444;
}

.leg-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 6px;
}

.leg-title {
    font-size: 14px;
    font-weight: 700;
    color: #1e293b;
}

.leg-badge {
    font-size: 10px;
    font-weight: 700;
    padding: 2px 6px;
    border-radius: 4px;
    text-transform: uppercase;
}

.badge-airway {
    background-color: #dbeafe;
    color: #1e40af;
}

.badge-dct {
    background-color: #fee2e2;
    color: #991b1b;
}

.leg-points {
    font-size: 12px;
    color: #64748b;
    display: flex;
    align-items: center;
    gap: 6px;
}