/* Google Fonts Integration */
@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600;700;800&display=swap');

:root {
    --primary-gradient: linear-gradient(135deg, #ffb3c6 0%, #f472b6 100%);
    --secondary-gradient: linear-gradient(135deg, #ffd1dc 0%, #fbcfe8 100%);
    --accent-gradient: linear-gradient(135deg, #fbcfe8 0%, #db2777 100%);
    --glass-bg: rgba(255, 255, 255, 0.85);
    --glass-border: rgba(255, 179, 198, 0.3);
    --dark-bg: #23181a;
    --dark-card: rgba(45, 30, 33, 0.85);
    --dark-border: rgba(255, 179, 198, 0.15);

    /* Bootstrap variables overrides */
    --bs-primary: #ff6b8b;
    --bs-primary-rgb: 255, 107, 139;
    --bs-secondary: #f472b6;
    --bs-secondary-rgb: 244, 114, 182;
    --bs-info: #fbcfe8;
    --bs-info-rgb: 251, 207, 232;
}

body {
    font-family: 'Outfit', sans-serif;
    background-color: #fff5f7; /* Very soft warm baby pink background */
    color: #2e1f22; /* Warm dark grey for high readability */
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Glassmorphism Styles */
.glass-card {
    background: var(--glass-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--glass-border);
    border-radius: 16px;
    box-shadow: 0 8px 32px 0 rgba(244, 114, 182, 0.08);
    transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.glass-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 40px 0 rgba(244, 114, 182, 0.12);
}

/* Custom Gradients & Hero */
.bg-gradient-primary {
    background: var(--primary-gradient);
}
.bg-gradient-secondary {
    background: var(--secondary-gradient);
}
.text-gradient {
    background: var(--primary-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

/* Bootstrap Classes Overrides to Blend with Baby Pink */
.btn-primary {
    background-color: #ff6b8b !important;
    border-color: #ff6b8b !important;
    color: #ffffff !important;
    box-shadow: 0 4px 14px rgba(255, 107, 139, 0.3) !important;
}
.btn-primary:hover, .btn-primary:focus, .btn-primary:active {
    background-color: #e25472 !important;
    border-color: #e25472 !important;
    color: #ffffff !important;
}

.btn-outline-primary {
    color: #ff6b8b !important;
    border-color: #ff6b8b !important;
}
.btn-outline-primary:hover, .btn-outline-primary:focus, .btn-outline-primary:active {
    background-color: #ff6b8b !important;
    border-color: #ff6b8b !important;
    color: #ffffff !important;
}

.btn-info {
    background-color: #ffd1dc !important;
    border-color: #ffd1dc !important;
    color: #9d174d !important; /* Premium dark pink for contrast */
    box-shadow: 0 4px 14px rgba(255, 209, 220, 0.4) !important;
}
.btn-info:hover, .btn-info:focus, .btn-info:active {
    background-color: #ffb3c6 !important;
    border-color: #ffb3c6 !important;
    color: #9d174d !important;
}

.btn-outline-info {
    color: #ff6b8b !important;
    border-color: #ff6b8b !important;
}
.btn-outline-info:hover, .btn-outline-info:focus, .btn-outline-info:active {
    background-color: #ff6b8b !important;
    border-color: #ff6b8b !important;
    color: #ffffff !important;
}

.text-info {
    color: #f472b6 !important; /* Soft dark pink */
}
.text-primary {
    color: #ff6b8b !important;
}
.text-secondary {
    color: #fda4af !important;
}
.bg-primary {
    background-color: #ff6b8b !important;
}
.bg-info {
    background-color: #fbcfe8 !important;
}
.bg-primary-subtle {
    background-color: #ffe4e6 !important;
}
.text-primary-emphasis {
    color: #be185d !important;
}

/* Navigation Style */
.navbar-custom {
    background: rgba(35, 24, 26, 0.96) !important; /* Warm deep dark pink-black */
    backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(255, 179, 198, 0.2);
}
.navbar-custom .nav-link {
    color: #fbcfe8 !important;
    font-weight: 500;
    transition: color 0.2s ease;
}
.navbar-custom .nav-link:hover, 
.navbar-custom .nav-link.active {
    color: #ffb3c6 !important;
}

/* Dashboard Badges */
.badge-item {
    position: relative;
    border-radius: 12px;
    padding: 1.5rem;
    text-align: center;
    background: white;
    border: 1px solid #e2e8f0;
    transition: all 0.3s ease;
}
.badge-item.locked {
    opacity: 0.6;
    filter: grayscale(1);
}
.badge-item:hover {
    transform: scale(1.05);
    box-shadow: 0 10px 25px rgba(99, 102, 241, 0.15);
}
.badge-icon {
    font-size: 2.5rem;
    margin-bottom: 1rem;
    background: var(--primary-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

/* Leaderboard Rankings */
.leaderboard-row {
    transition: background-color 0.2s ease;
}
.leaderboard-row:hover {
    background-color: #f1f5f9;
}
.rank-badge {
    width: 32px;
    height: 32px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    font-weight: bold;
}
.rank-1 { background-color: #fef08a; color: #854d0e; }
.rank-2 { background-color: #e2e8f0; color: #475569; }
.rank-3 { background-color: #fed7aa; color: #9a3412; }

/* Discussion & Comments Forum */
.comment-bubble {
    background: #f1f5f9;
    border-radius: 12px;
    padding: 1rem;
    margin-bottom: 1rem;
    position: relative;
}
.comment-reply {
    margin-left: 2.5rem;
    border-left: 2px solid #cbd5e1;
    padding-left: 1.5rem;
}

/* Messaging System */
.chat-container {
    height: 480px;
    overflow-y: auto;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 1.5rem;
}
.msg-bubble {
    max-width: 70%;
    padding: 0.75rem 1rem;
    border-radius: 16px;
    margin-bottom: 1rem;
}
.msg-sent {
    background: #6366f1;
    color: white;
    margin-left: auto;
    border-bottom-right-radius: 4px;
}
.msg-received {
    background: #e2e8f0;
    color: #1e293b;
    margin-right: auto;
    border-bottom-left-radius: 4px;
}

/* Certificate Layout (Optimized for Screen & Print) */
.certificate-container {
    background: #fff;
    border: 16px double #ff6b8b;
    padding: 3rem;
    position: relative;
    font-family: 'Outfit', sans-serif;
    text-align: center;
    box-shadow: 0 4px 20px rgba(0,0,0,0.08);
}
.certificate-seal {
    width: 120px;
    margin: 2rem auto;
}
.certificate-qr {
    position: absolute;
    bottom: 2rem;
    right: 2rem;
    text-align: center;
}

/* Print Certificate CSS overrides */
@media print {
    body * {
        visibility: hidden;
    }
    .certificate-print-area, .certificate-print-area * {
        visibility: visible;
    }
    .certificate-print-area {
        position: absolute;
        left: 0;
        top: 0;
        width: 100%;
        border: none;
        padding: 0;
        margin: 0;
        box-shadow: none;
    }
}

/* Progress bar transitions */
.progress-bar {
    transition: width 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Video lessons custom layout */
.video-wrapper {
    position: relative;
    padding-bottom: 56.25%; /* 16:9 ratio */
    height: 0;
    overflow: hidden;
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}
.video-wrapper iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: 0;
}

/* Sidebar Layout for Dashboard Area */
#dashboard-wrapper {
    display: flex;
    width: 100%;
    align-items: stretch;
    min-height: 100vh;
}
#sidebar-wrapper {
    min-width: 250px;
    max-width: 250px;
    background-color: #23181a; /* Warm deep dark pink-black */
    color: #fff;
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    z-index: 1000;
}
#sidebar-wrapper .sidebar-brand {
    padding: 1.5rem 1.25rem;
    border-bottom: 1px solid rgba(255, 179, 198, 0.15);
}
#sidebar-wrapper .list-group-item {
    padding: 0.9rem 1.5rem;
    color: #fbcfe8 !important;
    border: none;
    background: transparent;
    transition: all 0.2s ease;
    font-weight: 500;
    display: flex;
    align-items: center;
    text-decoration: none;
}
#sidebar-wrapper .list-group-item i {
    width: 24px;
    font-size: 1.1rem;
}
#sidebar-wrapper .list-group-item:hover,
#sidebar-wrapper .list-group-item.active {
    color: #ffffff !important;
    background: rgba(255, 107, 139, 0.15) !important;
    border-left: 4px solid #ff6b8b;
    padding-left: 1.25rem;
}
#page-content-wrapper {
    width: 100%;
    overflow-x: hidden;
    background-color: #fff5f7;
    display: flex;
    flex-direction: column;
}
.dashboard-topbar {
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border-bottom: 1px solid rgba(255, 179, 198, 0.2);
    padding: 0.9rem 2rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}
.sidebar-footer {
    margin-top: auto;
    padding: 1.25rem;
    border-top: 1px solid rgba(255, 179, 198, 0.15);
    background: rgba(0, 0, 0, 0.15);
}

@media (max-width: 768px) {
    .dashboard-topbar {
        padding: 0.9rem 1rem;
    }
    #sidebar-wrapper {
        position: fixed;
        left: -250px;
        top: 0;
        bottom: 0;
        height: 100vh;
        min-width: 250px;
        max-width: 250px;
        z-index: 1050;
        transition: left 0.3s ease-in-out;
        box-shadow: 4px 0 15px rgba(0, 0, 0, 0.2);
    }
    
    #sidebar-wrapper.show {
        left: 0;
    }
    
    /* Overlay background when sidebar is active */
    .sidebar-overlay {
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background-color: rgba(35, 24, 26, 0.5); /* Matching Econexus dark tone */
        backdrop-filter: blur(4px);
        -webkit-backdrop-filter: blur(4px);
        z-index: 1040;
        opacity: 0;
        visibility: hidden;
        transition: opacity 0.3s ease-in-out, visibility 0.3s ease-in-out;
    }
    
    .sidebar-overlay.show {
        opacity: 1;
        visibility: visible;
    }

    #sidebar-wrapper .list-group-item {
        padding: 0.75rem 1.5rem;
        font-size: 0.95rem;
    }

    #sidebar-wrapper .sidebar-brand {
        padding: 1rem 1.25rem;
    }

    .sidebar-footer {
        display: none;
    }
}

/* Brand Logo Styling */
.brand-logo-img {
    height: 30px;
    width: 30px;
    object-fit: cover;
    object-position: center 15%;
    border-radius: 50%;
    border: 1.5px solid rgba(255, 107, 139, 0.4);
    background-color: #fff5f7;
    transition: transform 0.2s ease-in-out;
}
.brand-logo-img:hover {
    transform: scale(1.1);
}

.brand-logo-img-lg {
    height: 38px;
    width: 38px;
    object-fit: cover;
    object-position: center 15%;
    border-radius: 50%;
    border: 2px solid rgba(255, 107, 139, 0.4);
    background-color: #fff5f7;
    transition: transform 0.2s ease-in-out;
}
.brand-logo-img-lg:hover {
    transform: scale(1.1);
}

/* ========== ENHANCED QUIZ DESIGN ========== */

/* Quiz Start Container */
.quiz-start-container {
    position: relative;
    overflow: hidden;
}

.quiz-start-decoration {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 0;
}

.floating-icon {
    position: absolute;
    font-size: 3rem;
    opacity: 0.1;
    animation: floatAnswer 6s ease-in-out infinite;
}

.floating-icon.icon-1 {
    top: 10%;
    left: 10%;
    animation-delay: 0s;
}

.floating-icon.icon-2 {
    top: 20%;
    right: 15%;
    animation-delay: 1s;
}

.floating-icon.icon-3 {
    bottom: 15%;
    left: 15%;
    animation-delay: 2s;
}

.floating-icon.icon-4 {
    bottom: 10%;
    right: 10%;
    animation-delay: 3s;
}

/* Quiz Welcome Card */
.quiz-welcome-card {
    position: relative;
    z-index: 1;
    border-radius: 20px !important;
    background: linear-gradient(135deg, #ffffff 0%, #fef5f7 100%) !important;
}

.quiz-icon-large {
    font-size: 4rem;
    animation: bounceAnswer 2s ease-in-out infinite;
}

.quiz-stats-grid {
    gap: 1rem;
}

.stat-card {
    padding: 1.5rem;
    border-radius: 12px;
    background: #f8fafc;
    border: 2px solid #e5e7eb;
    transition: all 0.3s ease;
}

.stat-card:hover {
    transform: translateY(-5px);
    border-color: #ff6b8b;
    box-shadow: 0 8px 20px rgba(255, 107, 139, 0.15);
}

.stat-number {
    font-size: 2rem;
    margin-bottom: 0.5rem;
}

.stat-badge {
    display: inline-block;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: linear-gradient(135deg, #ff6b8b 0%, #f472b6 100%);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    animation: bounceScore 1s ease-in-out infinite;
}

/* Difficulty Bars */
.difficulty-bars {
    display: flex;
    gap: 0.5rem;
    justify-content: center;
}

.difficulty-bar {
    display: inline-block;
    width: 30px;
    height: 6px;
    border-radius: 3px;
    background: #e5e7eb;
    transition: all 0.3s ease;
}

.difficulty-bar.active {
    background: linear-gradient(90deg, #ff6b8b 0%, #f472b6 100%);
    width: 40px;
}

/* Quiz Results Container */
.quiz-results-container {
    animation: questionSlideIn 0.6s ease-out;
}

.results-passed {
    background: linear-gradient(135deg, #dcfce7 0%, #bbf7d0 100%) !important;
    border: 2px solid #22c55e !important;
}

.results-failed {
    background: linear-gradient(135deg, #fee2e2 0%, #fecaca 100%) !important;
    border: 2px solid #ef4444 !important;
}

.results-animation {
    animation: bounceAnswer 0.8s ease-out;
}

.results-icon {
    animation: correctGlow 0.8s ease-out, bounceScore 0.8s ease-out;
}

/* Score Circle */
.score-circle {
    width: 180px;
    height: 180px;
    margin: 0 auto;
    border-radius: 50%;
    background: linear-gradient(135deg, #ff6b8b 0%, #f472b6 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 10px 30px rgba(255, 107, 139, 0.3);
    animation: pulseFloat 1.5s ease-in-out infinite;
}

.score-inner {
    text-align: center;
    color: white;
}

.score-value {
    font-size: 3.5rem;
    font-weight: bold;
    display: block;
}

.score-text {
    font-size: 0.9rem;
    opacity: 0.9;
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* Result Stats */
.result-stat {
    padding: 1.5rem;
    margin-bottom: 1rem;
}

.stat-icon {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1rem;
    font-size: 1.5rem;
    color: white;
}

.stat-icon.correct-stat {
    background: linear-gradient(135deg, #22c55e 0%, #16a34a 100%);
}

.stat-icon.points-stat {
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
}

.stat-icon.passing-stat {
    background: linear-gradient(135deg, #3b82f6 0%, #1d4ed8 100%);
}

.stat-count {
    font-size: 1.8rem;
    font-weight: bold;
    color: #1f2937;
    margin-bottom: 0.5rem;
}

.stat-label {
    font-size: 0.9rem;
    color: #6b7280;
}

/* Result Banner */
.result-banner {
    padding: 1.5rem;
    border-radius: 12px;
    font-size: 1.1rem;
    margin: 2rem 0;
    animation: slideInAnswer 0.6s ease-out;
}

.pass-banner {
    background: linear-gradient(135deg, #dcfce7 0%, #bbf7d0 100%);
    color: #065f46;
    border: 2px solid #22c55e;
}

.fail-banner {
    background: linear-gradient(135deg, #fee2e2 0%, #fecaca 100%);
    color: #7f1d1d;
    border: 2px solid #ef4444;
}

/* Badge Earned */
.badge-earned {
    background: linear-gradient(135deg, #fef3c7 0%, #fcd34d 100%);
    border: 2px solid #f59e0b;
    border-radius: 15px;
    padding: 2rem;
    text-align: center;
    animation: bounceScore 0.8s ease-out;
}

.badge-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
    animation: spin 2s linear infinite;
}

.badge-text {
    font-weight: bold;
    font-size: 1.1rem;
    color: #92400e;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Question Breakdown */
.question-breakdown {
    border-left: 5px solid #e5e7eb;
    transition: all 0.3s ease;
}

.question-breakdown.correct-answer {
    border-left-color: #22c55e;
    background: linear-gradient(135deg, #f0fdf4 0%, #dcfce7 100%);
}

.question-breakdown.incorrect-answer {
    border-left-color: #ef4444;
    background: linear-gradient(135deg, #fef2f2 0%, #fee2e2 100%);
}

.question-number {
    display: inline-block;
    background: linear-gradient(135deg, #ff6b8b 0%, #f472b6 100%);
    color: white;
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: bold;
    margin-right: 0.75rem;
}

.answers-list {
    margin-top: 1rem;
}

.answer-item {
    padding: 0.75rem 1rem;
    margin-bottom: 0.5rem;
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    transition: all 0.3s ease;
}

.answer-item:hover {
    border-color: #ff6b8b;
    box-shadow: 0 4px 12px rgba(255, 107, 139, 0.1);
}

.answer-item.answer-correct {
    background: #f0fdf4;
    border-color: #22c55e;
    font-weight: 500;
    color: #065f46;
}

.answer-item.answer-wrong {
    background: #fef2f2;
    border-color: #ef4444;
    text-decoration: line-through;
    color: #7f1d1d;
    opacity: 0.7;
}

/* Grid-specific answer option styles */
.answer-grid .quiz-answer-option span {
    word-wrap: break-word;
    word-break: break-word;
    overflow-wrap: break-word;
}

.answer-letter {
    display: inline-block;
    background: #f3f4f6;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    flex-shrink: 0;
}

.answer-correct .answer-letter {
    background: linear-gradient(135deg, #22c55e 0%, #16a34a 100%);
    color: white;
}

.answer-wrong .answer-letter {
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
    color: white;
}

.answer-text {
    flex: 1;
}

/* Result Badge */
.result-badge {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    flex-shrink: 0;
}

.result-badge.correct-badge {
    background: linear-gradient(135deg, #dcfce7 0%, #bbf7d0 100%);
    color: #22c55e;
    animation: bounceScore 0.6s ease-out;
}

.result-badge.wrong-badge {
    background: linear-gradient(135deg, #fee2e2 0%, #fecaca 100%);
    color: #ef4444;
    animation: wrongShake 0.5s ease-out;
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .quiz-stats-grid {
        flex-direction: column;
    }
    
    .stat-card {
        flex: 1;
    }
    
    .score-circle {
        width: 140px;
        height: 140px;
    }
    
    .score-value {
        font-size: 2.5rem;
    }
    
    .floating-icon {
        font-size: 2rem;
    }
    
    .quiz-icon-large {
        font-size: 3rem;
    }
    
    .result-stat {
        padding: 1rem;
        margin-bottom: 0.5rem;
    }
}

/* ====== GAMIFIED QUIZ ANIMATIONS ====== */

/* Floating Answer Animation */
@keyframes floatAnswer {
    0%, 100% {
        transform: translateY(0) translateX(0);
    }
    25% {
        transform: translateY(-15px) translateX(10px);
    }
    50% {
        transform: translateY(0) translateX(-10px);
    }
    75% {
        transform: translateY(-10px) translateX(5px);
    }
}

/* Drifting Answer Animation */
@keyframes driftAnswer {
    0% {
        transform: translateX(0) rotateZ(0deg);
    }
    25% {
        transform: translateX(-20px) rotateZ(-2deg);
    }
    50% {
        transform: translateX(0) rotateZ(0deg);
    }
    75% {
        transform: translateX(20px) rotateZ(2deg);
    }
    100% {
        transform: translateX(0) rotateZ(0deg);
    }
}

/* Bouncing Answer Animation */
@keyframes bounceAnswer {
    0%, 100% {
        transform: translateY(0) scale(1);
    }
    25% {
        transform: translateY(-20px) scale(1.05);
    }
    50% {
        transform: translateY(0) scale(1);
    }
    75% {
        transform: translateY(-10px) scale(1.03);
    }
}

/* Spinning Entry Animation */
@keyframes spinEntry {
    from {
        opacity: 0;
        transform: rotateX(90deg) translateX(50px);
    }
    to {
        opacity: 1;
        transform: rotateX(0) translateX(0);
    }
}

/* Wiggle Animation */
@keyframes wiggleAnswer {
    0%, 100% {
        transform: skewX(0deg) translateY(0);
    }
    10% {
        transform: skewX(2deg) translateY(-3px);
    }
    20% {
        transform: skewX(-2deg) translateY(3px);
    }
    30% {
        transform: skewX(2deg) translateY(-3px);
    }
    40% {
        transform: skewX(-2deg) translateY(3px);
    }
    50% {
        transform: skewX(0deg) translateY(0);
    }
    60% {
        transform: skewX(2deg) translateY(-3px);
    }
    70% {
        transform: skewX(-2deg) translateY(3px);
    }
    80% {
        transform: skewX(2deg) translateY(-3px);
    }
    90% {
        transform: skewX(-2deg) translateY(3px);
    }
}

/* Rotating Orbit Animation */
@keyframes orbitAnswer {
    0% {
        transform: rotate(0deg) translateX(15px) rotate(0deg);
    }
    100% {
        transform: rotate(360deg) translateX(15px) rotate(-360deg);
    }
}

/* Pulse Float Animation */
@keyframes pulseFloat {
    0%, 100% {
        transform: translateY(-5px) scale(1);
        filter: drop-shadow(0 5px 10px rgba(255, 107, 139, 0.3));
    }
    50% {
        transform: translateY(-15px) scale(1.02);
        filter: drop-shadow(0 8px 20px rgba(255, 107, 139, 0.5));
    }
}

/* Zoom In Move Animation */
@keyframes zoomInMove {
    from {
        opacity: 0;
        transform: scale(0.5) translateX(-30px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateX(0);
    }
}

/* Answer Hover Shake */
@keyframes hoverShake {
    0%, 100% {
        transform: translateX(0) translateY(0);
    }
    10%, 30%, 50%, 70%, 90% {
        transform: translateX(-5px) translateY(-3px);
    }
    20%, 40%, 60%, 80% {
        transform: translateX(5px) translateY(3px);
    }
}

/* Cursor Chase Animation */
@keyframes cursorChase {
    0% {
        transform: translateX(0) translateY(0) scale(1);
    }
    50% {
        transform: translateX(-15px) translateY(-10px) scale(1.08);
    }
    100% {
        transform: translateX(0) translateY(0) scale(1);
    }
}

/* Rainbow Wave Animation */
@keyframes rainbowWave {
    0% {
        background-position: 0% 50%;
    }
    50% {
        background-position: 100% 50%;
    }
    100% {
        background-position: 0% 50%;
    }
}

/* Quiz Container Styling */
.quiz-container {
    position: relative;
}

.quiz-question-wrapper {
    animation: questionSlideIn 0.5s ease-out;
}

/* Gaming Answer Options */
.quiz-answer-option {
    position: relative;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    border: 2px solid #e5e7eb;
    border-radius: 12px;
    padding: 1rem;
    margin-bottom: 0.75rem;
    background: linear-gradient(135deg, #ffffff 0%, #fef5f7 100%);
    overflow: hidden;
    animation: zoomInMove 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.quiz-answer-option:nth-child(1) {
    animation: zoomInMove 0.6s cubic-bezier(0.34, 1.56, 0.64, 1), floatAnswer 3s ease-in-out infinite !important;
    animation-delay: 0s, 0.6s;
}

.quiz-answer-option:nth-child(2) {
    animation: zoomInMove 0.6s cubic-bezier(0.34, 1.56, 0.64, 1), bounceAnswer 3.5s ease-in-out infinite !important;
    animation-delay: 0.1s, 0.6s;
}

.quiz-answer-option:nth-child(3) {
    animation: zoomInMove 0.6s cubic-bezier(0.34, 1.56, 0.64, 1), driftAnswer 4s ease-in-out infinite !important;
    animation-delay: 0.2s, 0.6s;
}

.quiz-answer-option:nth-child(4) {
    animation: zoomInMove 0.6s cubic-bezier(0.34, 1.56, 0.64, 1), wiggleAnswer 2.5s ease-in-out infinite !important;
    animation-delay: 0.3s, 0.6s;
}

.quiz-answer-option::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.5), transparent);
    transform: translateX(-100%);
    transition: transform 0.6s ease;
    border-radius: 12px;
}

.quiz-answer-option:hover::before {
    transform: translateX(100%);
}

.quiz-answer-option:hover {
    border-color: #ff6b8b;
    box-shadow: 0 8px 20px rgba(255, 107, 139, 0.2);
    transform: scale(1.02);
    animation-play-state: paused;
}

.quiz-answer-option:hover::after {
    content: '✨';
    position: absolute;
    right: 20px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 1.5rem;
    animation: scorePopUp 0.6s ease-out forwards;
    pointer-events: none;
}

.quiz-answer-option.selected {
    border-color: #ff6b8b;
    background: linear-gradient(135deg, #ffe4e6 0%, #fbcfe8 100%);
    box-shadow: 0 0 20px rgba(255, 107, 139, 0.3);
    animation: pulse 0.5s ease-out !important;
}

.quiz-answer-option.selected input[type="radio"] {
    animation: cursorChase 0.8s ease-out;
}

.quiz-answer-option.correct {
    animation: bounceAnswer 0.6s ease-out, correctGlow 0.8s ease-out !important;
    background: linear-gradient(135deg, #dcfce7 0%, #bbf7d0 100%);
    border-color: #22c55e;
    box-shadow: 0 0 30px rgba(34, 197, 94, 0.4);
}

.quiz-answer-option.correct::after {
    content: '✓';
    position: absolute;
    right: 20px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 2rem;
    color: #22c55e;
    font-weight: bold;
    animation: scorePopUp 0.8s ease-out;
}

.quiz-answer-option.incorrect {
    animation: wrongShake 0.5s ease-out !important;
    background: linear-gradient(135deg, #fee2e2 0%, #fecaca 100%);
    border-color: #ef4444;
    box-shadow: 0 0 20px rgba(239, 68, 68, 0.3);
}

.quiz-answer-option.incorrect::after {
    content: '✗';
    position: absolute;
    right: 20px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 2rem;
    color: #ef4444;
    font-weight: bold;
    animation: scorePopUp 0.8s ease-out;
}

@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); }
}

/* Animation variations for different answer positions */
.quiz-answer-option.animated-float:hover {
    animation: floatAnswer 0.8s ease-in-out infinite !important;
}

.quiz-answer-option.animated-bounce:hover {
    animation: bounceAnswer 0.8s ease-in-out infinite !important;
}

.quiz-answer-option.animated-drift:hover {
    animation: driftAnswer 0.8s ease-in-out infinite !important;
}

.quiz-answer-option.animated-wiggle:hover {
    animation: wiggleAnswer 0.6s ease-in-out infinite !important;
}

.quiz-answer-option.animated-pulse:hover {
    animation: pulseFloat 1s ease-in-out infinite !important;
}

/* Quiz Progress Bar with Animation */
.quiz-progress-bar {
    position: relative;
    height: 8px;
    background: #e5e7eb;
    border-radius: 10px;
    overflow: hidden;
    margin-bottom: 2rem;
}

.quiz-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #ff6b8b 0%, #f472b6 50%, #ff6b8b 100%);
    border-radius: 10px;
    background-size: 200% 100%;
    animation: progressFill 0.6s ease-out;
    box-shadow: 0 0 10px rgba(255, 107, 139, 0.6);
}

.quiz-progress-fill::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    bottom: 0;
    right: 0;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.4), transparent);
    animation: shimmer 2s infinite;
}

@keyframes shimmer {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

/* Question Counter Badge */
.question-counter {
    display: inline-block;
    background: linear-gradient(135deg, #ff6b8b 0%, #f472b6 100%);
    color: white;
    padding: 0.5rem 1rem;
    border-radius: 20px;
    font-weight: bold;
    margin-bottom: 1rem;
    box-shadow: 0 4px 15px rgba(255, 107, 139, 0.3);
}

/* Score Popup Effect */
.score-popup {
    position: fixed;
    pointer-events: none;
    font-weight: bold;
    font-size: 1.5rem;
    z-index: 9999;
}

.score-popup.correct {
    color: #22c55e;
    animation: scorePopUp 1s ease-out;
}

.score-popup.incorrect {
    color: #ef4444;
    animation: scorePopUp 1s ease-out;
}

/* Confetti Effect */
.confetti {
    position: fixed;
    pointer-events: none;
    z-index: 9998;
}

.confetti-piece {
    position: absolute;
    animation: popConfetti 3s ease-out forwards;
}

/* Quiz Card Hover Effects */
.quiz-card {
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    border: 2px solid #e5e7eb;
}

.quiz-card:hover {
    border-color: #ff6b8b;
    transform: translateY(-5px);
    box-shadow: 0 12px 30px rgba(255, 107, 139, 0.15);
}

/* Celebration Animation Container */
.celebration-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 9997;
}

/* Quiz Achievement Badge */
.achievement-badge {
    animation: bounceScore 0.8s cubic-bezier(0.34, 1.56, 0.64, 1);
    font-size: 3rem;
}

/* Disabled state */
.quiz-answer-option:disabled,
.quiz-answer-option.disabled {
    opacity: 0.6;
    cursor: not-allowed;
    pointer-events: none;
}

/* ========== ENHANCED QUIZ QUESTION DESIGN ========== */

/* Quiz Question Container */
.quiz-question-wrapper {
    position: relative;
    border: 2px solid #f0f0f0 !important;
    border-radius: 16px !important;
    transition: all 0.3s ease;
    background: linear-gradient(135deg, #ffffff 0%, #fef9f3 100%) !important;
    animation: slideInAnswer 0.6s ease-out;
}

.quiz-question-wrapper:hover {
    border-color: #ff6b8b;
    box-shadow: 0 8px 24px rgba(255, 107, 139, 0.15);
    transform: translateY(-2px);
}

.quiz-question-wrapper::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background: linear-gradient(90deg, #ff6b8b 0%, #f472b6 50%, #fbcfe8 100%);
    border-radius: 16px 16px 0 0;
}

/* Question Header Badge */
.question-header-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: linear-gradient(135deg, #ff6b8b 0%, #f472b6 100%);
    color: white;
    font-weight: bold;
    font-size: 1.1rem;
    margin-right: 0.75rem;
    box-shadow: 0 4px 12px rgba(255, 107, 139, 0.25);
}

/* Question Text */
.quiz-question-text {
    color: #1f2937;
    font-size: 1.1rem;
    line-height: 1.6;
    margin: 0;
}

/* Answer Options Container */
.answer-options {
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 2px dashed #f0f0f0;
}

.answer-options-label {
    display: block;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: #9ca3af;
    margin-bottom: 1rem;
    font-weight: 600;
}

/* 2x2 Grid Layout for Answers */
.answers-grid-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    margin-top: 1rem;
}

@media (max-width: 768px) {
    .answers-grid-container {
        grid-template-columns: 1fr;
        gap: 0.75rem;
    }
}

/* Enhanced Quiz Answer Option */
.quiz-answer-option {
    position: relative;
    padding: 1rem 1.25rem !important;
    border: 2px solid #e5e7eb;
    border-radius: 10px;
    background: white;
    display: flex;
    align-items: center;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    margin-bottom: 0 !important;
}

.quiz-answer-option:hover {
    border-color: #ff6b8b !important;
    background: linear-gradient(135deg, #fff5f7 0%, #fffbfc 100%);
    transform: translateX(8px) !important;
    box-shadow: 0 6px 16px rgba(255, 107, 139, 0.12) !important;
}

/* Answer Option Label Letter */
.quiz-answer-option .form-check-input {
    flex-shrink: 0;
    margin-right: 1rem !important;
    width: 18px !important;
    height: 18px !important;
    min-width: 18px;
    min-height: 18px;
    border: 2px solid #d1d5db !important;
    cursor: pointer;
    transition: all 0.3s ease;
}

.quiz-answer-option .form-check-input:hover {
    border-color: #ff6b8b;
    transform: scale(1.1);
}

.quiz-answer-option .form-check-input:checked {
    background-color: #ff6b8b !important;
    border-color: #ff6b8b !important;
    box-shadow: 0 0 0 0.25rem rgba(255, 107, 139, 0.25) !important;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3e%3cpath fill='none' stroke='%23fff' d='M3.646 7.646a.5.5 0 0 1 .708 0l1.423 1.423 3.081-3.081a.5.5 0 1 1 .707.707l-3.435 3.435a.5.5 0 0 1-.707 0L3.646 8.354a.5.5 0 0 1 0-.708z'/%3e%3c/svg%3e") !important;
    background-repeat: no-repeat;
    background-position: center !important;
    background-size: 100% 100% !important;
}

/* Option Answer Text */
.quiz-answer-option .form-check-label,
.quiz-answer-option > * {
    margin: 0;
    cursor: pointer;
}

/* Answer Selection Indicator */
.quiz-answer-option.selected {
    border-color: #ff6b8b !important;
    background: linear-gradient(135deg, #fff5f7 0%, #fef9f3 100%);
    box-shadow: inset 0 0 0 2px rgba(255, 107, 139, 0.2), 0 4px 12px rgba(255, 107, 139, 0.1);
}

.quiz-answer-option.selected::after {
    content: '';
    display: none;
}

/* Correct/Incorrect States */
.quiz-answer-option.correct {
    border-color: #22c55e !important;
    background: linear-gradient(135deg, #f0fdf4 0%, #dcfce7 100%);
}

.quiz-answer-option.correct::after {
    content: '✓';
    position: absolute;
    right: 1rem;
    color: #22c55e;
    font-size: 1.5rem;
    font-weight: bold;
    animation: correctPulse 0.6s ease-out;
}

.quiz-answer-option.incorrect {
    border-color: #ef4444 !important;
    background: linear-gradient(135deg, #fef2f2 0%, #fee2e2 100%);
    opacity: 0.9;
}

.quiz-answer-option.incorrect::after {
    content: '✕';
    position: absolute;
    right: 1rem;
    color: #ef4444;
    font-size: 1.5rem;
    font-weight: bold;
    animation: wrongShake 0.5s ease-out;
}

/* Question Counter in Wrapper */
.quiz-question-counter-small {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: linear-gradient(135deg, #ff6b8b 0%, #f472b6 100%);
    color: white;
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Staggered Animation for Questions */
.quiz-question-wrapper:nth-child(1) {
    animation-delay: 0.1s;
}

.quiz-question-wrapper:nth-child(2) {
    animation-delay: 0.2s;
}

.quiz-question-wrapper:nth-child(3) {
    animation-delay: 0.3s;
}

.quiz-question-wrapper:nth-child(4) {
    animation-delay: 0.4s;
}

.quiz-question-wrapper:nth-child(5) {
    animation-delay: 0.5s;
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .quiz-question-wrapper {
        padding: 1.25rem !important;
    }
    
    .quiz-answer-option {
        padding: 0.75rem 1rem !important;
        font-size: 0.95rem;
    }
    
    .quiz-answer-option .form-check-input {
        width: 20px;
        height: 20px;
        margin-right: 0.75rem !important;
    }
    
    .quiz-answer-option:hover {
        transform: translateX(4px) !important;
    }
    
    .question-header-badge {
        width: 36px;
        height: 36px;
        font-size: 1rem;
    }
    
    .quiz-question-counter-small {
        padding: 0.2rem 0.6rem;
        font-size: 0.7rem;
    }
}

/* Mobile Responsiveness */
@media (max-width: 768px) {
    .quiz-answer-option {
        padding: 0.75rem;
    }
    
    .quiz-answer-option:hover {
        transform: translateX(4px) scale(1.01);
    }
    
    .quiz-answer-option::after {
        right: 15px;
        font-size: 1.5rem;
    }
}


