*{
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html{
    scroll-behavior: smooth;
}

body{
    font-family: 'Poppins', sans-serif;
    background: #edf2f7;
    color: #1f2937;
    display: flex;
    min-height: 100vh;
}

#sidebar{
    width: 280px;
    background: #0f172a;
    color: white;
    display: flex;
    flex-direction: column;
    position: fixed;
    left: 0;
    top: 0;
    bottom: 0;
    overflow: auto;
    box-shadow: 3px 0 15px rgba(0,0,0,.2);
    z-index: 100;
}

.logo{
    padding: 35px 20px;
    text-align: center;
    border-bottom: 1px solid rgba(255,255,255,.08);
}

.logo h1{
    font-size: 55px;
}

.logo h2{
    font-size: 24px;
    margin-top: 10px;
    font-weight: 600;
}

.menuButton{
    border: none;
    background: transparent;
    color: white;
    padding: 18px 25px;
    text-align: left;
    font-size: 17px;
    cursor: pointer;
    transition: .25s;
    border-left: 5px solid transparent;
    width: 100%;
}

.menuButton:hover{
    background: #1e293b;
    border-left: 5px solid #38bdf8;
    padding-left: 35px;
}

.menuButton.active{
    background: #2563eb;
    border-left: 5px solid #facc15;
}

#content{
    margin-left: 280px;
    width: calc(100% - 280px);
    padding: 40px;
}

.page{
    display: none;
    animation: fade .35s;
}

.page.active{
    display: block;
}

@keyframes fade{
    from{
        opacity: 0;
        transform: translateY(15px);
    }
    to{
        opacity: 1;
        transform: translateY(0);
    }
}

h1{
    font-size: 38px;
    color: #0f172a;
    margin-bottom: 20px;
}
h2{
    color: #1e3a8a;
}
h3{
    color: #334155;
}

button{
    font-family: 'Poppins', sans-serif;
}

.primaryButton{
    background: #2563eb;
    color: white;
    border: none;
    padding: 15px 35px;
    border-radius: 12px;
    font-size: 18px;
    cursor: pointer;
    transition: .3s;
}
.primaryButton:hover{
    background: #1d4ed8;
    transform: translateY(-2px);
}

.secondaryButton{
    background: #64748b;
    color: white;
    border: none;
    padding: 12px 25px;
    border-radius: 12px;
    font-size: 16px;
    cursor: pointer;
    transition: .3s;
}
.secondaryButton:hover{
    background: #475569;
}

.welcome{
    background: white;
    border-radius: 25px;
    padding: 60px;
    box-shadow: 0 10px 25px rgba(0,0,0,.08);
}
.welcome h1{
    font-size: 48px;
    margin-bottom: 15px;
}
.welcome p{
    font-size: 22px;
    color: #475569;
    margin-bottom: 35px;
}

#modules{
    display: grid;
    grid-template-columns: repeat(auto-fill,minmax(250px,1fr));
    gap: 25px;
    margin-top: 30px;
}

.module{
    background: white;
    border-radius: 20px;
    padding: 25px;
    box-shadow: 0 10px 20px rgba(0,0,0,.08);
    transition: .3s;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    min-height: 220px;
}
.module:hover{
    transform: translateY(-8px);
    box-shadow: 0 20px 35px rgba(0,0,0,.15);
}
.module h2{
    font-size: 26px;
    margin-bottom: 10px;
}
.module p{
    color: #64748b;
    line-height: 1.6;
    margin-bottom: 20px;
}
.module button{
    background: #2563eb;
    color: white;
    border: none;
    padding: 14px;
    border-radius: 12px;
    cursor: pointer;
    font-size: 17px;
    transition: .3s;
}
.module button:hover{
    background: #1d4ed8;
}

.lessonCard{
    background: white;
    border-radius: 20px;
    padding: 35px;
    margin-top: 25px;
    box-shadow: 0 10px 20px rgba(0,0,0,.08);
}
.lessonCard h2{
    color: #2563eb;
    margin-bottom: 20px;
}
.lessonCard h3{
    margin-top: 25px;
    color: #0f172a;
}
.lessonCard p{
    margin: 12px 0;
    line-height: 1.8;
    color: #374151;
}

.formula{
    background: #eff6ff;
    border-left: 6px solid #2563eb;
    padding: 18px;
    border-radius: 12px;
    margin: 20px 0;
    font-size: 18px;
    font-weight: bold;
}
.example{
    background: #f8fafc;
    border-left: 6px solid #22c55e;
    padding: 15px;
    border-radius: 10px;
    margin: 15px 0;
}

.questionBox{
    background: white;
    padding: 35px;
    border-radius: 20px;
    box-shadow: 0 10px 20px rgba(0,0,0,.08);
    margin-top: 30px;
}
.questionNumber{
    color: #2563eb;
    font-weight: bold;
    margin-bottom: 10px;
}
.questionTitle{
    font-size: 28px;
    margin-bottom: 25px;
}

#quiz-options {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 15px;
    margin-top: 25px;
}

.quiz-option-btn, .practice-btn {
    background: #ffffff;
    border: 2px solid #cbd5e1;
    border-radius: 50px; 
    padding: 16px 24px;
    font-size: 1.1rem;
    font-weight: 600;
    color: #1e293b;
    cursor: pointer;
    text-align: center;
    transition: all 0.25s ease;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.02);
}

.quiz-option-btn:hover:not(:disabled), .practice-btn:hover:not(:disabled) {
    background-color: #eff6ff;
    border-color: #3b82f6;
    color: #1d4ed8;
    transform: translateY(-3px);
    box-shadow: 0 8px 15px rgba(59, 130, 246, 0.15);
}

body.dark .quiz-option-btn, body.dark .practice-btn {
    background: #1e293b;
    border-color: #334155;
    color: #cbd5e1;
}

body.dark .quiz-option-btn:hover:not(:disabled), body.dark .practice-btn:hover:not(:disabled) {
    background-color: #1e3a8a;
    border-color: #60a5fa;
    color: #ffffff;
}

.quiz-option-btn.correct, .practice-btn.correct {
    background-color: #10b981 !important;
    border-color: #059669 !important;
    color: white !important;
}

.quiz-option-btn.incorrect, .practice-btn.incorrect {
    background-color: #ef4444 !important;
    border-color: #dc2626 !important;
    color: white !important;
}

.explanation{
    margin-top: 30px;
    background: #fff7ed;
    border-left: 6px solid orange;
    border-radius: 12px;
    padding: 20px;
    display: none;
}
.explanation h3{
    margin-bottom: 15px;
}
.explanation p{
    line-height: 1.8;
}

.nextButton{
    margin-top: 30px;
    background: #16a34a;
    color: white;
    border: none;
    padding: 16px 35px;
    border-radius: 12px;
    cursor: pointer;
    font-size: 18px;
    display: none;
    transition: .3s;
}
.nextButton:hover{
    background: #15803d;
}

.progressContainer{
    width: 100%;
    height: 22px;
    background: #dbe4ef;
    border-radius: 30px;
    overflow: hidden;
    margin: 25px 0;
}
.progressBar{
    width: 0%;
    height: 100%;
    background: linear-gradient(90deg,#22c55e,#16a34a);
    transition: .4s;
}

.stats{
    display: grid;
    grid-template-columns: repeat(auto-fit,minmax(220px,1fr));
    gap: 20px;
    margin-top: 35px;
}
.card{
    background: white;
    padding: 30px;
    border-radius: 18px;
    box-shadow: 0 10px 20px rgba(0,0,0,.08);
    text-align: center;
}
.card h2{
    color: #2563eb;
}
.card h3{
    margin-top: 15px;
    font-size: 35px;
    color: #16a34a;
}

.resultBox{
    background: white;
    border-radius: 20px;
    padding: 40px;
    text-align: center;
    box-shadow: 0 10px 25px rgba(0,0,0,.1);
    margin-top: 30px;
}
.resultBox h1{
    font-size: 55px;
    color: #2563eb;
}
.resultBox h2{
    margin-top: 20px;
    color: #16a34a;
}
.resultBox p{
    margin-top: 15px;
    font-size: 20px;
}

.badges{
    display: grid;
    grid-template-columns: repeat(auto-fit,minmax(180px,1fr));
    gap: 20px;
    margin-top: 35px;
}
.badge{
    background: white;
    padding: 25px;
    border-radius: 18px;
    text-align: center;
    box-shadow: 0 10px 20px rgba(0,0,0,.08);
}
.badge span{
    font-size: 55px;
}
.badge h3{
    margin-top: 15px;
}

table{
    width: 100%;
    border-collapse: collapse;
    margin-top: 30px;
}
table th{
    background: #2563eb;
    color: white;
    padding: 15px;
}
table td{
    padding: 15px;
    border-bottom: 1px solid #ddd;
}
table tr:hover{
    background: #f8fafc;
}

input, select{
    width: 100%;
    padding: 14px;
    border-radius: 10px;
    border: 1px solid #cbd5e1;
    margin-top: 10px;
    margin-bottom: 20px;
    font-size: 16px;
}
input:focus{
    outline: none;
    border-color: #2563eb;
}

.auth-screen {
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    background: linear-gradient(135deg, #3b82f6, #1d4ed8);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.auth-box {
    background: #ffffff;
    padding: 40px;
    width: 100%;
    max-width: 420px;
    border-radius: 30px;
    text-align: center;
    box-shadow: 0 10px 25px rgba(0,0,0,0.2);
}

.auth-box h1 {
    margin-bottom: 10px;
    color: #1e293b;
}

.auth-buttons {
    display: flex;
    flex-direction: column;
    gap: 15px;
    margin-top: 25px;
}

.auth-form {
    display: flex;
    flex-direction: column;
    gap: 15px;
    margin-top: 20px;
}

.auth-form input {
    padding: 12px 15px;
    border-radius: 25px;
    border: 1px solid #cbd5e1;
    font-size: 1rem;
    outline: none;
    margin: 0;
}

.textButton {
    background: none;
    border: none;
    color: #3b82f6;
    cursor: pointer;
    font-weight: 600;
    margin-top: 5px;
}

.hidden {
    display: none !important;
}

.create-student-box {
    background: rgba(59, 130, 246, 0.05);
    padding: 20px;
    border-radius: 20px;
    margin: 20px 0;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.create-student-box input {
    padding: 10px 15px;
    border-radius: 20px;
    border: 1px solid #cbd5e1;
    margin: 0;
}

::-webkit-scrollbar{
    width: 10px;
}
::-webkit-scrollbar-track{
    background: #e2e8f0;
}
::-webkit-scrollbar-thumb{
    background: #2563eb;
    border-radius: 20px;
}
::-webkit-scrollbar-thumb:hover{
    background: #1d4ed8;
}

footer{
    margin-top: 50px;
    text-align: center;
    color: #64748b;
    font-size: 14px;
}

body.dark{
    background: #0f172a;
    color: white;
}
body.dark #content{
    background: #0f172a;
}
body.dark .module,
body.dark .lessonCard,
body.dark .questionBox,
body.dark .card,
body.dark .resultBox,
body.dark .badge,
body.dark .auth-box{
    background: #1e293b;
    color: white;
}
body.dark h1,
body.dark h2,
body.dark h3{
    color: white;
}
body.dark p{
    color: #cbd5e1;
}
body.dark .answer{
    background: #334155;
}
body.dark .answer:hover{
    background: #475569;
}

@media(max-width:900px){
    #sidebar{
        width: 100%;
        position: relative;
        height: auto;
    }
    #content{
        margin-left: 0;
        width: 100%;
        padding: 20px;
    }
    #modules{
        grid-template-columns: 1fr;
    }
    .stats{
        grid-template-columns: 1fr;
    }
    .badges{
        grid-template-columns: 1fr;
    }
}

.main-app {
    display: flex;
    width: 100%;
}

.stats-overview {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.stat-card {
    background: var(--card-bg, #ffffff);
    padding: 20px;
    border-radius: 20px;
    display: flex;
    align-items: center;
    gap: 15px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.05);
}

.stat-icon {
    font-size: 2.2rem;
}

.stat-label {
    font-size: 0.85rem;
    color: #64748b;
    display: block;
}

.stat-value {
    font-size: 1.3rem;
    font-weight: bold;
    color: #1e293b;
    margin: 0;
}

body.dark .stat-value {
    color: #ffffff;
}

.difficulty-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

.difficulty-card {
    background: var(--card-bg, #ffffff);
    padding: 30px;
    border-radius: 25px;
    text-align: center;
    box-shadow: 0 4px 10px rgba(0,0,0,0.05);
}

.stats-overview {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
    gap: 20px;
    margin-bottom: 30px;
}

@media (max-width: 1024px) {
    .stats-overview {
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    }
}

.stat-card {
    background: var(--card-bg, #ffffff);
    padding: 20px;
    border-radius: 20px;
    display: flex;
    align-items: center;
    gap: 15px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.05);
}

.stat-icon {
    font-size: 2.2rem;
}

.stat-info {
    display: flex;
    flex-direction: column;
}

.stat-label {
    font-size: 0.85rem;
    color: #64748b;
    display: block;
}

.stat-value {
    font-size: 1.3rem;
    font-weight: bold;
    color: #1e293b;
    margin: 0;
}

body.dark .stat-value {
    color: #ffffff;
}

.stats-overview {
    display: grid !important;
    grid-template-columns: repeat(4, 1fr) !important;
    gap: 15px !important;
    margin-bottom: 30px !important;
    width: 100% !important;
}


.modulesGrid {
    display: grid !important;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)) !important;
    gap: 20px !important;
    margin-top: 20px !important;
}

.moduleCard {
    background: var(--card-bg, #ffffff) !important;
    padding: 25px !important;
    border-radius: 20px !important;
    box-shadow: 0 4px 10px rgba(0,0,0,0.05) !important;
    cursor: pointer !important;
    transition: transform 0.2s ease !important;
}

.moduleCard:hover {
    transform: translateY(-5px);
}
