/**
 * HEAŞ Uçuş Ekranı - Stylesheet
 * Easily customizable via CSS classes
 */

/* ==========================================================================
   Container
   ========================================================================== */

.heas-ucus-container {
    width: 100%;
    max-width: 100%;
    margin: 0 auto;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
    font-size: 14px;
    line-height: 1.5;
    box-sizing: border-box;
}

.heas-ucus-container *,
.heas-ucus-container *::before,
.heas-ucus-container *::after {
    box-sizing: inherit;
}

/* ==========================================================================
   Last Update Timestamp
   ========================================================================== */

.heas-last-update {
    display: block;
    text-align: right;
    font-size: 11px;
    color: #888;
    padding: 4px 8px;
    margin-bottom: 4px;
}

/* ==========================================================================
   Tabs Navigation
   ========================================================================== */

.heas-ucus-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    margin-bottom: 0;
    padding: 0;
    background-color: #f1f1f1;
    border-radius: 4px 4px 0 0;
}

.heas-tab {
    flex: 1 1 auto;
    min-width: 150px;
    padding: 12px 20px;
    border: none;
    background-color: #e0e0e0;
    color: #333;
    font-size: 14px;
    font-weight: 500;
    text-align: center;
    cursor: pointer;
    transition: background-color 0.2s ease, color 0.2s ease;
    border-radius: 4px 4px 0 0;
}

.heas-tab:hover {
    background-color: #d0d0d0;
}

.heas-tab.active {
    background-color: #0073aa;
    color: #fff;
}

.heas-tab:focus {
    outline: 2px solid #0073aa;
    outline-offset: -2px;
}

/* ==========================================================================
   Tab Panels
   ========================================================================== */

.heas-ucus-panels {
    border: 1px solid #ddd;
    border-top: none;
    border-radius: 0 0 4px 4px;
    background-color: #fff;
}

.heas-panel {
    display: none;
    padding: 0;
}

.heas-panel.active {
    display: block;
}

/* ==========================================================================
   Flight Table
   ========================================================================== */

.heas-ucus-table {
    width: 100%;
    border-collapse: collapse;
    margin: 0;
}

.heas-ucus-table thead {
    background-color: #2c3e50;
    color: #fff;
}

.heas-ucus-table th {
    padding: 12px 10px;
    text-align: left;
    font-weight: 600;
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    white-space: nowrap;
}

.heas-ucus-table tbody tr {
    border-bottom: 1px solid #eee;
    transition: background-color 0.15s ease;
}

.heas-ucus-table tbody tr:nth-child(even) {
    background-color: #f9f9f9;
}

.heas-ucus-table tbody tr:hover {
    background-color: #f0f7fc;
}

.heas-ucus-table td {
    padding: 10px;
    text-align: left;
    vertical-align: middle;
    font-size: 13px;
}

/* Column-specific styles */
.heas-col-airline {
    font-weight: 500;
    max-width: 200px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.heas-col-flight {
    font-weight: 600;
    color: #0073aa;
}

.heas-col-city {
    font-weight: 500;
}

.heas-col-scheduled,
.heas-col-estimated {
    font-family: "Courier New", Courier, monospace;
    font-weight: 500;
}

.heas-col-remark {
    font-weight: 500;
}

/* Remark status colors - customize these as needed */
.remark-green {
    color: #27ae60;
}

.remark-red {
    color: #c0392b;
}

/* ==========================================================================
   Loading, Error, and No Data States
   ========================================================================== */

.heas-loading,
.heas-error,
.heas-no-data {
    text-align: center;
    padding: 40px 20px;
    font-size: 14px;
    color: #666;
}

.heas-loading::before {
    content: "";
    display: inline-block;
    width: 20px;
    height: 20px;
    margin-right: 10px;
    border: 2px solid #ddd;
    border-top-color: #0073aa;
    border-radius: 50%;
    animation: heas-spin 0.8s linear infinite;
    vertical-align: middle;
}

@keyframes heas-spin {
    to {
        transform: rotate(360deg);
    }
}

.heas-error {
    color: #c0392b;
    background-color: #fdf2f2;
}

.heas-no-data {
    color: #7f8c8d;
    font-style: italic;
}

/* ==========================================================================
   Responsive Design
   ========================================================================== */

@media screen and (max-width: 768px) {
    .heas-ucus-tabs {
        flex-direction: column;
    }

    .heas-tab {
        min-width: 100%;
        border-radius: 0;
    }

    .heas-tab:first-child {
        border-radius: 4px 4px 0 0;
    }

    .heas-ucus-table {
        display: block;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    .heas-ucus-table th,
    .heas-ucus-table td {
        padding: 8px 6px;
        font-size: 12px;
    }
}

@media screen and (max-width: 480px) {
    .heas-tab {
        padding: 10px 12px;
        font-size: 12px;
    }

    .heas-ucus-table th,
    .heas-ucus-table td {
        padding: 6px 4px;
        font-size: 11px;
    }
}

/* ==========================================================================
   NEW: Main Tabs Navigation (Arrivals/Departures)
   ========================================================================== */

.heas-header {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px 0;
    margin-bottom: 0;
}

.heas-main-tabs {
    display: inline-flex;
    gap: 8px;
    background-color: transparent;
}

.heas-main-tab {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 24px;
    border: 2px solid #e0e0e0;
    background-color: #fff;
    color: #666;
    font-size: 15px;
    font-weight: 500;
    cursor: pointer;
    border-radius: 30px;
    transition: all 0.3s ease;
}

.heas-main-tab:hover {
    border-color: #2c3e50;
    color: #2c3e50;
}

.heas-main-tab.active {
    border-color: #2c3e50;
    color: #2c3e50;
    background-color: #fff;
}

.heas-main-tab svg {
    width: 20px;
    height: 20px;
    fill: currentColor;
    transition: fill 0.3s ease;
}

.heas-main-tab:focus {
    outline: 2px solid #2c3e50;
    outline-offset: 2px;
}

/* ==========================================================================
   NEW: Subheader (Toggle + Last Update)
   ========================================================================== */

.heas-subheader {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 0;
    margin-bottom: 0;
    flex-wrap: wrap;
    gap: 12px;
}

/* ==========================================================================
   NEW: Toggle Switch (Domestic/International) - iOS Style
   ========================================================================== */

.heas-toggle-container {
    display: inline-flex;
    align-items: center;
    gap: 12px;
}

/* Hide the actual radio inputs */
.heas-toggle-container input[type="radio"] {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

/* Text labels outside the toggle */
.heas-toggle-label {
    font-size: 14px;
    font-weight: 600;
    color: #9ca3af;
    cursor: pointer;
    transition: color 0.3s ease;
    user-select: none;
}

.heas-toggle-label.active {
    color: #2c3e50;
}

/* The toggle track */
.heas-toggle-track {
    position: relative;
    width: 56px;
    height: 28px;
    background-color: #e5e7eb;
    border-radius: 14px;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

/* The sliding circle */
.heas-toggle-circle {
    position: absolute;
    top: 3px;
    left: 3px;
    width: 22px;
    height: 22px;
    background-color: #2c3e50;
    border-radius: 50%;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    pointer-events: none;
}

/* Active state for domestic (circle on left) */
.heas-toggle-container input#heas-domestic:checked~.heas-toggle-track .heas-toggle-circle {
    transform: translateX(0);
}

/* Active state for international (circle on right) */
.heas-toggle-container input#heas-international:checked~.heas-toggle-track .heas-toggle-circle {
    transform: translateX(28px);
}

/* Focus states for accessibility */
.heas-toggle-container input:focus-visible~.heas-toggle-track {
    outline: 2px solid #2c3e50;
    outline-offset: 2px;
}

/* ==========================================================================
   NEW: Updated Last Update for Subheader
   ========================================================================== */

.heas-subheader .heas-last-update {
    display: inline-block;
    margin-bottom: 0;
    padding: 0;
    font-size: 12px;
    color: #2c3e50;
    font-weight: 500;
}

/* ==========================================================================
   NEW: Responsive Design for New Components
   ========================================================================== */

@media screen and (max-width: 768px) {
    .heas-header {
        padding: 15px 0;
    }

    .heas-main-tab {
        padding: 10px 16px;
        font-size: 13px;
    }

    .heas-main-tab svg {
        width: 16px;
        height: 16px;
    }

    .heas-subheader {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }

    .heas-subheader .heas-last-update {
        align-self: flex-end;
    }
}

@media screen and (max-width: 480px) {
    .heas-main-tabs {
        flex-direction: column;
        width: 100%;
    }

    .heas-main-tab {
        width: 100%;
        justify-content: center;
        border-radius: 8px;
    }

    .heas-toggle-option {
        padding: 6px 12px;
        font-size: 12px;
    }
}

/* ==========================================================================
   Print Styles
   ========================================================================== */

@media print {
    .heas-ucus-tabs {
        display: none;
    }

    .heas-panel {
        display: block !important;
        page-break-inside: avoid;
        margin-bottom: 20px;
    }

    .heas-panel::before {
        content: attr(id);
        display: block;
        font-weight: bold;
        margin-bottom: 10px;
        text-transform: capitalize;
    }

    .heas-ucus-table {
        border: 1px solid #000;
    }

    .heas-ucus-table th,
    .heas-ucus-table td {
        border: 1px solid #ccc;
    }
}