/* ============================================================
   Ad Loading Overlay — animated "airport billboard" loading
   state shown during service searches & booking-flow steps.
   Ads are managed in OMS: Content Management > Website > Loading Ads
   and fetched by js/ad-loader.js from /api/loading-ads.
   The overlay sits ABOVE the classic branded loaders
   (#loader / #searchLoader, z-index <= 99999) and only appears
   when at least one active ad exists.
   ============================================================ */

.adl-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100%;
    height: 100%;
    z-index: 999999;
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    display: none;
    overflow: hidden;
}

.adl-overlay.is-active {
    display: flex;
    align-items: center;
    justify-content: center;
}

.adl-inner {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 100%;
    max-height: 100%;
    padding: 12px 16px;
    box-sizing: border-box;
    overflow: hidden;
}

.adl-card {
    position: relative;
    width: 100%;
    max-width: 760px;
    background: #fff;
    border-radius: 18px;
    box-shadow: 0 24px 64px rgba(20, 30, 45, 0.18), 0 4px 14px rgba(20, 30, 45, 0.08);
    padding: 20px 24px 0;
    box-sizing: border-box;
    overflow: hidden;
    animation: adl-card-in .45s cubic-bezier(.22,.9,.35,1.1) both;
}

@keyframes adl-card-in {
    from { opacity: 0; transform: translateY(18px) scale(.97); }
    to   { opacity: 1; transform: translateY(0) scale(1); }
}

/* ── Header ─────────────────────────────────────────────── */
.adl-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 12px;
}

.adl-head-text { min-width: 0; }

.adl-title {
    margin: 0 0 3px;
    font-size: 17px;
    font-weight: 700;
    color: #1d2733;
    letter-spacing: .01em;
}

.adl-subtitle {
    margin: 0;
    font-size: 13px;
    color: #6b7686;
}

.adl-close {
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    border: 1px solid #d9dde3;
    background: #fff;
    color: #4a5568;
    font-size: 12.5px;
    font-weight: 600;
    border-radius: 999px;
    padding: 6px 12px;
    cursor: pointer;
    transition: background .15s ease, color .15s ease;
}

.adl-close:hover { background: #f2f4f7; color: #1d2733; }

/* Little plane that glides across the top of the card */
.adl-plane {
    position: absolute;
    top: 10px;
    left: -60px;
    width: 34px;
    height: 34px;
    color: #039CE0;
    opacity: .85;
    animation: adl-fly 7s linear infinite;
    pointer-events: none;
}

@keyframes adl-fly {
    0%   { transform: translateX(0) translateY(0) rotate(8deg); }
    50%  { transform: translateX(calc(50vw)) translateY(-6px) rotate(4deg); }
    100% { transform: translateX(calc(100vw + 120px)) translateY(2px) rotate(8deg); }
}

/* ── Billboard screen ───────────────────────────────────── */
.adl-billboard {
    position: relative;
    margin: 0 auto;
    width: 100%;
    max-width: min(640px, 65vh);
}

.adl-screen {
    position: relative;
    width: 100%;
    aspect-ratio: 16 / 9;
    background: #10161f;
    border: 6px solid #1d2733;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 14px 30px rgba(16, 22, 31, .28);
}

/* Sheen sweeping over the screen */
.adl-screen::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(115deg, transparent 35%, rgba(255,255,255,.14) 48%, transparent 62%);
    background-size: 260% 100%;
    animation: adl-sheen 4.2s ease-in-out infinite;
    pointer-events: none;
}

@keyframes adl-sheen {
    0%, 15%  { background-position: 130% 0; }
    55%, 100% { background-position: -130% 0; }
}

.adl-slide {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0;
    transform: scale(1.06);
    transition: opacity .8s ease, transform 5.5s linear;
}

.adl-slide.is-showing {
    opacity: 1;
    transform: scale(1);
}

a.adl-slide-link { display: contents; cursor: pointer; }

.adl-ad-chip {
    position: absolute;
    top: 10px;
    right: 10px;
    z-index: 2;
    background: rgba(16, 22, 31, .62);
    color: #fff;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: .12em;
    text-transform: uppercase;
    padding: 3px 8px;
    border-radius: 4px;
    pointer-events: none;
}

/* Per-slide progress dots */
.adl-dots {
    position: absolute;
    bottom: 9px;
    left: 0;
    right: 0;
    z-index: 2;
    display: flex;
    justify-content: center;
    gap: 6px;
    pointer-events: none;
}

.adl-dot {
    width: 6px;
    height: 6px;
    border-radius: 999px;
    background: rgba(255, 255, 255, .45);
    transition: width .3s ease, background .3s ease;
}

.adl-dot.is-on { width: 18px; background: #fff; }

/* Billboard stands */
.adl-stands {
    display: flex;
    justify-content: space-between;
    padding: 0 70px;
}

.adl-stand {
    width: 12px;
    height: 20px;
    background: linear-gradient(180deg, #3c4756, #232c38);
    border-radius: 0 0 4px 4px;
}

/* ── Conveyor belt ──────────────────────────────────────── */
.adl-belt-wrap {
    position: relative;
    margin: 0 -24px;
    height: 94px;
    background: #2a3442;
    overflow: hidden;
}

.adl-belt-surface {
    position: absolute;
    inset: 0;
    background: repeating-linear-gradient(
        100deg,
        #333f4f 0px, #333f4f 26px,
        #2a3442 26px, #2a3442 52px
    );
    animation: adl-belt-move 1.6s linear infinite;
}

@keyframes adl-belt-move {
    from { transform: translateX(0); }
    to   { transform: translateX(-52px); }
}

.adl-belt-items {
    position: absolute;
    bottom: 8px;
    left: 0;
    display: flex;
    align-items: flex-end;
    gap: 64px;
    padding-right: 64px;
    width: max-content;
    animation: adl-belt-items 20s linear infinite;
    will-change: transform;
}

@keyframes adl-belt-items {
    0%   { transform: translateX(0); }
    100% { transform: translateX(-50%); }
}

.adl-belt-items svg {
    width: 76px;
    height: 76px;
    flex: 0 0 auto;
    filter: drop-shadow(0 3px 3px rgba(0,0,0,.35));
    animation: adl-wobble 1.1s ease-in-out infinite;
}

.adl-belt-items svg:nth-child(2n) { animation-delay: .25s; }
.adl-belt-items svg:nth-child(3n) { animation-delay: .5s; }

@keyframes adl-wobble {
    0%, 100% { transform: translateY(0); }
    50%      { transform: translateY(-2px); }
}

/* ── Search info + status ───────────────────────────────── */
.adl-info {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 22px;
    margin: 10px 0 4px;
    font-size: 14px;
    font-weight: 700;
    color: #1d2733;
    text-align: center;
}

.adl-info:empty { display: none; }

.adl-status {
    margin: 6px 0 0;
    font-size: 12.5px;
    color: #6b7686;
    text-align: center;
    min-height: 18px;
    transition: opacity .3s ease;
}

.adl-status.is-fading { opacity: 0; }

/* Indeterminate shimmer bar */
.adl-bar {
    position: relative;
    height: 4px;
    margin: 10px auto 14px;
    width: min(320px, 80%);
    background: #e8ebef;
    border-radius: 999px;
    overflow: hidden;
}

.adl-bar::before {
    content: "";
    position: absolute;
    top: 0; bottom: 0;
    width: 40%;
    border-radius: 999px;
    background: linear-gradient(90deg, #039CE0, #ff893b);
    animation: adl-bar-slide 1.4s ease-in-out infinite;
}

@keyframes adl-bar-slide {
    0%   { left: -40%; }
    100% { left: 100%; }
}

/* ── Small screens ──────────────────────────────────────── */
@media (max-width: 480px) {
    .adl-card { padding: 16px 14px 0; width: 100%; }
    .adl-belt-wrap { margin: 0 -14px; height: 72px; }
    .adl-title { font-size: 15px; }
    .adl-subtitle { font-size: 11.5px; }
    .adl-stands { padding: 0 15%; }
    .adl-belt-items svg { width: 48px; height: 48px; }
    .adl-head { flex-wrap: wrap; gap: 8px; }
    .adl-close { font-size: 11px; padding: 5px 10px; }
    .adl-info { font-size: 12.5px; }
}

/* ── Reduced motion ─────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
    .adl-plane,
    .adl-belt-surface,
    .adl-belt-items,
    .adl-belt-items svg,
    .adl-screen::after { animation: none; }
    .adl-card { animation-duration: .01s; }
    .adl-slide { transition: opacity .3s ease; transform: none; }
}
