/* Общий контейнер */
.airlabs-board {
    font-family: system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
    padding: 20px;
    background: #f7f7f7;
    border-radius: 16px;
    width: 100%;
    box-sizing: border-box;
}

/* Вкладки */
.tab-switcher {
    display: flex;
    width: 100%;
    margin-bottom: 16px;
    position: relative;
}

.tab-btn {
    flex: 1;
    text-align: center;
    padding: 14px 0;
    border: none;
    background: #dfe6f3;
    border-radius: 10px;
    font-weight: 600;
    font-size: 17px;
    cursor: pointer;
    position: relative;
    transition: background 0.25s ease, color 0.25s ease;
}

/* Отступ между кнопками */
.tab-btn + .tab-btn {
    margin-left: 10px;
}

/* Нижняя подсветка — как в iOS */
.tab-btn.active::after {
    content: "";
    position: absolute;
    left: 50%;
    bottom: -4px;
    transform: translateX(-50%);
    width: 60%;
    height: 3px;
    background: #3498db;
    border-radius: 3px;
    box-shadow: 0 0 6px rgba(52, 152, 219, 0.6);
    animation: iosUnderline 0.25s ease;
}

@keyframes iosUnderline {
    from {
        width: 0;
        opacity: 0;
    }
    to {
        width: 60%;
        opacity: 1;
    }
}

.tab-btn.active {
    background: #3498db;
    color: #fff;
}

/* Таблица */
.airlabs-table {
    display: flex;
    flex-direction: column;
    gap: 8px;
    transition: opacity 0.2s ease;
}

.airlabs-table.hidden {
    opacity: 0;
    visibility: hidden;
    height: 0;
    overflow: hidden;
    position: absolute;
    pointer-events: none;
}

.airlabs-table.visible {
    opacity: 1;
    visibility: visible;
    height: auto;
    position: static;
    pointer-events: auto;
}

/* Строка */
.airlabs-row {
    display: grid;
    grid-template-columns: 1.2fr 2fr 2.2fr 1fr 1fr 1fr;
    grid-template-areas:
        "flight airline route dep arr status";
    align-items: center;
    padding: 14px 18px;
    background: #ffffff;
    border-radius: 12px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
    font-size: 15px;
}

.airlabs-row.header {
    background: #e9eef7;
    font-weight: 600;
    box-shadow: none;
}

/* Колонки */
.col.flight { grid-area: flight; }
.col.airline { grid-area: airline; }
.col.route { grid-area: route; }
.col.dep { grid-area: dep; }
.col.arr { grid-area: arr; }
.col.status { grid-area: status; }

.col {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Авиакомпания */
.airline-box {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    width: 100%;
}

.airline-box img {
    height: 42px;
    width: auto;
    margin: 0 auto;
    object-fit: contain;
    border-radius: 4px;
    background: #fff;
}

/* Направление */
.col.route {
    font-size: 15px;
    font-weight: 500;
    opacity: 0.9;
    text-align: left;
    white-space: nowrap;
}

.route-text {
    display: flex;
    align-items: center;
    gap: 6px;
}

/* Статус */
.col.status {
    font-weight: 600;
    text-transform: capitalize;
}

/* Чипы статусов */
.status-chip {
    display: inline-flex;
    justify-content: flex-start;
    align-items: center;
    width: 130px;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 14px;
    font-weight: 600;
    color: #fff;
    box-sizing: border-box;
}

.chip-green { background: #2ecc71; }
.chip-blue { background: #3498db; }
.chip-yellow { background: #f1c40f; color: #000; }
.chip-red { background: #e74c3c; }

/* ============================= */
/* Адаптивность — планшеты */
/* ============================= */
@media (max-width: 900px) {
    .airlabs-row {
        grid-template-columns: 1fr 1fr 1fr;
        grid-template-areas:
            "flight airline status"
            "route route route"
            "dep dep arr";
        row-gap: 6px;
        padding: 12px 14px;
    }

    .col.flight { grid-area: flight; }
    .col.airline { grid-area: airline; }
    .col.status { grid-area: status; text-align: right; }
    .col.route { grid-area: route; text-align: left; }
    .col.dep { grid-area: dep; opacity: 0.8; text-align: left; }
    .col.arr { grid-area: arr; opacity: 0.8; text-align: right; }
}

/* ============================= */
/* Адаптивность — мобильные */
/* ============================= */
@media (max-width: 600px) {
    .airlabs-row {
        grid-template-columns: 1fr 1fr;
        grid-template-areas:
            "flight status"
            "airline airline"
            "route route"
            "dep arr";
        row-gap: 10px;
        font-size: 16px;
        padding: 16px 16px;
    }

    .col.flight { grid-area: flight; text-align: left; }
    .col.status { grid-area: status; text-align: right; }
    .col.airline { grid-area: airline; text-align: left !important; }
    .col.route { grid-area: route; font-size: 17px; text-align: left !important; }
    .col.dep { grid-area: dep; opacity: 0.9; text-align: left !important; }
    .col.arr { grid-area: arr; opacity: 0.9; text-align: left !important; }

    .airline-box {
        align-items: flex-start !important;
        text-align: left !important;
    }

    .airline-box img {
        height: 46px;
        margin-left: 0 !important;
        margin-right: auto !important;
        margin-bottom: 6px;
    }

    .status-chip {
        width: auto;
        max-width: 100%;
        font-size: 15px;
        padding: 6px 12px;
        white-space: nowrap;
        border-radius: 22px;
    }
}

/* ============================= */
/* Очень маленькие экраны */
/* ============================= */
@media (max-width: 420px) {
    .airlabs-row {
        grid-template-columns: 1fr;
        grid-template-areas:
            "flight"
            "airline"
            "route"
            "dep"
            "arr"
            "status";
        padding: 14px 16px;
        font-size: 17px;
        row-gap: 8px;
    }

    .col {
        white-space: normal;
        text-align: left !important;
    }

    .col.status {
        margin-top: 6px;
        font-size: 16px;
        text-align: left !important;
    }

    .airline-box {
        align-items: flex-start;
        text-align: left;
    }

    .airline-box img {
        height: 44px;
        margin-left: 0;
        margin-bottom: 6px;
    }

    .status-chip {
        width: auto;
        font-size: 16px;
        padding: 6px 14px;
        border-radius: 24px;
        display: inline-block;
    }

    .col.route {
        font-size: 18px;
        margin-top: 10px;
    }
}

.airline-box img {
    margin-left: 0;
    margin-right: auto;
}

.airlabs-load-more-wrapper {
    display: flex;
    justify-content: center;
    margin: 20px 0;
}

.airlabs-load-more {
    padding: 12px 28px;
    font-size: 16px;
    font-weight: 600;
    border-radius: 12px;
    border: none;
    cursor: pointer;
    background: linear-gradient(135deg, #4a90e2, #357ABD);
    color: #fff;
    box-shadow: 0 4px 12px rgba(0,0,0,0.12);
    transition: all 0.25s ease;
    letter-spacing: 0.3px;
}

.airlabs-load-more:hover {
    background: linear-gradient(135deg, #5aa0f2, #3f82c8);
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(0,0,0,0.18);
}

.airlabs-load-more:active {
    transform: translateY(0);
    box-shadow: 0 3px 8px rgba(0,0,0,0.15);
}

@media (max-width: 600px) {
    .airlabs-load-more {
        width: 100%;
        max-width: 320px;
        font-size: 17px;
        padding: 14px 0;
    }
}

.airlabs-row.new-row {
    opacity: 0;
    transform: translateY(8px);
    animation: rowFadeIn 0.35s ease forwards;
}

@keyframes rowFadeIn {
    from {
        opacity: 0;
        transform: translateY(8px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}