/* ==========================================================================
   🏆 NEXTEDU - SCORE BRAGGING CARD & VIRAL CERTIFICATE SYSTEM (v3.0)
   ========================================================================== */

:root {
    --card-holo-gradient: linear-gradient(135deg, #6366f1, #a855f7, #ec4899, #f59e0b, #10b981, #6366f1);
    --gold-glow: 0 0 25px rgba(245, 158, 11, 0.45);
    --prime-badge-bg: linear-gradient(135deg, #f59e0b 0%, #d97706 50%, #ec4899 100%);
}

/* 🌟 Outer Container */
.score-brag-wrapper {
    margin: 25px auto 15px auto;
    max-width: 540px;
    width: 100%;
    box-sizing: border-box;
    text-align: center;
    perspective: 1000px;
}

/* 💎 Holographic Certificate Card */
.score-brag-card {
    position: relative;
    background: rgba(15, 23, 42, 0.92);
    border-radius: 28px;
    padding: 28px 24px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.55), 0 0 0 1px rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    overflow: hidden;
    color: #f8fafc;
    transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.4s ease;
}

[data-theme="light"] .score-brag-card {
    background: rgba(255, 255, 255, 0.96);
    color: #0f172a;
    box-shadow: 0 20px 50px rgba(99, 102, 241, 0.15), 0 0 0 1px rgba(99, 102, 241, 0.15);
}

.score-brag-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 25px 70px rgba(99, 102, 241, 0.35);
}

/* 🌈 Holographic Border Ribbon */
.score-brag-card::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: 28px;
    padding: 2px;
    background: var(--card-holo-gradient);
    background-size: 300% 300%;
    animation: holoBorderShift 8s linear infinite;
    -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    pointer-events: none;
}

@keyframes holoBorderShift {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

/* Ambient Radial Glow inside Card */
.score-brag-glow-mesh {
    position: absolute;
    top: -50px;
    left: -50px;
    width: 200px;
    height: 200px;
    background: radial-gradient(circle, rgba(99, 102, 241, 0.25) 0%, transparent 70%);
    pointer-events: none;
    border-radius: 50%;
    filter: blur(30px);
}

.score-brag-glow-mesh.right {
    top: auto;
    bottom: -60px;
    left: auto;
    right: -60px;
    background: radial-gradient(circle, rgba(236, 72, 153, 0.25) 0%, transparent 70%);
}

/* 🏷️ Certificate Header */
.brag-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    position: relative;
    z-index: 2;
}

.brag-brand {
    display: flex;
    align-items: center;
    gap: 8px;
    font-family: 'Outfit', sans-serif;
    font-size: 0.95rem;
    font-weight: 800;
    letter-spacing: 0.5px;
    color: #e2e8f0;
}

[data-theme="light"] .brag-brand {
    color: #1e293b;
}

.brag-brand i {
    color: #f59e0b;
    font-size: 1.15rem;
    filter: drop-shadow(0 0 8px rgba(245, 158, 11, 0.6));
}

.brag-badge-verified {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    background: rgba(16, 185, 129, 0.12);
    border: 1px solid rgba(16, 185, 129, 0.35);
    color: #10b981;
    font-size: 0.72rem;
    font-weight: 800;
    padding: 4px 10px;
    border-radius: 20px;
    letter-spacing: 0.5px;
    text-transform: uppercase;
}

/* 👤 User Profile Section in Card */
.brag-user-profile {
    display: flex;
    align-items: center;
    gap: 14px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 20px;
    padding: 12px 16px;
    margin-bottom: 20px;
    text-align: left;
    position: relative;
    z-index: 2;
}

[data-theme="light"] .brag-user-profile {
    background: rgba(241, 245, 249, 0.7);
    border-color: rgba(203, 213, 225, 0.6);
}

.brag-avatar {
    width: 52px;
    height: 52px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid #6366f1;
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
    flex-shrink: 0;
}

.brag-user-details {
    flex: 1;
    min-width: 0;
}

.brag-username {
    font-size: 1.1rem;
    font-weight: 800;
    color: #f8fafc;
    margin: 0 0 3px 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    display: flex;
    align-items: center;
    gap: 6px;
}

[data-theme="light"] .brag-username {
    color: #0f172a;
}

.brag-user-subtext {
    font-size: 0.78rem;
    color: #94a3b8;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}

/* 👑 Prime 2X Active Badge */
.brag-prime-pill {
    background: var(--prime-badge-bg);
    color: #000;
    font-size: 0.65rem;
    font-weight: 900;
    padding: 2px 7px;
    border-radius: 6px;
    display: inline-flex;
    align-items: center;
    gap: 3px;
    box-shadow: 0 2px 8px rgba(245, 158, 11, 0.4);
    letter-spacing: 0.5px;
}

/* 🏆 Mastery Tier Banner */
.brag-tier-banner {
    position: relative;
    z-index: 2;
    padding: 10px 16px;
    border-radius: 14px;
    font-size: 0.88rem;
    font-weight: 800;
    margin-bottom: 20px;
    letter-spacing: 0.5px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    box-shadow: inset 0 0 20px rgba(255, 255, 255, 0.05);
}

.brag-tier-banner.tier-godlike {
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.2), rgba(236, 72, 153, 0.2));
    border: 1px solid rgba(245, 158, 11, 0.5);
    color: #f59e0b;
    box-shadow: var(--gold-glow);
}

.brag-tier-banner.tier-sharpshooter {
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.2), rgba(6, 182, 212, 0.2));
    border: 1px solid rgba(16, 185, 129, 0.5);
    color: #10b981;
}

.brag-tier-banner.tier-master {
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.2), rgba(168, 85, 247, 0.2));
    border: 1px solid rgba(99, 102, 241, 0.5);
    color: #818cf8;
}

.brag-tier-banner.tier-scholar {
    background: rgba(148, 163, 184, 0.1);
    border: 1px solid rgba(148, 163, 184, 0.3);
    color: #cbd5e1;
}

[data-theme="light"] .brag-tier-banner.tier-scholar {
    color: #475569;
}

/* 📊 Stats Matrix Grid */
.brag-stats-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    margin-bottom: 22px;
    position: relative;
    z-index: 2;
}

.brag-stat-box {
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 18px;
    padding: 14px 10px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    transition: transform 0.25s ease;
}

[data-theme="light"] .brag-stat-box {
    background: #f8fafc;
    border-color: #e2e8f0;
}

.brag-stat-box:hover {
    transform: translateY(-2px);
}

.brag-stat-label {
    font-size: 0.72rem;
    font-weight: 700;
    color: #94a3b8;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 4px;
    display: flex;
    align-items: center;
    gap: 4px;
}

.brag-stat-value {
    font-family: 'Orbitron', 'Outfit', sans-serif;
    font-size: 1.4rem;
    font-weight: 900;
    color: #f8fafc;
    line-height: 1.2;
}

[data-theme="light"] .brag-stat-value {
    color: #0f172a;
}

.brag-stat-value.val-highlight {
    background: linear-gradient(135deg, #f59e0b, #ec4899);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.brag-stat-value.val-accuracy {
    color: #10b981;
}

/* ⚡ Prime 2X XP Highlight Box */
.brag-prime-boost-bar {
    position: relative;
    z-index: 2;
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.15), rgba(236, 72, 153, 0.15));
    border: 1px solid rgba(245, 158, 11, 0.4);
    border-radius: 14px;
    padding: 10px 14px;
    margin-bottom: 22px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 0.84rem;
    font-weight: 700;
    color: #f8fafc;
}

[data-theme="light"] .brag-prime-boost-bar {
    color: #1e293b;
}

.brag-prime-boost-bar .boost-text {
    display: flex;
    align-items: center;
    gap: 8px;
}

.brag-prime-boost-bar .boost-multiplier {
    font-family: 'Orbitron', sans-serif;
    font-weight: 900;
    color: #f59e0b;
    font-size: 1rem;
    text-shadow: 0 0 10px rgba(245, 158, 11, 0.5);
}

/* 🚀 Viral Sharing Call-To-Action Buttons */
.brag-actions-container {
    position: relative;
    z-index: 2;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.brag-share-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.btn-brag-share {
    padding: 12px 16px;
    border-radius: 16px;
    border: none;
    font-family: 'Outfit', sans-serif;
    font-size: 0.9rem;
    font-weight: 800;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    cursor: pointer;
    text-decoration: none;
    transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.25s ease, filter 0.25s ease;
    color: #ffffff !important;
}

.btn-brag-share:hover {
    transform: translateY(-2px);
    filter: brightness(1.1);
}

.btn-brag-share:active {
    transform: translateY(0);
}

/* 🟢 WhatsApp Status Button */
.btn-share-whatsapp {
    background: linear-gradient(135deg, #25D366 0%, #128C7E 100%);
    box-shadow: 0 6px 20px rgba(37, 211, 102, 0.35);
}

.btn-share-whatsapp:hover {
    box-shadow: 0 10px 25px rgba(37, 211, 102, 0.5);
}

/* 🔵 Telegram Share Button */
.btn-share-telegram {
    background: linear-gradient(135deg, #0088cc 0%, #229ED9 100%);
    box-shadow: 0 6px 20px rgba(34, 158, 217, 0.35);
}

.btn-share-telegram:hover {
    box-shadow: 0 10px 25px rgba(34, 158, 217, 0.5);
}

/* 📋 Copy Brag Button */
.btn-share-copy {
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.15);
    color: #e2e8f0 !important;
    width: 100%;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

[data-theme="light"] .btn-share-copy {
    background: #f1f5f9;
    border-color: #cbd5e1;
    color: #1e293b !important;
}

.btn-share-copy:hover {
    background: rgba(255, 255, 255, 0.14);
}

/* ⚡ Floating Copied Toast */
.brag-toast {
    position: fixed;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    background: #10b981;
    color: #fff;
    font-weight: 800;
    font-size: 0.9rem;
    padding: 12px 24px;
    border-radius: 30px;
    box-shadow: 0 10px 30px rgba(16, 185, 129, 0.4);
    z-index: 999999;
    opacity: 0;
    transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    pointer-events: none;
    display: flex;
    align-items: center;
    gap: 8px;
}

.brag-toast.show {
    transform: translateX(-50%) translateY(0);
    opacity: 1;
}

/* Mobile Optimization for Score Brag Card & Submission Screens */
@media screen and (max-width: 600px) {
    #submission-overlay.quiz-container {
        padding: 12px 6px !important;
        margin: 10px auto !important;
        border: none !important;
        background: transparent !important;
        box-shadow: none !important;
        width: 100% !important;
        max-width: 100% !important;
        box-sizing: border-box !important;
    }
    .score-brag-wrapper {
        margin: 10px 0 !important;
        width: 100% !important;
        max-width: 100% !important;
        padding: 0 !important;
        box-sizing: border-box !important;
    }
    .score-brag-card {
        padding: 18px 12px !important;
        border-radius: 20px !important;
        width: 100% !important;
        box-sizing: border-box !important;
    }
    .brag-user-profile {
        padding: 10px 12px !important;
        gap: 10px !important;
        border-radius: 16px !important;
    }
    .brag-avatar {
        width: 42px !important;
        height: 42px !important;
    }
    .brag-user-name {
        font-size: 0.9rem !important;
    }
    .brag-user-handle {
        font-size: 0.72rem !important;
    }
    .brag-stats-grid {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 8px !important;
        margin-bottom: 16px !important;
    }
    .brag-stat-box {
        padding: 10px 6px !important;
        border-radius: 14px !important;
    }
    .brag-stat-label {
        font-size: 0.65rem !important;
        letter-spacing: 0.2px !important;
    }
    .brag-stat-value {
        font-size: 1.15rem !important;
    }
    .brag-tier-banner {
        font-size: 0.8rem !important;
        padding: 8px 12px !important;
        margin-bottom: 14px !important;
        border-radius: 12px !important;
    }
    .brag-prime-boost-bar {
        padding: 8px 10px !important;
        font-size: 0.76rem !important;
        margin-bottom: 16px !important;
        border-radius: 12px !important;
    }
    .brag-share-row {
        grid-template-columns: 1fr 1fr !important;
        gap: 8px !important;
    }
    .btn-brag-share {
        padding: 10px 8px !important;
        font-size: 0.78rem !important;
        border-radius: 12px !important;
        white-space: nowrap !important;
        justify-content: center !important;
    }
    .btn-share-copy {
        padding: 10px 8px !important;
        font-size: 0.78rem !important;
        border-radius: 12px !important;
    }
}

@media screen and (max-width: 380px) {
    .brag-share-row {
        grid-template-columns: 1fr !important;
        gap: 8px !important;
    }
    .btn-brag-share {
        width: 100% !important;
    }
    .score-brag-card {
        padding: 14px 10px !important;
    }
}
