@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;600;700&display=swap');

body {
    font-family: 'Inter', sans-serif;
    background: #f8fafc;
    min-height: 100vh;
    color: #1f2937;
    overflow-x: hidden;
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
}

body.dark-mode {
    background: #0f172a;
    color: #e2e8f0;
}

#pageLoader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #ffffff;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    transition: opacity 0.6s ease-in-out;
}

#pageLoader.hidden {
    opacity: 0;
    pointer-events: none;
}

.loader-spinner {
    border: 8px solid #e5e7eb;
    border-top: 8px solid #8b5cf6;
    border-radius: 50%;
    width: 60px;
    height: 60px;
    animation: spin 0.8s linear infinite;
}

.loader-text {
    margin-top: 1rem;
    font-size: 1.2rem;
    font-weight: 600;
    color: #8b5cf6;
    letter-spacing: 1px;
    animation: pulse 1.8s ease-in-out infinite;
}

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

@keyframes pulse {
    0%, 100% { opacity: 0.8; }
    50% { opacity: 1; }
}

.navbar {
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid rgba(229, 231, 235, 0.7);
    padding: 0.75rem 1.5rem;
    position: sticky;
    top: 0;
    z-index: 1000;
    transition: background 0.3s ease, box-shadow 0.3s ease;
}

.navbar.scrolled {
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
}

body.dark-mode .navbar {
    background: rgba(15, 23, 42, 0.8);
    border-bottom: 1px solid rgba(51, 65, 85, 0.7);
}

.navbar-container {
    max-width: 1280px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
}

.navbar-brand img {
    max-height: 88px;
    max-width: 100%;
    object-fit: contain;
    transition: filter 0.3s ease, transform 0.3s ease;
}

/*body.dark-mode .navbar-brand img {*/
/*    filter: brightness(0) invert(1);*/
/*}*/

.navbar-brand:hover {
    transform: scale(1.05);
}

.navbar-menu {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.nav-link {
    font-weight: 600;
    font-size: 1.2rem;
    color: #868e96;
    padding: 0.5rem 1rem;
    border-radius: 8px;
    text-decoration: none;
    position: relative;
    transition: color 0.3s ease, background 0.3s ease;
}

body.dark-mode .nav-link {
    color: #94a3b8;
}

.nav-link:hover {
    color: #0f172a;
    background: rgba(226, 232, 240, 0.7);
}

body.dark-mode .nav-link:hover {
    color: #f1f5f9;
    background: rgba(51, 65, 85, 0.7);
}

.nav-link.active {
    color: #0f172a;
    background: #e2e8f0;
}

body.dark-mode .nav-link.active {
    color: #f1f5f9;
    background: #334155;
}

.hamburger {
    display: none;
    flex-direction: column;
    justify-content: space-around;
    width: 24px;
    height: 24px;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 0;
    z-index: 1001;
}

.hamburger span {
    width: 100%;
    height: 2px;
    background: #1f2937;
    border-radius: 2px;
    transition: all 0.3s cubic-bezier(.175,.885,.32,1.275);
}

body.dark-mode .hamburger span {
    background: #e2e8f0;
}

.hamburger.active span:nth-child(1) {
    transform: rotate(45deg) translate(5px, 5px);
}
.hamburger.active span:nth-child(2) {
    opacity: 0;
}
.hamburger.active span:nth-child(3) {
    transform: rotate(-45deg) translate(5px, -5px);
}

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

.quiz-card-wrapper {
    position: relative;
    padding: 2px;
    border-radius: 16px;
    background: linear-gradient(90deg, #ef4444, #3b82f6, #8b5cf6, #ef4444);
    background-size: 400% 400%;
    animation: glow 12s ease infinite;
    transition: transform 0.3s ease;
    box-sizing: border-box;
    min-width: 300px;
}

.quiz-card-wrapper:hover {
    transform: translateY(-8px);
}

.quiz-card {
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(10px);
    border-radius: 14px;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    text-align: left;
    transition: background 0.3s ease;
}

body.dark-mode .quiz-card {
    background: rgba(15, 23, 42, 0.8);
    backdrop-filter: blur(10px);
}

.quiz-card-content {
    padding: 1.5rem;
    flex-grow: 1;
}

.quiz-card-icon {
    width: 56px;
    height: 56px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1rem;
    font-size: 1.75rem;
}

.quiz-card-footer {
    border-top: 1px solid rgba(226, 232, 240, 1);
    padding: 1rem 1.5rem;
    background-color: rgba(248, 250, 252, 0.5);
}

body.dark-mode .quiz-card-footer {
    border-top-color: rgba(51, 65, 85, 1);
    background-color: rgba(30, 41, 59, 0.5);
}

/*
Timer CSS
 */
.timer {
    font-family: 'Orbitron', 'Courier New', monospace;
    font-size: 2.2rem;
    font-weight: 500;
    color: #00ff9d;
    background: linear-gradient(135deg, #1a1a1a 0%, #121212 100%);
    padding: 1rem 2.5rem;
    border-radius: 10px;
    border: 2px solid #333333;
    box-shadow: inset 0 0 10px rgba(0, 255, 157, 0.3), 0 4px 15px rgba(0, 0, 0, 0.4);
    transition: all 0.3s ease;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.timer::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(
            90deg,
            transparent,
            rgba(0, 255, 157, 0.2),
            transparent
    );
    animation: scan 4s linear infinite;
}

.timer:hover {
    transform: translateY(-3px);
    box-shadow: inset 0 0 12px rgba(0, 255, 157, 0.5), 0 6px 20px rgba(0, 0, 0, 0.5);
    color: #00ffcc;
}

@keyframes scan {
    0% {
        transform: translateX(0);
    }
    100% {
        transform: translateX(200%);
    }
}

.option-btn {
    text-align: left;
    margin-bottom: 0.75rem;
    border-radius: 8px;
    padding: 0.75rem 1.5rem;
    font-size: 1rem;
    transition: all 0.3s ease;
    border: 1px solid #e5e7eb;
    background: #f9fafb;
    color: #1f2937;
}

body.dark-mode .option-btn {
    background: #374151;
    border: 1px solid #4b5563;
    color: #e5e7eb;
}

.option-btn:hover {
    background: #ede9fe;
    border-color: #8b5cf6;
    transform: translateX(4px);
}

.option-btn.selected {
    background: #8b5cf6;
    color: #ffffff;
    border-color: #8b5cf6;
}

.correct {
    background: #6d28d9;
    color: #ffffff;
    border-color: #6d28d9;
}

.incorrect {
    background: #be185d;
    color: #ffffff;
    border-color: #be185d;
}

.progress {
    height: 12px;
    border-radius: 6px;
    background: #e5e7eb;
    overflow: hidden;
}

body.dark-mode .progress {
    background: #4b5563;
}

.progress-bar {
    background: linear-gradient(90deg, #8b5cf6, #a78bfa);
    transition: width 0.6s ease-in-out;
}

.result-card-wrapper {
    position: relative;
    padding: 2px;
    border-radius: 16px;
    background: #2A7B9B;
    background: linear-gradient(90deg,rgba(42, 123, 155, 1) 0%, rgba(80, 186, 137, 1) 100%);
    background-size: 400% 400%;
    animation: glow 12s ease infinite;
    transition: transform 0.3s ease;
    margin: 2rem 1rem;
}

.result-card {
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(12px);
    border-radius: 14px;
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.1);
    transition: background 0.3s ease;
}

body.dark-mode .result-card {
    background: rgba(15, 23, 42, 0.9);
    backdrop-filter: blur(12px);
}

.result-card.passed {
    background: linear-gradient(135deg, rgba(109, 40, 217, 0.1), rgba(255, 255, 255, 0.9));
}

body.dark-mode .result-card.passed {
    background: linear-gradient(135deg, rgba(109, 40, 217, 0.2), rgba(15, 23, 42, 0.9));
}

.result-card.failed {
    background: linear-gradient(135deg, rgba(190, 24, 93, 0.1), rgba(255, 255, 255, 0.9));
}

body.dark-mode .result-card.failed {
    background: linear-gradient(135deg, rgba(190, 24, 93, 0.2), rgba(15, 23, 42, 0.9));
}

.progress-circle {
    transform: rotate(-90deg);
}

.progress-circle-bg {
    fill: none;
    stroke: #e5e7eb;
    stroke-width: 6;
}

body.dark-mode .progress-circle-bg {
    stroke: #4b5563;
}

.progress-circle-fill {
    fill: none;
    stroke: #8b5cf6;
    stroke-width: 6;
    stroke-linecap: round;
    stroke-dasharray: 339.292;
    stroke-dashoffset: 339.292;
    transition: stroke-dashoffset 1s ease;
}

body.dark-mode .progress-circle-fill {
    stroke: #a78bfa;
}

.bg-score-card {
    background: #ede9fe;
}

body.dark-mode .bg-score-card {
    background: #2e1065;
}

.result-card .accordion-item {
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    margin-bottom: 0.75rem;
    background: #ffffff;
}

body.dark-mode .result-card .accordion-item {
    border: 1px solid #4b5563;
    background: #1f2937;
}

.result-card .accordion-header {
    padding: 1rem;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.result-card .accordion-content {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
    padding: 0 1rem;
}

.result-card .accordion-content.open {
    max-height: 500px;
    padding: 1rem;
}

.btn {
    border-radius: 8px;
    padding: 0.75rem 1.5rem;
    font-weight: 600;
    font-size: 0.9rem;
    transition: all 0.3s ease;
    text-transform: uppercase;
}

.btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.input-card-wrapper {
    position: relative;
    padding: 2px;
    border-radius: 16px;
    background: #2A7B9B;
    background: linear-gradient(90deg,rgba(42, 123, 155, 1) 0%, rgba(80, 186, 137, 1) 100%);
    background-size: 400% 400%;
    animation: glow 12s ease infinite;
    transition: transform 0.3s ease;
}

.input-card-wrapper:hover {
    transform: scale(1.02) translateY(-4px);
}

.input-card {
    background: linear-gradient(135deg, rgba(139, 92, 246, 0.05), rgba(255, 255, 255, 0.9));
    backdrop-filter: blur(12px);
    border-radius: 14px;
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.1), inset 0 2px 4px rgba(0, 0, 0, 0.05);
    transition: background 0.3s ease;
}

body.dark-mode .input-card {
    background: linear-gradient(135deg, rgba(139, 92, 246, 0.1), rgba(15, 23, 42, 0.9));
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.2), inset 0 2px 4px rgba(255, 255, 255, 0.05);
}

#inputTopic::first-letter {
    color: #6d28d9;
    font-weight: 700;
}

body.dark-mode #inputTopic::first-letter {
    color: #a78bfa;
}

/* Your existing footer styles */
.footer {
    position: relative;
    left: 0;
    bottom: 0;
    width: 100%;
    color: #000000;
    text-align: center;
    background: #ffffff;
    border-top: 1px solid #e5e7eb;
    padding: 1.5rem 1rem;
    font-size: 20px;
}

span.text-sm.font-semibold.text-gray-600.mr-2.dark\:text-gray-400 {
    font-size: 20px;
}

/* Your other footer styles (optional, just for completeness) */
.footer-container {
    max-width: 1280px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

body.dark-mode .footer {
    background: #0f172a;
    border-top: 1px solid #1e293b;
}

@media (max-width: 768px) {
    .navbar-menu {
        display: none;
        flex-direction: column;
        width: 100%;
        background: rgba(255, 255, 255, 0.98);
        padding: 1rem;
        margin-top: 0.5rem;
        border-radius: 8px;
        box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
    }
    body.dark-mode .navbar-menu {
        background: rgba(15, 23, 42, 0.98);
    }
    .navbar-menu.active {
        display: flex;
    }
    .hamburger {
        display: flex;
    }
    .result-card-wrapper {
        margin: 1rem 0.5rem;
    }
    .input-card-wrapper {
        margin: 1rem 0.5rem;
    }
}

@media (min-width: 1024px) {
    #quizGrid .grid {
        display: grid !important;
        grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
        gap: 0.75rem !important;
    }
    .quiz-card-wrapper {
        flex: 0 0 calc(33.333% - 0.5rem) !important;
        max-width: calc(33.333% - 0.5rem) !important;
        min-width: 300px;
    }
}

@media (min-width: 640px) and (max-width: 1023px) {
    #quizGrid .grid {
        display: grid !important;
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
        gap: 0.75rem !important;
    }
    .quiz-card-wrapper {
        flex: 0 0 calc(50% - 0.5rem) !important;
        max-width: calc(50% - 0.5rem) !important;
        min-width: 300px;
    }
}

@media (max-width: 639px) {
    #quizGrid .grid {
        display: grid !important;
        grid-template-columns: 1fr !important;
        gap: 0.75rem !important;
    }
    .quiz-card-wrapper {
        flex: 0 0 100% !important;
        max-width: 100% !important;
        min-width: 300px;
    }
    .input-card {
        padding: 1.5rem;
    }
    .question-input-section {
        margin-top: 3rem;
    }
}

div#quizPage {
    min-height: 785px;
}

div#resultContainer{
    min-height: 755px;
}