/* =============================================================
   SMOS ANNOUNCEMENT POPUP
   Uses theme tokens from variables.css — no hardcoded colours.
   Integrated for St Mary's Orthodox School, Kanpur.
   ============================================================= */

/* ── OVERLAY ────────────────────────────────────────────────── */
.smos-popup-overlay {
    position: fixed;
    inset: 0;
    background: rgba(10, 12, 30, 0.78);
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
    z-index: 99990;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.4s ease;
}
.smos-popup-overlay.is-open {
    opacity: 1;
    pointer-events: all;
}

/* ── POPUP BOX ──────────────────────────────────────────────── */
.smos-popup {
    position: relative;
    width: 100%;
    max-width: 740px;
    background: var(--white);
    border-radius: 16px;
    box-shadow: 0 30px 70px rgba(10,12,40,0.28), 0 8px 24px rgba(10,12,40,0.14);
    overflow: hidden;
    transform: scale(0.86) translateY(28px);
    opacity: 0;
    transition: transform 0.48s cubic-bezier(0.34,1.56,0.64,1), opacity 0.38s ease;
    font-family: var(--font-body);
}
.smos-popup-overlay.is-open .smos-popup {
    transform: scale(1) translateY(0);
    opacity: 1;
}

/* ── HEADER ─────────────────────────────────────────────────── */
.smos-popup__header {
    background: linear-gradient(130deg, var(--navy-dark) 0%, var(--navy) 60%, #4455cc 100%);
    padding: 20px 24px 18px;
    display: flex;
    align-items: center;
    gap: 14px;
    position: relative;
    overflow: hidden;
}
/* Decorative circles */
.smos-popup__header::before,
.smos-popup__header::after {
    content: '';
    position: absolute;
    border-radius: 50%;
    background: rgba(255,255,255,0.06);
    pointer-events: none;
}
.smos-popup__header::before {
    width: 180px; height: 180px;
    top: -60px; right: -40px;
}
.smos-popup__header::after {
    width: 120px; height: 120px;
    bottom: -50px; left: 25%;
}
.smos-popup__logo {
    width: 46px;
    height: 46px;
    object-fit: contain;
    border-radius: 10px;
    background: rgba(255,255,255,0.12);
    padding: 4px;
    flex-shrink: 0;
    border: 1px solid rgba(255,255,255,0.22);
}
.smos-popup__header-text {
    flex: 1;
    min-width: 0;
}
.smos-popup__header-title {
    font-family: var(--font-heading);
    color: var(--white);
    font-size: 1.15rem;
    font-weight: 700;
    margin: 0 0 2px;
    line-height: 1.25;
    letter-spacing: 0.01em;
}
.smos-popup__header-sub {
    color: rgba(255,255,255,0.68);
    font-size: 0.78rem;
    margin: 0;
    font-weight: 400;
}
/* Gold underline accent */
.smos-popup__header-title span {
    display: block;
    width: 36px;
    height: 2px;
    background: var(--gold);
    margin-top: 6px;
    border-radius: 2px;
}

/* ── CLOSE BUTTON ───────────────────────────────────────────── */
.smos-popup__close {
    position: absolute;
    top: 13px;
    right: 13px;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: rgba(255,255,255,0.13);
    border: 1px solid rgba(255,255,255,0.28);
    color: var(--white);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 17px;
    line-height: 1;
    padding: 0;
    transition: background 0.2s, transform 0.25s ease;
    z-index: 5;
    font-family: var(--font-body);
}
.smos-popup__close:hover {
    background: rgba(255,255,255,0.26);
    transform: rotate(90deg);
}
.smos-popup__close:focus {
    outline: 2px solid rgba(255,255,255,0.55);
    outline-offset: 2px;
}

/* ── TIMER BAR ──────────────────────────────────────────────── */
.smos-popup__timer {
    height: 3px;
    background: var(--light-bg);
    position: relative;
}
.smos-popup__timer-fill {
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg, var(--gold), var(--gold-light));
    transform-origin: left center;
    animation: smosTimerDrain 15s linear forwards;
}
@keyframes smosTimerDrain {
    from { transform: scaleX(1); }
    to   { transform: scaleX(0); }
}

/* ── CARDS GRID ─────────────────────────────────────────────── */
.smos-popup__cards {
    display: grid;
    grid-template-columns: 1fr 1fr;
}

/* ── SINGLE CARD ────────────────────────────────────────────── */
.smos-card {
    position: relative;
    overflow: hidden;
    border-right: 1px solid var(--border);
}
.smos-card:last-child {
    border-right: none;
}

/* Image wrapper */
.smos-card__img-wrap {
    position: relative;
    overflow: hidden;
    height: 154px;
}
.smos-card__img {
    width: 100%;
    height: 154px;
    object-fit: cover;
    display: block;
    transition: transform 0.5s ease;
}
.smos-card:hover .smos-card__img {
    transform: scale(1.05);
}

/* Placeholder (shown when no real image is set) */
.smos-card__placeholder {
    width: 100%;
    height: 154px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 50px;
    transition: transform 0.5s ease;
}
.smos-card:hover .smos-card__placeholder {
    transform: scale(1.08);
}
/* Admission placeholder — navy gradient */
.smos-card--admission .smos-card__placeholder {
    background: linear-gradient(140deg, var(--navy-dark) 0%, var(--navy) 55%, #5566dd 100%);
}
/* Result placeholder — gold/warm gradient */
.smos-card--result .smos-card__placeholder {
    background: linear-gradient(140deg, #7a5800 0%, #a07820 50%, var(--gold) 100%);
}

/* ── NEW BADGE ──────────────────────────────────────────────── */
.smos-badge {
    position: absolute;
    top: 11px;
    left: 11px;
    background: var(--red);
    color: var(--white);
    font-size: 0.62rem;
    font-weight: 700;
    font-family: var(--font-body);
    padding: 3px 9px;
    border-radius: 50px;
    letter-spacing: 0.09em;
    text-transform: uppercase;
    animation: smosBlink 1.5s ease-in-out infinite;
    box-shadow: 0 2px 8px rgba(192,57,43,0.45);
    z-index: 2;
}
@keyframes smosBlink {
    0%, 100% { opacity: 1; }
    50%       { opacity: 0.5; }
}

/* Image overlay gradient */
.smos-card__img-wrap::after {
    content: '';
    position: absolute;
    bottom: 0; left: 0; right: 0;
    height: 50%;
    background: linear-gradient(to top, rgba(10,12,40,0.35), transparent);
    pointer-events: none;
}

/* ── CARD BODY ──────────────────────────────────────────────── */
.smos-card__body {
    padding: 16px 18px 18px;
    background: var(--white);
}
.smos-card__tag {
    display: inline-block;
    font-size: 0.67rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    margin-bottom: 6px;
    padding: 2px 8px;
    border-radius: 4px;
}
.smos-card--admission .smos-card__tag {
    color: var(--navy);
    background: rgba(51,68,187,0.09);
}
.smos-card--result .smos-card__tag {
    color: #7a5800;
    background: rgba(200,168,75,0.14);
}
.smos-card__title {
    font-family: var(--font-heading);
    font-size: 1rem;
    font-weight: 700;
    color: var(--text);
    margin: 0 0 7px;
    line-height: 1.3;
}
.smos-card__desc {
    font-size: 0.8rem;
    color: var(--text-light);
    margin: 0 0 14px;
    line-height: 1.6;
}

/* ── CTA BUTTONS ────────────────────────────────────────────── */
.smos-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    padding: 10px 18px;
    border-radius: var(--radius);
    font-family: var(--font-body);
    font-size: 0.82rem;
    font-weight: 700;
    cursor: pointer;
    border: none;
    text-decoration: none;
    transition: transform 0.2s ease, box-shadow 0.2s ease, filter 0.2s;
    letter-spacing: 0.025em;
    width: 100%;
    text-align: center;
}
.smos-btn:hover {
    transform: translateY(-2px);
    filter: brightness(1.07);
    color: var(--white);
}
.smos-btn:active { transform: translateY(0); }
.smos-btn:focus {
    outline: 3px solid rgba(51,68,187,0.35);
    outline-offset: 2px;
}
/* Admission — red (theme primary CTA) */
.smos-btn--admission {
    background: var(--red);
    color: var(--white);
    box-shadow: 0 4px 14px rgba(192,57,43,0.32);
}
.smos-btn--admission:hover {
    background: var(--red-dark);
    box-shadow: 0 6px 20px rgba(192,57,43,0.42);
}
/* Result — navy (theme secondary) */
.smos-btn--result {
    background: var(--navy);
    color: var(--white);
    box-shadow: 0 4px 14px rgba(51,68,187,0.28);
}
.smos-btn--result:hover {
    background: var(--navy-dark);
    box-shadow: 0 6px 20px rgba(51,68,187,0.38);
}
.smos-btn__arrow {
    font-size: 1rem;
    transition: transform 0.2s;
}
.smos-btn:hover .smos-btn__arrow {
    transform: translateX(3px);
}

/* ── FOOTER ─────────────────────────────────────────────────── */
.smos-popup__footer {
    background: var(--light-bg);
    border-top: 1px solid var(--border);
    padding: 9px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}
.smos-popup__footer-note {
    font-size: 0.71rem;
    color: var(--text-light);
}
.smos-popup__footer-brand {
    font-size: 0.71rem;
    color: var(--navy);
    font-weight: 600;
    white-space: nowrap;
    opacity: 0.65;
}

/* ── FLOATING STICKY BUTTON ─────────────────────────────────── */
.smos-float-btn {
    position: fixed;
    bottom: 28px;
    right: 26px;
    z-index: 99989;
    display: flex;
    align-items: center;
    gap: 9px;
    background: linear-gradient(135deg, var(--navy-dark), var(--navy));
    color: var(--white);
    border: none;
    border-radius: 50px;
    padding: 12px 20px 12px 15px;
    cursor: pointer;
    font-family: var(--font-body);
    font-size: 0.83rem;
    font-weight: 700;
    box-shadow: 0 6px 22px rgba(34,51,170,0.38), 0 2px 8px rgba(34,51,170,0.2);
    opacity: 0;
    pointer-events: none;
    transform: translateY(22px) scale(0.88);
    transition: opacity 0.4s ease, transform 0.42s cubic-bezier(0.34,1.56,0.64,1), box-shadow 0.22s;
    letter-spacing: 0.02em;
    border: 1.5px solid rgba(255,255,255,0.12);
}
.smos-float-btn.is-visible {
    opacity: 1;
    pointer-events: all;
    transform: translateY(0) scale(1);
    animation: smosFloatBob 3.5s ease-in-out infinite;
}
.smos-float-btn:hover {
    box-shadow: 0 10px 30px rgba(34,51,170,0.48);
    animation-play-state: paused;
    transform: translateY(-3px) scale(1.04) !important;
    color: var(--white);
}
.smos-float-btn:focus {
    outline: 3px solid rgba(255,255,255,0.45);
    outline-offset: 2px;
}
@keyframes smosFloatBob {
    0%, 100% { transform: translateY(0);    }
    50%       { transform: translateY(-5px); }
}

/* Pulsing gold dot */
.smos-float-btn__dot {
    position: relative;
    width: 9px;
    height: 9px;
    border-radius: 50%;
    background: var(--gold);
    flex-shrink: 0;
}
.smos-float-btn__dot::after {
    content: '';
    position: absolute;
    inset: -4px;
    border-radius: 50%;
    background: rgba(200,168,75,0.35);
    animation: smosGoldPulse 1.7s ease-in-out infinite;
}
@keyframes smosGoldPulse {
    0%, 100% { transform: scale(1); opacity: 1; }
    50%       { transform: scale(1.9); opacity: 0; }
}

/* ── CONFETTI CANVAS ────────────────────────────────────────── */
#smos-confetti {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 99999;
    display: none;
}

/* ── RESPONSIVE ─────────────────────────────────────────────── */
@media (max-width: 640px) {
    .smos-popup {
        border-radius: 14px;
        max-height: 92dvh;
        overflow-y: auto;
    }
    .smos-popup__cards {
        grid-template-columns: 1fr;
    }
    .smos-card {
        border-right: none;
        border-bottom: 1px solid var(--border);
    }
    .smos-card:last-child { border-bottom: none; }
    .smos-card__img-wrap,
    .smos-card__placeholder,
    .smos-card__img { height: 126px; }
    .smos-card__placeholder { font-size: 40px; }
    .smos-card__body { padding: 13px 15px 15px; }
    .smos-popup__header { padding: 15px 16px; }
    .smos-popup__header-title { font-size: 1rem; }
    .smos-float-btn { bottom: 16px; right: 14px; padding: 11px 16px 11px 12px; font-size: 0.77rem; }
}
@media (max-width: 360px) {
    .smos-popup__header-sub { display: none; }
}
