/* ══════════════════════════════════════════════════════════════
   Rebook.ae — Site Announcement & Greeting System
   greeting.css  |  Isolated from all other styles
══════════════════════════════════════════════════════════════ */

/* ── CSS Variables ──────────────────────────────────────────── */
:root { --topbar-h: 0px; }

body.has-topbar {
    --topbar-h: 44px;
    --header-h: 132px; /* 88 + 44 */
    /* Explicit padding-top so body content is always pushed below the navbar+topbar */
    padding-top: 132px;
    --controls-sticky-top: 132px;
    --sidebar-sticky-top: calc(132px + 52px);
}

/* Hero section (.hero class used on some pages): bump its internal padding-top */
body.has-topbar .hero {
    padding-top: calc(88px + 44px + 2.2rem) !important;
}

@media (max-width: 575px) {
    body.has-topbar {
        --topbar-h: 40px;
        --header-h: 128px; /* 88 + 40 */
        padding-top: 128px;
    }
    body.has-topbar .hero {
        padding-top: calc(88px + 40px + 1.2rem) !important;
    }
}

/* ── TopBar ─────────────────────────────────────────────────── */
#siteTopbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1200;
    min-height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1),
                opacity   0.35s ease;
    will-change: transform;
}

#siteTopbar.is-hidden {
    transform: translateY(-110%);
    opacity: 0;
    pointer-events: none;
}

.site-topbar__inner {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    width: 100%;
    max-width: 1400px;
    /* Logical padding: start side gets 1rem, end side gets 3rem (space for close btn) */
    padding-block: 0;
    padding-inline-start: 1rem;
    padding-inline-end: 3rem;
    position: relative;
    min-height: 44px;
}

.site-topbar__icon {
    font-size: 1.1rem;
    flex-shrink: 0;
    line-height: 1;
}

.site-topbar__text {
    font-weight: 600;
    line-height: 1.4;
    text-align: center;
}

.site-topbar__close {
    position: absolute;
    /* inset-inline-end keeps button on the "end" side in both LTR and RTL */
    inset-inline-end: 0.85rem;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255, 255, 255, 0.18);
    border: 1px solid rgba(255, 255, 255, 0.28);
    border-radius: 50%;
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: inherit;
    font-size: 0.7rem;
    transition: background 0.2s ease, transform 0.15s ease;
    flex-shrink: 0;
    padding: 0;
    line-height: 1;
}

.site-topbar__close:hover {
    background: rgba(255, 255, 255, 0.38);
    transform: translateY(-50%) scale(1.12);
}

/* ── Header Wrapper: single fixed block containing topbar + navbar ── */
.rb-header-wrap {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1100;
}

/* Topbar inside wrapper: override fixed → relative so it flows above navbar */
.rb-header-wrap #siteTopbar {
    position: relative !important;
    top: auto !important;
    left: auto !important;
    right: auto !important;
    z-index: auto !important;
    overflow: hidden;
    max-height: 200px;
    transition: max-height 0.35s ease, opacity 0.35s ease,
                min-height 0.35s ease, padding 0.35s ease;
}

/* Hide: collapse topbar height so navbar slides up */
.rb-header-wrap #siteTopbar.is-hidden {
    max-height: 0 !important;
    min-height: 0 !important;
    padding-block: 0 !important;
    opacity: 0;
    pointer-events: none;
    transform: none !important;
}

/* Navbar inside wrapper: override Bootstrap fixed-top → relative */
.rb-header-wrap .rb-navbar,
.rb-header-wrap nav.rb-navbar {
    position: relative !important;
    top: auto !important;
    left: auto !important;
    right: auto !important;
    z-index: auto;
}

/* ── TopBar Animations ──────────────────────────────────────── */

/* Marquee */
#siteTopbar.site-topbar--marquee .site-topbar__inner {
    overflow: hidden;
}

.site-topbar__marquee {
    display: flex;
    overflow: hidden;
    flex: 1;
    min-width: 0;
}

.site-topbar__marquee span {
    display: block;
    flex-shrink: 0;
    white-space: nowrap;
    font-weight: 600;
    padding-inline-end: 4rem;
    animation: tbMarqueeLtr 32s linear infinite;
    will-change: transform;
}

/* RTL: text scrolls rightward */
[dir="rtl"] .site-topbar__marquee span,
html[lang="ar"] .site-topbar__marquee span {
    animation: tbMarqueeRtl 32s linear infinite;
}

@keyframes tbMarqueeLtr {
    0%   { transform: translateX(0); }
    100% { transform: translateX(-100%); }
}

@keyframes tbMarqueeRtl {
    0%   { transform: translateX(0); }
    100% { transform: translateX(100%); }
}

/* Pulse */
#siteTopbar.site-topbar--pulse .site-topbar__text,
#siteTopbar.site-topbar--pulse .site-topbar__marquee span {
    animation: tbPulse 2.8s ease-in-out infinite;
}

@keyframes tbPulse {
    0%, 100% { opacity: 1;   transform: scale(1); }
    50%       { opacity: 0.8; transform: scale(1.015); }
}

/* Typewriter cursor */
.site-topbar__typewriter::after {
    content: '|';
    margin-inline-start: 1px;
    animation: tbBlink 0.75s step-end infinite;
}

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

/* ── Greeting Popup Overlay ─────────────────────────────────── */
#annPopupOverlay {
    position: fixed;
    inset: 0;
    z-index: 9999;
    background: rgba(0, 0, 0, 0.65);
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

#annPopupOverlay.is-visible {
    opacity: 1;
    pointer-events: all;
}

/* ── Popup Card ─────────────────────────────────────────────── */
.ann-popup {
    position: relative;
    border-radius: 24px;
    padding: 2.5rem 2rem 2rem;
    max-width: 460px;
    width: 100%;
    text-align: center;
    box-shadow: 0 30px 80px rgba(0, 0, 0, 0.5),
                0 0 0 1px rgba(255, 255, 255, 0.08) inset;
    overflow: hidden;
    background-size: cover !important;
    background-position: center !important;
    background-repeat: no-repeat !important;
}

/* Shimmer overlay for elegant theme */
.ann-popup::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg,
        rgba(255,255,255,0.06) 0%,
        transparent 50%,
        rgba(255,255,255,0.03) 100%);
    pointer-events: none;
    border-radius: inherit;
}

/* ── Enter Animations ────────────────────────────────────────── */

/* Zoom */
.ann-popup--zoom {
    transform: scale(0.65);
    opacity: 0;
    transition: transform 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275),
                opacity   0.35s ease;
}
#annPopupOverlay.is-visible .ann-popup--zoom {
    transform: scale(1);
    opacity: 1;
}

/* Slide Up */
.ann-popup--slide-up {
    transform: translateY(70px);
    opacity: 0;
    transition: transform 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275),
                opacity   0.35s ease;
}
#annPopupOverlay.is-visible .ann-popup--slide-up {
    transform: translateY(0);
    opacity: 1;
}

/* Fade */
.ann-popup--fade {
    opacity: 0;
    transition: opacity 0.45s ease;
}
#annPopupOverlay.is-visible .ann-popup--fade {
    opacity: 1;
}

/* ── Popup Content ───────────────────────────────────────────── */
.ann-popup__close {
    position: absolute;
    top: 0.85rem;
    inset-inline-end: 0.85rem;
    width: 36px;
    height: 36px;
    border: none;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.12);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: inherit;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 1rem;
    transition: background 0.2s ease, transform 0.15s ease;
    line-height: 1;
}

.ann-popup__close:hover {
    background: rgba(255, 255, 255, 0.25);
    transform: scale(1.1);
}

.ann-popup__icon {
    font-size: 3.2rem;
    display: block;
    margin-bottom: 0.6rem;
    animation: annIconBounce 0.7s cubic-bezier(0.175, 0.885, 0.32, 1.275) 0.35s both;
    filter: drop-shadow(0 4px 12px rgba(0,0,0,0.25));
}

@keyframes annIconBounce {
    from { transform: scale(0) rotate(-20deg); opacity: 0; }
    to   { transform: scale(1) rotate(0deg);   opacity: 1; }
}

.ann-popup__title {
    font-size: 1.55rem;
    font-weight: 800;
    margin: 0 0 0.5rem;
    line-height: 1.3;
    text-shadow: 0 2px 8px rgba(0,0,0,0.2);
    animation: annFadeUp 0.5s ease 0.45s both;
}

.ann-popup__msg {
    font-size: 0.95rem;
    opacity: 0.88;
    line-height: 1.65;
    margin-bottom: 1.5rem;
    animation: annFadeUp 0.5s ease 0.55s both;
}

.ann-popup__footer {
    font-size: 0.78rem;
    opacity: 0.55;
    animation: annFadeUp 0.5s ease 0.65s both;
}

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

/* Timer bar */
.ann-popup__timer-bar {
    position: absolute;
    bottom: 0;
    left: 0;
    height: 3px;
    background: rgba(255, 255, 255, 0.45);
    border-radius: 0 0 0 24px;
}

/* ── Responsive ─────────────────────────────────────────────── */
@media (max-width: 575px) {
    .ann-popup {
        padding: 2rem 1.25rem 1.5rem;
        border-radius: 18px;
    }

    .ann-popup__title { font-size: 1.3rem; }
    .ann-popup__icon  { font-size: 2.5rem; }

    #siteTopbar { min-height: 40px; font-size: 0.78rem !important; }
    .site-topbar__text,
    .site-topbar__marquee span,
    .site-topbar__typewriter { font-size: 0.78rem; }
}

/* ── Spin utility (admin loading) ───────────────────────────── */
.spin { animation: spinAnim 0.8s linear infinite; display: inline-block; }
@keyframes spinAnim { to { transform: rotate(360deg); } }
