/* ═══════════════════════════════════════════════════════════════════════════
   ATTACHE CELEBRATION SYSTEM - SOPHISTICATED EDITION
   Subtle, elegant background effects inspired by:
   - Microsoft Windows 11 Search Box aurora effects
   - Google Doodle integrated animations
   - Apple's refined gradient treatments

   Designed for professional legal environments - understated elegance
   ═══════════════════════════════════════════════════════════════════════════ */

/* ─────────────────────────────────────────────────────────────────────────────
   CSS CUSTOM PROPERTIES - Celebration Design Tokens
   ───────────────────────────────────────────────────────────────────────────── */
:root {
    /* Aurora palette - New Year (warm champagne gold) - increased visibility */
    --cel-aurora-1: rgba(255, 215, 140, 0.35);
    --cel-aurora-2: rgba(255, 200, 100, 0.25);
    --cel-aurora-3: rgba(255, 235, 180, 0.20);
    --cel-aurora-4: rgba(255, 245, 220, 0.15);

    /* Sparkle colors */
    --cel-sparkle-gold: #FFD700;
    --cel-sparkle-champagne: #F7E7CE;
    --cel-sparkle-white: #FFFEF5;

    /* Text styling */
    --cel-text-primary: rgba(180, 150, 80, 0.85);
    --cel-text-secondary: rgba(160, 130, 60, 0.6);

    /* Timing */
    --cel-duration-slow: 20s;
    --cel-duration-medium: 12s;
    --cel-duration-fast: 8s;
}

/* ─────────────────────────────────────────────────────────────────────────────
   TOPBAR CELEBRATION CONTAINER
   Background layer behind topbar-left content (mobile toggle + court selector)
   ───────────────────────────────────────────────────────────────────────────── */
.topbar-celebration-wrapper {
    position: absolute;
    top: 0;
    left: 0;
    width: 480px; /* Extends behind mobile toggle + court selector */
    max-width: 60%;
    height: var(--topbar-height, 64px);
    min-height: 64px;
    overflow: hidden;
    pointer-events: none; /* Click-through to content above */
    z-index: 0; /* Behind all content */
    border-radius: 0 32px 32px 0;
}

/* Ensure topbar-left has relative positioning and full height */
.modern-topbar .topbar-left {
    position: relative;
    height: var(--topbar-height, 64px);
    min-height: 64px;
}

/* ─────────────────────────────────────────────────────────────────────────────
   AURORA BACKGROUND - Microsoft Windows 11 Inspired
   Subtle, flowing gradient animation
   ───────────────────────────────────────────────────────────────────────────── */
.celebration-aurora {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100%;
    height: 100%;
    min-height: var(--topbar-height, 64px);
    pointer-events: none;
    overflow: visible;
    opacity: 0;
    transition: opacity 1.5s ease-out;
    z-index: 0;
}

.celebration-aurora.aurora-visible {
    opacity: 1;
}

/* Primary aurora blob - warm gold glow filling from left */
.celebration-aurora::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 0;
    width: 100%;
    height: 300%;
    transform: translateY(-50%);
    background: radial-gradient(
        ellipse 80% 120% at 20% 50%,
        var(--cel-aurora-1) 0%,
        var(--cel-aurora-2) 30%,
        transparent 60%
    );
    animation: aurora-drift-1 var(--cel-duration-slow) ease-in-out infinite;
    will-change: transform;
}

/* Secondary aurora blob - flows across center-right */
.celebration-aurora::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 20%;
    width: 100%;
    height: 280%;
    transform: translateY(-50%);
    background: radial-gradient(
        ellipse 70% 100% at 60% 50%,
        var(--cel-aurora-3) 0%,
        var(--cel-aurora-4) 40%,
        transparent 65%
    );
    animation: aurora-drift-2 var(--cel-duration-medium) ease-in-out infinite;
    animation-delay: -5s;
    will-change: transform;
}

@keyframes aurora-drift-1 {
    0%, 100% {
        transform: translate(0, 0) scale(1) rotate(0deg);
    }
    25% {
        transform: translate(10%, 5%) scale(1.05) rotate(2deg);
    }
    50% {
        transform: translate(5%, -5%) scale(0.98) rotate(-1deg);
    }
    75% {
        transform: translate(-5%, 3%) scale(1.02) rotate(1deg);
    }
}

@keyframes aurora-drift-2 {
    0%, 100% {
        transform: translate(0, 0) scale(1) rotate(0deg);
    }
    33% {
        transform: translate(-8%, 4%) scale(1.03) rotate(-2deg);
    }
    66% {
        transform: translate(6%, -3%) scale(0.97) rotate(1deg);
    }
}

/* ─────────────────────────────────────────────────────────────────────────────
   SPARKLE CANVAS - For floating particle effects
   ───────────────────────────────────────────────────────────────────────────── */
.celebration-sparkles-canvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1;
}

/* ─────────────────────────────────────────────────────────────────────────────
   CELEBRATION BADGE - Elegant year indicator
   Google Doodle inspired - subtle, integrated
   ───────────────────────────────────────────────────────────────────────────── */
.celebration-badge {
    position: relative;
    margin-left: 16px; /* Space after court selector */
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 5px 14px 5px 10px;
    background: linear-gradient(
        135deg,
        rgba(255, 248, 235, 0.97) 0%,
        rgba(255, 252, 245, 0.95) 100%
    );
    border: 1px solid rgba(212, 175, 55, 0.3);
    border-radius: 20px;
    font-family: var(--font-family, 'Open Sans', -apple-system, BlinkMacSystemFont, sans-serif);
    cursor: default;
    opacity: 0;
    transform: translateX(10px);
    transition: all 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
    z-index: 2;
    box-shadow:
        0 2px 8px rgba(180, 150, 80, 0.15),
        inset 0 1px 0 rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

.celebration-badge.badge-visible {
    opacity: 1;
    transform: translateX(0);
}

.celebration-badge:hover {
    background: linear-gradient(
        135deg,
        rgba(255, 245, 225, 0.95) 0%,
        rgba(255, 250, 240, 0.92) 100%
    );
    border-color: rgba(212, 175, 55, 0.35);
    box-shadow:
        0 2px 8px rgba(180, 150, 80, 0.15),
        inset 0 1px 0 rgba(255, 255, 255, 0.9);
}

/* Sparkle icon */
.celebration-badge-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
    color: #C9A227;
    animation: icon-twinkle 3s ease-in-out infinite;
}

.celebration-badge-icon svg {
    width: 14px;
    height: 14px;
    stroke-width: 2;
}

@keyframes icon-twinkle {
    0%, 100% {
        opacity: 0.8;
        transform: scale(1) rotate(0deg);
    }
    50% {
        opacity: 1;
        transform: scale(1.1) rotate(10deg);
    }
}

/* Badge text */
.celebration-badge-text {
    display: flex;
    align-items: baseline;
    gap: 4px;
}

.celebration-badge-year {
    font-size: 13px;
    font-weight: 700;
    color: #B8860B;
    letter-spacing: 0.5px;
    text-shadow: 0 1px 0 rgba(255, 255, 255, 0.8);
}

.celebration-badge-label {
    font-size: 11px;
    font-weight: 500;
    color: #A08040;
    letter-spacing: 0.3px;
    text-transform: uppercase;
}

/* Dismiss button - tiny and subtle */
.celebration-badge-dismiss {
    position: absolute;
    top: -4px;
    right: -4px;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 16px;
    height: 16px;
    padding: 0;
    border: none;
    border-radius: 50%;
    background: rgba(180, 150, 80, 0.15);
    color: #A08040;
    font-size: 10px;
    cursor: pointer;
    opacity: 0;
    transform: scale(0.8);
    transition: all 0.2s ease;
}

.celebration-badge:hover .celebration-badge-dismiss {
    opacity: 1;
    transform: scale(1);
}

.celebration-badge-dismiss:hover {
    background: rgba(180, 150, 80, 0.3);
    color: #806020;
}

.celebration-badge-dismiss svg {
    width: 10px;
    height: 10px;
    stroke-width: 2.5;
}

/* ─────────────────────────────────────────────────────────────────────────────
   SHIMMER LINE - Subtle accent at bottom of topbar
   ───────────────────────────────────────────────────────────────────────────── */
.celebration-shimmer-line {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 2px;
    background: linear-gradient(
        90deg,
        rgba(212, 175, 55, 0.1) 0%,
        rgba(255, 215, 0, 0.5) 40%,
        rgba(255, 215, 0, 0.6) 60%,
        transparent 100%
    );
    background-size: 200% 100%;
    animation: shimmer-flow 3s ease-in-out infinite;
    opacity: 0;
    transition: opacity 1s ease;
    z-index: 3;
    border-radius: 0 1px 1px 0;
}

.celebration-shimmer-line.shimmer-visible {
    opacity: 1;
}

@keyframes shimmer-flow {
    0% { background-position: -100% 0; }
    100% { background-position: 200% 0; }
}

/* ─────────────────────────────────────────────────────────────────────────────
   THEME VARIATIONS
   ───────────────────────────────────────────────────────────────────────────── */

/* Anniversary Theme - Silver/Platinum */
.celebration-theme-anniversary .celebration-aurora::before {
    background: radial-gradient(
        ellipse 60% 50% at 30% 50%,
        rgba(192, 192, 200, 0.12) 0%,
        rgba(176, 176, 184, 0.08) 30%,
        transparent 70%
    );
}

.celebration-theme-anniversary .celebration-aurora::after {
    background: radial-gradient(
        ellipse 50% 60% at 70% 50%,
        rgba(220, 220, 228, 0.10) 0%,
        rgba(200, 200, 208, 0.06) 40%,
        transparent 70%
    );
}

.celebration-theme-anniversary .celebration-badge {
    background: linear-gradient(
        135deg,
        rgba(248, 248, 252, 0.92) 0%,
        rgba(252, 252, 255, 0.88) 100%
    );
    border-color: rgba(160, 160, 170, 0.25);
}

.celebration-theme-anniversary .celebration-badge-icon {
    color: #808090;
}

.celebration-theme-anniversary .celebration-badge-year {
    color: #606070;
}

.celebration-theme-anniversary .celebration-badge-label {
    color: #808090;
}

.celebration-theme-anniversary .celebration-shimmer-line {
    background: linear-gradient(
        90deg,
        transparent 0%,
        rgba(160, 160, 170, 0.1) 20%,
        rgba(192, 192, 200, 0.35) 50%,
        rgba(160, 160, 170, 0.1) 80%,
        transparent 100%
    );
    background-size: 200% 100%;
}

/* Welcome Theme - Brand Blue */
.celebration-theme-welcome .celebration-aurora::before {
    background: radial-gradient(
        ellipse 60% 50% at 30% 50%,
        rgba(67, 142, 185, 0.10) 0%,
        rgba(67, 142, 185, 0.06) 30%,
        transparent 70%
    );
}

.celebration-theme-welcome .celebration-badge {
    background: linear-gradient(
        135deg,
        rgba(240, 248, 255, 0.92) 0%,
        rgba(248, 252, 255, 0.88) 100%
    );
    border-color: rgba(67, 142, 185, 0.2);
}

.celebration-theme-welcome .celebration-badge-icon {
    color: var(--brand-primary, #438eb9);
}

.celebration-theme-welcome .celebration-badge-year {
    color: #2a6a8a;
}

/* ─────────────────────────────────────────────────────────────────────────────
   RESPONSIVE DESIGN
   ───────────────────────────────────────────────────────────────────────────── */
@media (max-width: 768px) {
    .celebration-badge {
        padding: 3px 10px 3px 6px;
        margin-left: 8px;
    }

    .celebration-badge-icon {
        width: 16px;
        height: 16px;
    }

    .celebration-badge-icon svg {
        width: 12px;
        height: 12px;
    }

    .celebration-badge-year {
        font-size: 12px;
    }

    .celebration-badge-label {
        display: none;
    }
}

@media (max-width: 480px) {
    .celebration-badge {
        display: none;
    }
}

/* ─────────────────────────────────────────────────────────────────────────────
   ACCESSIBILITY - Reduced motion
   ───────────────────────────────────────────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
    .celebration-aurora::before,
    .celebration-aurora::after,
    .celebration-badge-icon,
    .celebration-shimmer-line {
        animation: none;
    }

    .celebration-badge {
        transform: none;
        transition: opacity 0.3s ease;
    }

    .celebration-aurora::before,
    .celebration-aurora::after {
        opacity: 0.7;
    }
}

/* ─────────────────────────────────────────────────────────────────────────────
   PRINT - Hide celebration elements
   ───────────────────────────────────────────────────────────────────────────── */
@media print {
    .celebration-aurora,
    .celebration-badge,
    .celebration-shimmer-line,
    .celebration-sparkles-canvas {
        display: none !important;
    }
}
