/* =========================================================
   Aero · /embed/vuelos — vista embebible en sitios externos
   ---------------------------------------------------------
   Replica del look del panel de Llegadas/Salidas actual del
   sitio web del aeropuerto. Responsive:
     - >= 900px: tabla completa
     - 600-900px: tabla compacta (esconde Aerolinea + Embarque)
     - < 600px: cards verticales apiladas
   ========================================================= */

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

html, body.embed-page {
    background: #ffffff;
    color: #1c1c1c;
    font-family: 'Inter', 'Helvetica Neue', Arial, sans-serif;
    font-weight: 500;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    letter-spacing: -0.01em;
}

.embed-container {
    width: 100%;
    max-width: 1280px;
    margin: 0 auto;
    background: #ffffff;
    overflow: hidden;
    border-radius: 0;   /* puro para iframe; el WP redondea afuera si quiere */
}

/* =========================================================
   HEADER con tabs + meta (ciudad / fecha / hora)
   ========================================================= */
.embed-header {
    display: flex;
    justify-content: space-between;
    align-items: stretch;
    padding: 0 24px;
    color: #ffffff;
    min-height: 64px;
    gap: 16px;
    flex-wrap: wrap;
}

.embed-tabs {
    display: flex;
    gap: 8px;
    align-items: stretch;
}
.embed-tab {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 18px 4px;
    background: transparent;
    border: none;
    color: rgba(255, 255, 255, 0.65);
    font-size: 18px;
    font-weight: 700;
    letter-spacing: 0.02em;
    cursor: pointer;
    position: relative;
    font-family: inherit;
    transition: color 0.2s ease;
    margin-right: 16px;
}
.embed-tab .tab-icon {
    width: 24px;
    height: 24px;
    color: currentColor;
}
/* Cuando .tab-icon es un Font Awesome <i> en vez de SVG */
.embed-tab i.tab-icon {
    width: auto;
    height: auto;
    font-size: 20px;
    line-height: 1;
}
.embed-tab:hover {
    color: rgba(255, 255, 255, 0.9);
}
.embed-tab.active {
    color: #ffffff;
}
.embed-tab.active::after {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    height: 3px;
    background: var(--accent, #06b6d4);
    border-radius: 2px 2px 0 0;
}

.embed-meta {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: rgba(255, 255, 255, 0.92);
    font-size: 14px;
    font-weight: 500;
    letter-spacing: 0.01em;
    white-space: nowrap;
}
.meta-airport,
.meta-date {
    color: rgba(255, 255, 255, 0.92);
}
.meta-time {
    font-family: 'JetBrains Mono', monospace;
    font-weight: 700;
    font-size: 16px;
    letter-spacing: 0.04em;
}
.meta-suffix {
    font-weight: 600;
    font-size: 13px;
    margin-left: 2px;
}

/* =========================================================
   PANELES (uno por tab) + TABLA
   ========================================================= */
.embed-panel {
    display: none;
    background: #ffffff;
}
.embed-panel.active {
    display: block;
}

.flights-table {
    width: 100%;
    border-collapse: collapse;
    table-layout: fixed;
    font-size: 16px;
}
.flights-table thead th {
    color: #0d2b5c;
    font-weight: 700;
    font-size: 13px;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    padding: 18px 16px;
    text-align: center;
    background: #ffffff;
    border-bottom: 1px solid #e2e6ec;
}
.flights-table tbody td {
    padding: 16px;
    font-size: 16px;
    color: #1c1c1c;
    border-bottom: 1px solid #f0f2f5;
    vertical-align: middle;
    text-align: center;
}
.flights-table tbody tr:nth-child(even) {
    background: #fafbfc;
}
.flights-table tbody tr:hover {
    background: #f5f7fa;
}

.flights-table .col-time   { width: 12%; }
.flights-table .col-place  { width: 22%; }
.flights-table .col-flight { width: 12%; }
.flights-table .col-airline{ width: 16%; }
.flights-table .col-belt   { width: 10%; }
.flights-table .col-gate   { width: 10%; }
.flights-table .col-status { width: 18%; }

.flights-table .cell-time,
.flights-table .cell-flight {
    font-family: 'JetBrains Mono', monospace;
    font-weight: 700;
    font-size: 18px;
    letter-spacing: 0.02em;
}
.flights-table .cell-place {
    font-weight: 600;
    font-size: 17px;
}
.flights-table .cell-airline {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}
.flights-table .cell-airline img {
    max-height: 26px;
    max-width: 120px;
    object-fit: contain;
}
.flights-table .cell-airline .airline-name {
    font-weight: 600;
    color: #1c1c1c;
}

/* Pills de estado: fondo soft + texto oscuro */
.status-pill {
    display: inline-flex;
    align-items: center;
    padding: 6px 14px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 800;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    white-space: nowrap;
}
.status-pill[data-status="arribado"],
.status-pill[data-status="llegado"]   { background: #d4f5dd; color: #138a4c; }
.status-pill[data-status="programado"]{ background: #fff5d5; color: #8a6400; }
.status-pill[data-status="check-in"],
.status-pill[data-status="embarcando"]{ background: #d5ecff; color: #0b4480; }
.status-pill[data-status="embarcado"] { background: #cdeed6; color: #116131; }
.status-pill[data-status="despegado"] { background: #d5f3db; color: #138a4c; }
.status-pill[data-status="retrasado"],
.status-pill[data-status="demorado"],
.status-pill[data-status="reprogramado"]{ background: #ffe4cc; color: #b85a00; }
.status-pill[data-status="cancelado"] { background: #ffd7d7; color: #a81f1f; }
.status-pill[data-status="ultimo-llamado"] {
    background: #ff2a2a;
    color: #ffffff;
    animation: status-pulse 1.4s ease-in-out infinite;
}
@keyframes status-pulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(255, 42, 42, 0.4); }
    50%      { box-shadow: 0 0 0 6px rgba(255, 42, 42, 0); }
}

.empty-row td {
    text-align: center;
    color: #6a8dc0;
    padding: 36px 16px;
    font-style: italic;
    background: #fafbfc;
}

/* =========================================================
   Mobile: cards en vez de tabla
   ========================================================= */
.flights-cards {
    display: none;
    padding: 12px;
    gap: 10px;
    flex-direction: column;
}
.flight-card {
    background: #ffffff;
    border: 1px solid #e2e6ec;
    border-radius: 10px;
    padding: 14px 14px;
    display: grid;
    grid-template-columns: auto 1fr auto;
    grid-template-rows: auto auto;
    grid-template-areas:
        "time place status"
        "airline meta meta";
    gap: 6px 14px;
    align-items: center;
}
.flight-card .card-time {
    grid-area: time;
    font-family: 'JetBrains Mono', monospace;
    font-weight: 700;
    font-size: 22px;
    color: #0d2b5c;
}
.flight-card .card-place {
    grid-area: place;
    font-weight: 700;
    font-size: 16px;
    color: #1c1c1c;
}
.flight-card .card-status {
    grid-area: status;
}
.flight-card .card-airline {
    grid-area: airline;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: #5e7da5;
    font-weight: 600;
}
.flight-card .card-airline img {
    max-height: 18px;
    max-width: 80px;
    object-fit: contain;
}
.flight-card .card-meta {
    grid-area: meta;
    text-align: right;
    font-size: 13px;
    color: #5e7da5;
    font-weight: 600;
}
.flight-card .card-meta strong {
    color: #1c1c1c;
    font-weight: 700;
}

/* =========================================================
   Breakpoints
   ========================================================= */

/* Tablet: escondemos Aerolinea y Embarque para ahorrar columnas */
@media (max-width: 900px) {
    .embed-header {
        padding: 0 16px;
    }
    .embed-tab {
        font-size: 16px;
        padding: 14px 4px;
        margin-right: 12px;
    }
    .embed-tab .tab-icon {
        width: 20px; height: 20px;
    }
    .embed-tab i.tab-icon {
        font-size: 17px;
    }
    .flights-table thead th,
    .flights-table tbody td {
        padding: 12px 10px;
        font-size: 14px;
    }
    .flights-table .cell-time,
    .flights-table .cell-flight {
        font-size: 16px;
    }
    .flights-arrivals .col-airline {
        display: none;
    }
    .flights-departures .col-airline,
    .flights-departures th.col-time:nth-of-type(5),
    .flights-departures td.col-time:nth-of-type(5) {
        /* Esconder columna Embarque en la tabla de salidas — 5ta col (time) */
    }
    /* Mas simple: escondemos columnas via clase agregada por JS si hace falta.
       Por ahora dejamos visible Embarque en tablet, solo se oculta en mobile. */
}

/* Mobile: cards en vez de tabla */
@media (max-width: 600px) {
    .embed-header {
        flex-direction: column;
        align-items: flex-start;
        padding: 0;
        gap: 0;
    }
    .embed-tabs {
        width: 100%;
        padding: 0 14px;
    }
    .embed-tab {
        padding: 14px 2px;
        margin-right: 16px;
    }
    .embed-meta {
        width: 100%;
        justify-content: flex-end;
        padding: 0 14px 10px;
        font-size: 12px;
    }
    .meta-time { font-size: 14px; }

    /* Esconder tabla, mostrar cards */
    .flights-table { display: none; }
    .flights-cards { display: flex; }
}
