/**
 * Georgian Airport Flight Information App
 * Styling
 */

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

:root {
    --primary-color: #003d7a;
    --secondary-color: #ce1126;
    --accent-color: #ffffff;
    --text-dark: #333333;
    --text-light: #666666;
    --border-color: #e0e0e0;
    --success-color: #4caf50;
    --warning-color: #ff9800;
    --danger-color: #f44336;
}

html, body {
    width: 100%;
    height: 100%;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
    background: linear-gradient(135deg, #1B5FFC 0%, #AD3EE2 100%);
    color: var(--text-dark);
    overscroll-behavior-y: contain;
}

#app {
    width: 100%;
    height: 100%;
    overflow: hidden;
}

/* Screen Management */
.screen {
    display: none;
    width: 100%;
    height: 100%;
    position: absolute;
    top: 0;
    left: 0;
    overflow: auto;
    z-index: 1;
    pointer-events: none;
}

.screen.active {
    display: flex;
    flex-direction: column;
    z-index: 2;
    pointer-events: auto;
}

/* Splash Screen */
#splash-screen {
    background: linear-gradient(135deg, #1B5FFC 0%, #AD3EE2 100%);
    justify-content: center;
    align-items: center;
    
    z-index: 10;

}

.splash-content {
    text-align: center;
    color: white;
}

.logo-nonanimate {
    font-size: 80px;
    margin-bottom: 20px;
    text-align: center;
}

.logo-animate {
    font-size: 80px;
    margin-bottom: 20px;
    animation: bounce 1s infinite;
}

@keyframes bounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-20px); }
}

.splash-content h1 {
    font-size: 32px;
    font-weight: bold;
    margin-bottom: 10px;
}

.splash-content p {
    font-size: 16px;
    margin-bottom: 30px;
    opacity: 0.9;
}

.loader {
    display: flex;
    justify-content: center;
    gap: 10px;
}

.loader span {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    animation: loading 1.4s infinite;
}

.loader span:nth-child(2) {
    animation-delay: 0.2s;
}

.loader span:nth-child(3) {
    animation-delay: 0.4s;
}

@keyframes loading {
    0%, 100% { opacity: 0.3; }
    50% { opacity: 1; }
}

/* Language & Airport Selection */
#language-screen,
#airport-screen {
    justify-content: center;
    align-items: center;
    background: linear-gradient(135deg, #1B5FFC 0%, #AD3EE2 100%);
    padding: 20px;
    z-index: 10;
}

.container {
    width: 100%;
    max-width: 600px;
}

.container h1 {
    text-align: center;
    margin-bottom: 40px;
    color: var(--primary-color);
    font-size: 24px;
}

.language-buttons,
.airports-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

.airports-grid {
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
}

.lang-btn,
.airport-card {
    padding: 20px;
    border-radius: 50px;
    border: none;
    background: white;

    cursor: pointer;
    transition: all 0.3s ease;
    text-align: center;

}

.lang-btn:hover,
.airport-card:hover {
}
.splashheader {
    color: white !important;
}

.lang-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    padding: 30px 20px;
}

.flag {
    font-size: 48px;
}

.lang-btn span:last-child {
    font-size: 18px;
    font-weight: 600;
}

.airport-icon {
    font-size: 40px;
    margin-bottom: 10px;
}

.airport-code {
    font-size: 20px;
    font-weight: bold;
    color: var(--primary-color);
    margin-bottom: 5px;
}

.airport-name {
    color: #1C60FC;
    font-size: 18px;
    font-weight: 600;
}

.airport-city {
    font-size: 12px;
    color: var(--text-light);
    margin-top: 5px;
}

/* Flights Screen */
#flights-screen {
    display: none !important;  /* Hidden by default */
}

#flights-screen.active {
    display: flex !important;  /* Only visible when active */
    flex-direction: column;
    z-index: 10;
}

.header {
    color: white;
    padding: 15px 20px;
    position: sticky;
    top: 0;
    z-index: 3;
}

#flights-screen .header {
    display: flex;
    flex-direction: column;
}

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

.logo {
    font-size: 32px;
    font-weight: bold;
}

.menu-btn {
    background: none;
    border: none;
    color: white;
    font-size: 28px;
    cursor: pointer;
    padding: 5px;
}

.search-bar {
    position: relative;
    margin-bottom: 15px;
}

#search-input {
    width: 100%;
    padding: 18px 40px 18px 18px;
    border: 1px solid #DCDCDC;
    border-radius: 15px;
    font-size: 16px;
    background: rgba(255, 255, 255, 0.95);
}

#search-input::placeholder {
    color: #999;
}

.search-icon {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: #999;
}

#date-display {
    font-size: 13px;
    opacity: 0.9;
}

/* Menu */
.menu-overlay {
    display: none;
    position: fixed;
    background: linear-gradient(135deg, #1B5FFC 0%, #AD3EE2 100%);
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 50;
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
}

.menu-overlay.active {
    display: flex;
    opacity: 1;
    pointer-events: auto;
    z-index: 150;
}

/* Menu Container */
.menu {
    width: 100%;
    height: 100%;
    padding: 20px;
    position: relative;
    overflow-y: auto;
    animation: slideInRight 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.menu-overlay .menu {
    max-width: 100%;
}

.menu.closing {
    animation: slideOutRight 0.35s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

/* Slide In Animation - Right to Left */
@keyframes slideInRight {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* Slide Out Animation - Left to Right */
@keyframes slideOutRight {
    from {
        transform: translateX(0);
        opacity: 1;
    }
    to {
        transform: translateX(100%);
        opacity: 0;
    }
}

/* Menu Section */
.menu-section {
    margin: 30px 0 30px 0;
    padding-bottom: 20px;
}

.menu-section:last-child {
    border-bottom: none;
}

.menu-section h2 {
    color: white;
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 15px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Menu Tabs Container */
.menu-tabs {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

/* Menu Tab Button - FIXED: Click handling priority */
.menu-tab-btn {
    width: 100%;
    padding: 15px 20px;
    background: rgba(255, 255, 255, 0.1);
    border: 2px solid rgba(255, 255, 255, 0.2);
    border-radius: 8px;
    color: white;
    font-size: 15px;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.2s ease, border-color 0.2s ease, color 0.2s ease;
    text-align: left;
    user-select: none;
    -webkit-user-select: none;
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
    pointer-events: all;
    -webkit-appearance: none;
    appearance: none;
}

/* Hover only on devices that support hover (desktop) */
@media (hover: hover) {
    .menu-tab-btn:hover {
        background: rgba(255, 255, 255, 0.15);
        border-color: rgba(255, 255, 255, 0.4);
    }
}

/* Active state for click feedback (fires on tap) */
.menu-tab-btn:active {
    background: rgba(255, 255, 255, 0.2);
    border-color: white;
}

/* Selected state */
.menu-tab-btn.active {
    background: white;
    color: #003d7a;
    border-color: white;
    font-weight: 600;
}

/* Menu Close Button */
.menu-close-btn {
    position: absolute;
    top: 20px;
    right: 20px;
    width: 40px;
    height: 40px;
    background: rgba(255, 255, 255, 0.2);
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    color: white;
    font-size: 24px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    user-select: none;
    touch-action: manipulation;
}

.menu-close-btn:hover {
    background: rgba(255, 255, 255, 0.3);
    border-color: white;
    transform: rotate(90deg);
}

.menu-item {
    width: 100%;
    padding: 15px 20px;
    background: none;
    border: none;
    text-align: left;
    cursor: pointer;
    font-size: 16px;
    color: var(--text-dark);
    transition: background 0.2s;
}

.menu-item:hover {
    background: #f5f5f5;
}

.submenu {
    background: #f5f5f5;
}

.submenu-item {
    width: 100%;
    padding: 12px 20px 12px 40px;
    background: none;
    border: none;
    text-align: left;
    cursor: pointer;
    font-size: 14px;
    color: var(--text-dark);
    transition: background 0.2s;
}

.submenu-item:hover {
    background: #eeeeee;
}

/* Flights Main */
.flights-main {
    flex: 1;
    overflow-y: auto;
    padding: 15px 15px 80px 15px;
    background: white;
    border-radius: 20px 20px 0 0;
    z-index: 1;
    position: relative;
}

.flights-list {
    display: grid;
    grid-template-columns: 1fr;
    gap: 15px;
}

.no-flights,
.error-message {
    text-align: center;
    padding: 40px 20px;
    color: var(--text-light);
    font-size: 16px;
}

.error-message {
    color: var(--danger-color);
    background: #ffebee;
    border-radius: 8px;
    padding: 20px;
}

/* Loading Spinner */
.loading-spinner {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 20px;
}

.spinner {
    width: 50px;
    height: 50px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

.loading-spinner p {
    margin-top: 15px;
    color: var(--text-light);
    font-size: 14px;
}

/* Date Separator */
.date-separator {
    padding: 15px 20px;
    margin: 0 0 10px 0;
    background: #F1f1f1;
    color: black;
    font-weight: 600;
    font-size: 14px;
    border-radius: 8px;
    text-align: center;
}

/* Flight Cards */
.flight-card {
    padding: 15px;
    cursor: pointer;
    transition: all 0.3s ease;
    border-bottom: 1px solid #DCDCDC;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.flight-card:active {
    transform: scale(0.98);
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.2);
}

.flight-header {
    display: flex;
    flex-direction: column;
    gap: 4px;
    flex-grow: 1;
}

.flight-number {
    font-size: 16px;
    font-weight: 600;
    color: var(--primary-color);
}

.flight-airline {
    font-size: 12px;
    color: var(--text-light);
}

.flight-body {
    margin-bottom: 12px;
}

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

.airport-code {
    font-size: 16px;
    font-weight: bold;
    color: var(--text-dark);
    flex: 1;
}

.flight-arrow {
    margin: 0 10px;
    color: var(--secondary-color);
    font-weight: bold;
}

.flight-airport-codes {
    display: flex;
    justify-content: space-between;
    margin-top: 6px;
    font-size: 12px;
    color: var(--text-light);
}

.code-small {
    padding: 2px 8px;
    background: #f0f0f0;
    border-radius: 4px;
    font-weight: 500;
}

.flight-footer {
    display: flex;
    flex-direction: column;
    gap: 6px;
    align-items: center;
    width: 100px;
}

.flight-icon {
    width: 36px;
    height: 36px;
}

.flight-time {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-dark);
}

.flight-status {
    font-size: 12px;
    text-align: center;
}

.flight-status.scheduled {
    color: black;
}

.flight-status.active {
    color: #f57c00;
}

.flight-status.landed {
    color: black;
}

.flight-status.cancelled {;
    color: #c62828;
}

.flight-status.departed {
    color: black;
}

.flight-status.delayed {
    color: #d32f2f;
}

.flight-status.on_time {
    color: black;
}

.old-time {
    font-size: 11px;
    color: #d32f2f;
    text-decoration: line-through;
    font-weight: 500;
}

/* Footer */
.footer {
    display: flex;
    gap: 0;
    position: absolute;
    z-index: 5;
    bottom: 10px;
    margin: 0 10px;
    width: calc(100% - 20px);
    background-color: #1C60FC;
    border-radius: 50px;
    padding: 10px;
    pointer-events: auto;
}

.tab-btn {
    flex: 1;
    background-color: #1C60FC;
    padding: 15px;
    border: none;
    cursor: pointer;
    font-size: 16px;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.3);
    transition: all 0.3s ease;
    border-radius: 50px;
}

.tab-btn.active {
    color: #1C60FC;
    background-color: white;
    border-radius: 50px;
}

/* Details Screen */
#details-screen {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0);
    display: flex;
    justify-content: end;
    align-items: flex-end;
    pointer-events: none;

    opacity: 0;
    transition: opacity 0.3s ease, background 0.3s ease;
    z-index: 1000;
}

/* Active backdrop */
#details-screen.active {
    background: rgba(0, 0, 0, 0.5);
    opacity: 1;
    pointer-events: auto;
}

#details-screen .details-content {
    width: 100%;
    max-height: 90vh;
    background: #fff;
    border-radius: 16px 16px 0 0;

    transform: translateY(100%);
    transition: transform 0.35s ease;
}

/* Slide up */
#details-screen.active .details-content {
    transform: translateY(0);
}

.back-btn {
    background-color: #CCC;
    border: none;
    display: block;
    color: white;
    cursor: pointer;
    height: 5px;
    width: 50%;
    margin: 10px auto;
    border-radius: 10px;
}

.drag-handle {
    width: 40px;
    height: 4px;
    background: #ccc;
    border-radius: 2px;
    margin: 10px auto;
}

/* Disable transition while dragging */
.details-content.dragging {
    transition: none !important;
}

.details-card {
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.details-card hr {
    color: #DCDCDC;
    border: 1px solid #DCDCDC;
}

.detail-section {
    display: flex;
    flex-direction: row;
    margin-bottom: 20px;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--border-color);
    justify-content: space-between;
}

.detail-section:last-child {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

.detail-section h3 {
    color: var(--primary-color);
    font-size: 16px;
    margin-bottom: 12px;
    font-weight: 600;
}

.detail-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 0;
    border-bottom: 1px solid #fafafa;
    flex-direction: row;
    align-items: flex-start;
}

.detail-row .sublabel {
    font-weight: 500;           /* Lighter than labels (600) */
    color: var(--text-light);   /* Same color as labels */
    font-size: 12px;            /* Slightly smaller than labels (14px) */
    margin-top: 4px;            /* Space from the time above */
    text-align: right;          /* Align with the time */
}

.lilflightdata {
    display: flex;
    gap: 5px;
    flex-direction: column;
    flex-grow: 1;
}

.lilflightdata:last-child {
    border-bottom: none;
}

.lilflightdata .label {
    color: black;
    font-size: 12px;
     font-weight: 500;
}

.lilflightdata .value {
    font-size: 22px;
    color: #1C60FC;
    font-weight: 700;
}
.remainingtime {
    display: flex;
    flex-direction: column;
    width: 100%;
    align-items: center;
    text-align: center;

}

.remainingtime .label {
    color: black;
    font-size: 18px;
}

.remainingtime .value {
    font-size: 80px;
    color: #1C60FC;
    font-weight: 700;
}

.status-badge {
}


.status-badge.scheduled {
    color: #1C60FC;
}

.status-badge.active {
    color: #f57c00;
}

.status-badge.landed {
    color: #1C60FC;
}

.status-badge.cancelled {;
    color: #c62828;
}

.status-badge.departed {
    color: #1C60FC;
}

.status-badge.delayed {
    color: #d32f2f;
}

.flight-status.on_time {
    color: black;
}

.detail-section.alert {
    background: #fff3e0;
    border-left: 4px solid var(--warning-color);
    padding: 15px;
    border-radius: 8px;
    border-bottom: none;
}

/* Responsive */
@media (max-width: 600px) {
    .language-buttons {
        grid-template-columns: 1fr;
    }
    
    .airports-grid {
        grid-template-columns: 1fr;
    }
    
    .container h1 {
        font-size: 20px;
        margin-bottom: 30px;
    }
}

/* Scrollbar styling */
::-webkit-scrollbar {
    width: 6px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: #ccc;
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: #999;
}