* {
    box-sizing: border-box;
}

body {
    margin: 0;
    padding: 0;
    overflow: hidden;
    font-family: 'Inter', sans-serif;
    background-color: #000;
    width: 100vw;
    height: 100vh;
}

#globeViz {
    width: 100vw;
    height: 100vh;
}

#ui-layer {
    position: absolute;
    top: 20px;
    left: 20px;
    color: white;
    pointer-events: none;
    background: rgba(0, 0, 0, 0.6);
    padding: 20px;
    border-radius: 12px;
    backdrop-filter: blur(5px);
    max-width: 300px;
    z-index: 1000;
    box-sizing: border-box;
    transition: transform 0.3s ease;
    transform: translateX(0);
}

#ui-layer.nav-toggle {
    transform: translateX(-100%);
}

#ui-layer h1 {
    margin: 0 0 10px 0;
    font-size: 1.5rem;
    font-weight: 600;
}

#ui-layer p {
    margin: 0;
    font-size: 0.9rem;
    color: #8ddcff;
}

#loading {
    margin-top: 10px;
    font-style: italic;
    color: #ffd700;
}

/* Controls Container */
#controls {
    margin: 15px 0 0 0;
    display: flex;
    flex-direction: column;
    gap: 12px;
    pointer-events: auto;
    width: 100%;
}

#search-wrapper,
#route-search-wrapper {
    position: relative;
}

/* Dropdown & Button & Search */
#category-filter,
#reset-btn,
#help-btn,
#search-input,
#route-search-input {
    background: rgba(0, 0, 0, 0.6);
    color: #fff;
    border: 1px solid rgba(255, 255, 255, 0.3);
    padding: 6px 12px;
    border-radius: 4px;
    font-family: inherit;
    font-size: 14px;
    backdrop-filter: blur(4px);
    transition: background 0.2s, border-color 0.2s;
    width: 100%;
    box-sizing: border-box;
}

#search-input,
#route-search-input {
    cursor: text;
}

#category-filter {
    cursor: pointer;
}

#reset-btn,
#help-btn {
    cursor: pointer;
}

/* Button Container */
#button-container {
    display: flex;
    gap: 8px;
    width: 100%;
}

#reset-btn {
    flex: 0 0 calc(75% - 4px);
}

#help-btn {
    flex: 0 0 calc(25% - 4px);
    font-size: 18px;
    font-weight: bold;
}

#category-filter:hover,
#reset-btn:hover,
#help-btn:hover,
#search-input:hover,
#route-search-input:hover {
    background: rgba(0, 0, 0, 0.8);
    border-color: rgba(255, 255, 255, 0.6);
}

#category-filter:focus,
#reset-btn:focus,
#help-btn:focus,
#search-input:focus,
#route-search-input:focus {
    outline: none;
    border-color: #8ddcff;
}

#reset-btn:active,
#help-btn:active {
    background: rgba(255, 255, 255, 0.1);
}

/* Search Suggestions */
#search-suggestions,
#route-search-suggestions {
    position: absolute;
    top: 100%;
    left: 0;
    width: 100%;
    background: rgba(0, 0, 0, 0.9);
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-top: none;
    border-radius: 0 0 4px 4px;
    max-height: 200px;
    overflow-y: auto;
    z-index: 1000;
    display: none;
}

.suggestion-item {
    padding: 8px 12px;
    cursor: pointer;
    font-size: 13px;
    color: #fff;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.suggestion-item:last-child {
    border-bottom: none;
}

.suggestion-item:hover {
    background: rgba(255, 255, 255, 0.2);
}

.suggestion-item .iata {
    font-weight: bold;
    color: #8ddcff;
    margin-right: 6px;
}

/* Route Info Panel */
#route-info-panel {
    position: absolute;
    top: 20px;
    right: 20px;
    background: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 20px;
    border-radius: 12px;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    width: 250px;
    z-index: 1000;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
    transition: opacity 0.3s ease, transform 0.3s ease;
}

#route-header {
    display: flex;
    justify-content: center;
    align-items: flex-start;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
    gap: 15px;
}

.route-airport {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100px;
}

.route-iata {
    font-size: 2rem;
    font-weight: 700;
    color: #8ddcff;
    line-height: 1;
    margin-bottom: 6px;
}

.route-desc {
    font-size: 0.7rem;
    color: #aaa;
    text-align: center;
    line-height: 1.2;
    white-space: normal;
    max-width: 100%;
}

.route-separator {
    font-size: 2rem;
    font-weight: 700;
    color: #8ddcff;
    line-height: 1;
    margin-top: 0;
}

.route-stat {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
    font-size: 1rem;
}

.route-stat .label {
    color: #ccc;
    font-size: 0.9rem;
}

.route-stat .value {
    font-weight: 700;
    color: #fff;
    font-size: 1.1rem;
}

/* UI Toggle Button */
#ui-toggle-btn {
    position: absolute;
    top: 20px;
    right: -20px;
    width: 20px;
    height: 32px;
    background: rgba(4, 28, 44, 0.6);
    color: #fff;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-left: none;
    border-radius: 4px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(5px);
    transition: background 0.2s;
    z-index: 1001;
    pointer-events: auto;
}

#ui-toggle-btn:hover {
    background: rgba(255, 255, 255, 0.5);
}

/* FAQ Modal */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(10px);
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.modal-content {
    background: rgba(20, 20, 30, 0.95);
    border-radius: 16px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    max-width: 800px;
    width: 100%;
    max-height: 90vh;
    overflow: auto;
    padding: 40px;
    position: relative;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.8);
}

.modal-content h2 {
    margin: 0 0 30px 0;
    color: #fff;
    font-size: 1.8rem;
    text-align: center;
}

.modal-close {
    position: absolute;
    top: 15px;
    right: 15px;
    background: transparent;
    border: none;
    color: #fff;
    font-size: 32px;
    cursor: pointer;
    line-height: 1;
    padding: 5px 10px;
    transition: color 0.2s;
}

.modal-close:hover {
    color: #8ddcff;
}

/* Carousel */
.carousel {
    position: relative;
    display: flex;
    align-items: center;
    gap: 20px;
}

.carousel-slides {
    flex: 1;
    overflow: hidden;
    border-radius: 8px;
}

.carousel-slide {
    display: none;
    flex-direction: column;
    align-items: center;
    gap: 20px;
}

.carousel-slide.active {
    display: flex;
}

.carousel-slide img {
    max-width: 50%;
    height: auto;
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.carousel-slide p {
    color: #ccc;
    font-size: 1.1rem;
    text-align: center;
    margin: 0;
}

.carousel-btn {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: #fff;
    font-size: 24px;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.carousel-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    border-color: #8ddcff;
}

.carousel-btn:active {
    background: rgba(255, 255, 255, 0.3);
}

/* Mobile Responsiveness */
@media (max-width: 768px) {
    #ui-layer {
        top: 0;
        left: 0;
        bottom: auto;
        width: 100%;
        max-width: none;
        height: auto;
        max-height: 50vh;
        border-radius: 0 0 12px 12px;
        transform: translateY(0);
        transition: transform 0.3s ease;
    }

    #ui-layer.nav-toggle {
        transform: translateY(-100%);
    }

    #ui-toggle-btn {
        top: auto;
        right: auto;
        bottom: -30px;
        left: 50%;
        transform: translateX(-50%);
        width: 60px;
        height: 30px;
        border-radius: 0 0 8px 8px;
        line-height: 30px;
        padding: 0;
        display: flex;
        align-items: center;
        justify-content: center;
    }

    #controls {
        display: flex;
        flex-direction: column;
        gap: 8px;
    }

    h1 {
        font-size: 1.2rem;
        margin-bottom: 4px;
    }

    p {
        font-size: 0.8rem;
        margin-bottom: 10px;
    }

    #route-info-panel {
        top: auto;
        bottom: 20px;
        left: 20px;
        right: 20px;
        width: auto;
    }

    .modal-content {
        padding: 30px 20px;
    }

    .modal-content h2 {
        font-size: 1.4rem;
        margin-bottom: 20px;
    }

    .carousel {
        flex-direction: column;
    }

    .carousel-btn {
        width: 40px;
        height: 40px;
        font-size: 20px;
    }

    .carousel-prev,
    .carousel-next {
        position: static;
    }
}