/* ═══════════════════════════════════════════════════════
   BADGE CERTIFICATE — Modal & Confetti System
   ═══════════════════════════════════════════════════════ */

/* ─── MODAL OVERLAY ─── */
.cert-overlay {
    position: fixed;
    inset: 0;
    z-index: 99999;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(5, 5, 20, 0.85);
    backdrop-filter: blur(12px);
    opacity: 0;
    visibility: hidden;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.cert-overlay.active {
    opacity: 1;
    visibility: visible;
}

/* ─── CERTIFICATE CARD ─── */
.cert-card {
    position: relative;
    width: 520px;
    max-width: 92vw;
    background: linear-gradient(145deg, #0f1428 0%, #1a1040 40%, #0d0f22 100%);
    border-radius: 24px;
    padding: 3rem 2.5rem;
    text-align: center;
    border: 2px solid rgba(212, 168, 85, 0.25);
    box-shadow:
        0 0 60px rgba(212, 168, 85, 0.15),
        0 25px 80px rgba(0, 0, 0, 0.5),
        inset 0 1px 0 rgba(255, 255, 255, 0.05);
    transform: scale(0.7) translateY(30px);
    transition: transform 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
    overflow: hidden;
}

.cert-overlay.active .cert-card {
    transform: scale(1) translateY(0);
}

/* Corner ornaments */
.cert-card::before,
.cert-card::after {
    content: '✦';
    position: absolute;
    font-size: 1.2rem;
    color: rgba(212, 168, 85, 0.3);
}

.cert-card::before {
    top: 1rem;
    left: 1.2rem;
}

.cert-card::after {
    top: 1rem;
    right: 1.2rem;
}

.cert-corner-bl,
.cert-corner-br {
    position: absolute;
    font-size: 1.2rem;
    color: rgba(212, 168, 85, 0.3);
    bottom: 1rem;
}

.cert-corner-bl {
    left: 1.2rem;
}

.cert-corner-br {
    right: 1.2rem;
}

/* Shimmer sweep */
.cert-shimmer {
    position: absolute;
    top: 0;
    left: -100%;
    width: 60%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.04), transparent);
    transform: skewX(-15deg);
    animation: certSweep 4s ease-in-out infinite;
    pointer-events: none;
}

@keyframes certSweep {

    0%,
    100% {
        left: -100%;
    }

    50% {
        left: 150%;
    }
}

/* ─── CLOSE BUTTON ─── */
.cert-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    width: 36px;
    height: 36px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.05);
    color: rgba(255, 255, 255, 0.5);
    font-size: 1rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s;
    z-index: 2;
}

.cert-close:hover {
    background: rgba(255, 255, 255, 0.1);
    color: white;
    border-color: rgba(255, 255, 255, 0.25);
}

/* ─── BADGE ICON ─── */
.cert-badge-icon {
    width: 90px;
    height: 90px;
    margin: 0 auto 1.5rem;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.8rem;
    position: relative;
    animation: certBadgePulse 3s ease-in-out infinite;
}

@keyframes certBadgePulse {

    0%,
    100% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.06);
    }
}

/* Ring glow around icon */
.cert-badge-icon::after {
    content: '';
    position: absolute;
    inset: -6px;
    border-radius: 50%;
    border: 2px solid;
    border-color: inherit;
    opacity: 0.3;
    animation: certRingPulse 2.5s ease-in-out infinite;
}

@keyframes certRingPulse {

    0%,
    100% {
        opacity: 0.2;
        transform: scale(1);
    }

    50% {
        opacity: 0.5;
        transform: scale(1.08);
    }
}

/* ─── TYPOGRAPHY ─── */
.cert-label {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 0.65rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.2em;
    color: rgba(255, 255, 255, 0.35);
    margin-bottom: 0.5rem;
}

.cert-title {
    font-family: 'Cormorant Garamond', serif;
    font-size: 1.8rem;
    font-weight: 700;
    margin-bottom: 0.4rem;
    background: linear-gradient(135deg, var(--gold, #d4a855), #f0d68a);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.cert-subtitle {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.5);
    margin-bottom: 2rem;
    line-height: 1.5;
}

/* ─── DIVIDER ─── */
.cert-divider {
    width: 80%;
    height: 1px;
    margin: 0 auto 1.5rem;
    background: linear-gradient(90deg, transparent, rgba(212, 168, 85, 0.25), transparent);
}

/* ─── STATS ─── */
.cert-stats {
    display: flex;
    justify-content: center;
    gap: 2rem;
    margin-bottom: 1.5rem;
}

.cert-stat {
    text-align: center;
}

.cert-stat-value {
    font-family: 'Cormorant Garamond', serif;
    font-size: 1.5rem;
    font-weight: 700;
    display: block;
    margin-bottom: 0.15rem;
}

.cert-stat-label {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 0.65rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: rgba(255, 255, 255, 0.4);
}

/* ─── DATE & SIGNATURE ─── */
.cert-date {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.35);
    margin-bottom: 1rem;
}

.cert-signature {
    font-family: 'Cormorant Garamond', serif;
    font-size: 1.1rem;
    font-style: italic;
    color: rgba(212, 168, 85, 0.6);
    margin-bottom: 0.25rem;
}

.cert-signature-title {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 0.65rem;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: rgba(255, 255, 255, 0.25);
}

/* ─── ACTION BUTTONS ─── */
.cert-actions {
    display: flex;
    gap: 0.75rem;
    justify-content: center;
    margin-top: 1.5rem;
}

.cert-btn {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 0.78rem;
    font-weight: 600;
    padding: 0.6rem 1.25rem;
    border-radius: 50px;
    border: none;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    transition: all 0.3s;
}

.cert-btn-primary {
    background: linear-gradient(135deg, var(--gold, #d4a855), #c4982e);
    color: #0a0a1a;
}

.cert-btn-primary:hover {
    box-shadow: 0 4px 20px rgba(212, 168, 85, 0.4);
    transform: translateY(-2px);
}

.cert-btn-secondary {
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.12);
    color: rgba(255, 255, 255, 0.6);
}

.cert-btn-secondary:hover {
    background: rgba(255, 255, 255, 0.1);
    color: white;
}

/* ─── ZONE THEMES ─── */

/* Zone 1: Cosmic Alphabet — Purple-Blue */
.cert-card[data-zone="1"] {
    border-color: rgba(139, 92, 246, 0.3);
    box-shadow: 0 0 60px rgba(139, 92, 246, 0.12), 0 25px 80px rgba(0, 0, 0, 0.5);
}

.cert-card[data-zone="1"] .cert-badge-icon {
    background: linear-gradient(135deg, rgba(139, 92, 246, 0.2), rgba(99, 102, 241, 0.15));
    border: 2px solid rgba(139, 92, 246, 0.4);
    color: #a78bfa;
}

.cert-card[data-zone="1"] .cert-stat-value {
    color: #a78bfa;
}

.cert-card[data-zone="1"] .cert-title {
    background: linear-gradient(135deg, #a78bfa, #818cf8);
    -webkit-background-clip: text;
    background-clip: text;
}

/* Zone 2: Planetary Forces — Orange-Red */
.cert-card[data-zone="2"] {
    border-color: rgba(251, 146, 60, 0.3);
    box-shadow: 0 0 60px rgba(251, 146, 60, 0.12), 0 25px 80px rgba(0, 0, 0, 0.5);
}

.cert-card[data-zone="2"] .cert-badge-icon {
    background: linear-gradient(135deg, rgba(251, 146, 60, 0.2), rgba(239, 68, 68, 0.12));
    border: 2px solid rgba(251, 146, 60, 0.4);
    color: #fb923c;
}

.cert-card[data-zone="2"] .cert-stat-value {
    color: #fb923c;
}

.cert-card[data-zone="2"] .cert-title {
    background: linear-gradient(135deg, #fb923c, #f97316);
    -webkit-background-clip: text;
    background-clip: text;
}

/* Zone 3: House System — Gold-Green (Final) */
.cert-card[data-zone="3"] {
    border-color: rgba(212, 168, 85, 0.4);
    box-shadow: 0 0 80px rgba(212, 168, 85, 0.2), 0 0 40px rgba(34, 197, 94, 0.08), 0 25px 80px rgba(0, 0, 0, 0.5);
}

.cert-card[data-zone="3"] .cert-badge-icon {
    background: linear-gradient(135deg, rgba(212, 168, 85, 0.25), rgba(34, 197, 94, 0.12));
    border: 2px solid rgba(212, 168, 85, 0.5);
    color: #d4a855;
}

.cert-card[data-zone="3"] .cert-stat-value {
    color: #22c55e;
}

.cert-card[data-zone="3"] .cert-title {
    background: linear-gradient(135deg, #d4a855, #22c55e);
    -webkit-background-clip: text;
    background-clip: text;
}

/* ─── CONFETTI ─── */
.confetti-canvas {
    position: fixed;
    inset: 0;
    z-index: 100000;
    pointer-events: none;
}

/* ─── RESPONSIVE ─── */
@media (max-width: 768px) {
    .cert-card {
        padding: 2rem 1.5rem;
        border-radius: 20px;
    }

    .cert-badge-icon {
        width: 72px;
        height: 72px;
        font-size: 2.2rem;
    }

    .cert-title {
        font-size: 1.4rem;
    }

    .cert-stats {
        gap: 1.25rem;
    }

    .cert-stat-value {
        font-size: 1.2rem;
    }

    .cert-actions {
        flex-direction: column;
    }
}