/* Teachionary Completion Celebration
 * Geometric Enlightenment theme: radiating light bursts, cyan palette, branded atmosphere
 */

:root {
    --teachionary-red: #FF0000;
    --teachionary-green: #00FF00;
    --teachionary-cyan: #00FFFF;
    --teachionary-orange: #FFA500;
    --teachionary-purple: #800080;
    --teachionary-brown: #8B4513;
    --accent-bright: #FFD700;
}

/* Full-screen celebration container */
.celebration-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg,
        var(--teachionary-red) 0%,
        var(--teachionary-orange) 20%,
        var(--teachionary-cyan) 40%,
        var(--teachionary-green) 60%,
        var(--teachionary-purple) 80%,
        var(--teachionary-red) 100%);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    overflow: hidden;
    font-family: 'Segoe UI', Trebuchet MS, sans-serif;
    color: white;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
}

/* Grain texture overlay for sophistication */
.celebration-overlay::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image:
        url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' result='noise'/%3E%3C/filter%3E%3Crect width='200' height='200' fill='%23fff' filter='url(%23noise)' opacity='0.08'/%3E%3C/svg%3E");
    opacity: 0.3;
    pointer-events: none;
    z-index: 1;
}

/* Background geometric fireworks container */
.fireworks-bg {
    position: absolute;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
    z-index: 0;
    overflow: hidden;
}

/* Radiating burst from center */
.burst-rays {
    position: absolute;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
}

.ray {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 3px;
    height: 40%;
    background: linear-gradient(to top, white, rgba(255,255,255,0.3), transparent);
    opacity: 0;
    transform-origin: bottom center;
    animation: rayBurst 2.5s cubic-bezier(0.25, 0.46, 0.45, 0.94) forwards;
    filter: drop-shadow(0 0 6px rgba(255,255,255,0.8));
}

@keyframes rayBurst {
    0% {
        height: 20%;
        opacity: 0.8;
    }
    100% {
        height: 60%;
        opacity: 0;
    }
}

/* Concentric expanding circles */
.circle-burst {
    position: absolute;
    top: 50%;
    left: 50%;
    border: 3px solid white;
    border-radius: 50%;
    transform: translate(-50%, -50%);
    opacity: 0;
    animation: circlePulse 2.5s cubic-bezier(0.25, 0.46, 0.45, 0.94) forwards;
    filter: drop-shadow(0 0 8px rgba(255,255,255,0.9));
}

@keyframes circlePulse {
    0% {
        width: 40px;
        height: 40px;
        opacity: 0.9;
    }
    100% {
        width: 600px;
        height: 600px;
        opacity: 0;
    }
}

/* Corner accent bursts */
.accent-burst {
    position: absolute;
    width: 200px;
    height: 200px;
    background: radial-gradient(circle, rgba(255,255,255,0.9) 0%, transparent 70%);
    opacity: 0;
    filter: blur(40px);
    animation: accentPulse 3s ease-out forwards;
}

.accent-burst.top-left {
    top: -100px;
    left: -100px;
    animation-delay: 0.2s;
}

.accent-burst.top-right {
    top: -100px;
    right: -100px;
    animation-delay: 0.3s;
}

.accent-burst.bottom-left {
    bottom: -100px;
    left: -100px;
    animation-delay: 0.35s;
}

.accent-burst.bottom-right {
    bottom: -100px;
    right: -100px;
    animation-delay: 0.25s;
}

@keyframes accentPulse {
    0% {
        opacity: 0.6;
        transform: scale(0.5);
    }
    100% {
        opacity: 0;
        transform: scale(1.3);
    }
}

/* Logo container */
.celebration-logos {
    position: absolute;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2;
    pointer-events: none;
}

.logo-element {
    position: absolute;
    opacity: 0;
    animation: logoPulse 2.8s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: none;
}

.logo-element.logo-left {
    left: 2%;
    top: 10%;
    width: 400px;
    height: 400px;
    animation-delay: 0.6s;
}

.logo-element.logo-right {
    right: 2%;
    bottom: 10%;
    width: 480px;
    height: 480px;
    animation-delay: 0.8s;
}

.logo-element img {
    max-width: 85%;
    height: auto;
    filter: brightness(1.2) saturate(1.1);
}

@keyframes logoPulse {
    0% {
        opacity: 0;
        transform: scale(0.3) rotate(-10deg);
    }
    50% {
        opacity: 1;
    }
    100% {
        opacity: 0.8;
        transform: scale(1) rotate(0deg);
    }
}

/* Content container (text + buttons) — centered below header */
.celebration-content {
    position: relative;
    z-index: 3;
    text-align: center;
    animation: contentFadeIn 0.8s ease-out 0.4s both;
    margin-top: 12.2vw;
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

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

.celebration-title {
    font-size: 4em;
    font-weight: 700;
    letter-spacing: -2px;
    margin: 20px 0;
    text-shadow: 0 0 40px rgba(0, 255, 255, 0.5);
    line-height: 1.1;
}

.celebration-subtitle {
    font-size: 1.8em;
    font-weight: 300;
    letter-spacing: 1px;
    margin: 30px 0 50px;
    color: white;
    opacity: 1;
    text-transform: uppercase;
    text-shadow: 3px 3px 6px rgba(0, 0, 0, 0.6);
}

/* Completion buttons */
.completion-buttons {
    display: flex;
    gap: 20px;
    justify-content: center;
    margin-top: 40px;
    flex-wrap: wrap;
}

.completion-btn {
    background: white;
    color: #000;
    border: none;
    padding: 16px 32px;
    font-size: 1.1em;
    font-weight: 700;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    text-transform: uppercase;
    letter-spacing: 1px;
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.4);
    position: relative;
    overflow: hidden;
}

.completion-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.2);
    transition: left 0.5s;
    z-index: -1;
}

.completion-btn:hover {
    transform: translateY(-4px) scale(1.05);
    box-shadow: 0 12px 32px rgba(0, 255, 255, 0.5);
}

.completion-btn:hover::before {
    left: 100%;
}

.completion-btn:active {
    transform: translateY(-2px) scale(1.02);
}

/* Auto-advance countdown */
.celebration-countdown {
    margin-top: 30px;
    font-size: 0.95em;
    color: rgba(255, 255, 255, 0.7);
    opacity: 0;
    animation: countdownFade 0.6s ease-out 2.2s both;
}

@keyframes countdownFade {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

.countdown-timer {
    font-weight: 600;
    color: var(--accent-bright);
    font-size: 1.2em;
}

/* Full-width logo header — positioned at TOP */
/* aspect-ratio = sum of individual aspect ratios (460/328 + 509/75 = 8.189:1) */
.celebration-header {
    position: absolute;
    top: 0;
    left: 0;
    width: 100vw;
    aspect-ratio: 8.189 / 1;
    display: grid;
    grid-template-columns: 1.402fr 6.787fr;
    gap: 0;
    margin: 0;
    padding: 0;
    overflow: hidden;
    border-radius: 0;
    z-index: 2;
}

.header-logo {
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--teachionary-red) 0%, var(--teachionary-orange) 100%);
    overflow: hidden;
    padding: 0;
    margin: 0;
}

.header-logo img {
    height: 100%;
    width: auto;
    object-fit: contain;
    filter: brightness(1.1);
}

.header-logo.right {
    background: linear-gradient(135deg, var(--teachionary-green) 0%, var(--teachionary-cyan) 100%);
}

/* ────────────────────────────────────── */
/* SWOOP TRANSITION ANIMATIONS */
/* ────────────────────────────────────── */

.swoop-exit {
    animation: swoopExit 1s cubic-bezier(0.25, 0.46, 0.45, 0.94) forwards;
}

@keyframes swoopExit {
    0% {
        transform: translateX(0);
        opacity: 1;
    }
    100% {
        transform: translateX(100%);
        opacity: 0;
    }
}

.swoop-exit-left {
    animation: swoopExitLeft 1s cubic-bezier(0.25, 0.46, 0.45, 0.94) forwards;
}

@keyframes swoopExitLeft {
    0% {
        transform: translateX(0);
        opacity: 1;
    }
    100% {
        transform: translateX(-100%);
        opacity: 0;
    }
}

.swoop-enter {
    animation: swoopEnter 1s cubic-bezier(0.25, 0.46, 0.45, 0.94) forwards;
}

@keyframes swoopEnter {
    0% {
        transform: translateX(-100%);
        opacity: 0;
    }
    100% {
        transform: translateX(0);
        opacity: 1;
    }
}

.swoop-enter-right {
    animation: swoopEnterRight 1s cubic-bezier(0.25, 0.46, 0.45, 0.94) forwards;
}

@keyframes swoopEnterRight {
    0% {
        transform: translateX(100%);
        opacity: 0;
    }
    100% {
        transform: translateX(0);
        opacity: 1;
    }
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .celebration-title {
        font-size: 2.5em;
    }

    .celebration-subtitle {
        font-size: 1.2em;
    }

    .completion-buttons {
        flex-direction: column;
    }

    .completion-btn {
        width: 100%;
    }

    .logo-element img {
        max-width: 80px;
    }
}
