/* 1. Global Setup */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    background-color: #f0f4f8;
    color: #334155;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    line-height: 1.5;
}

/* 2. Centered Containers (Login & Dashboard) */
.auth-box, .dashboard-container {
    background: white;
    width: 90%;
    max-width: 450px;
    padding: 2.5rem;
    border-radius: 16px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.05);
    text-align: center;
}

.dashboard-container {
    max-width: 900px; /* Dashboard needs more room for cards */
}

/* 3. Lesson Container (The Side-by-Side View) */
.lesson-container {
    display: flex; /* Puts sidebar and content next to each other */
    width: 95vw;
    max-width: 1200px;
    height: 90vh;
    background: white;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.1);
}

/* 4. Sidebar Navigation */
.sidebar {
    width: 280px;
    background: #f8fafc;
    border-right: 1px solid #e2e8f0;
    padding: 1.5rem;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
}

.sidebar h3 {
    font-size: 1.1rem;
    margin-bottom: 1.5rem;
    color: #1e293b;
}

.sidebar ul {
    list-style: none;
}

.sidebar li {
    padding: 12px 16px;
    margin-bottom: 8px;
    border-radius: 8px;
    cursor: pointer;
    transition: 0.2s;
    font-weight: 500;
}

.sidebar li:hover {
    background: #edf2f7;
}

.sidebar li.active {
    background: #10a37f;
    color: white;
}

/* 5. Main Lesson Content */
.content {
    flex: 1;
    padding: 3rem;
    overflow-y: auto; /* Content scrolls, sidebar stays put */
    text-align: left;
}

.lesson-text {
    font-size: 1.15rem;
    color: #1e293b;
    margin-bottom: 2rem;
}

/* 6. Textbook Assistant (The "Binder") */
.ai-binder {
    margin-top: 3rem;
    padding: 1.5rem;
    background: #f0fdf4;
    border-left: 5px solid #10a37f;
    border-radius: 8px;
}

.response-box {
    margin-top: 1rem;
    padding: 1rem;
    background: white;
    border: 1px solid #dcfce7;
    border-radius: 6px;
    min-height: 50px;
}

/* 7. Forms & Buttons */
input {
    width: 100%;
    padding: 12px;
    margin: 10px 0;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    font-size: 1rem;
}

button {
    width: 100%;
    padding: 14px;
    background: #10a37f;
    color: white;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: 0.2s;
}

button:hover {
    background: #0d8a6a;
}

.secondary {
    background: #64748b;
    margin-top: 0.5rem;
}

/* 8. Dashboard Grid */
.subject-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 1.5rem;
    margin-top: 2rem;
}

.subject-card {
    border: 2px solid #f1f5f9;
    padding: 1.5rem;
    border-radius: 12px;
    cursor: pointer;
    transition: 0.3s;
}

.subject-card:hover:not(.locked) {
    border-color: #10a37f;
    transform: translateY(-4px);
}

.locked {
    opacity: 0.5;
    background: #f8fafc;
    cursor: not-allowed;
}

/* Notification Toast */
#notification-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 1000;
}

.toast {
    background: #10a37f;
    color: white;
    padding: 15px 25px;
    border-radius: 10px;
    margin-bottom: 10px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
    animation: slideIn 0.4s ease-out forwards;
}

@keyframes slideIn {
    from { transform: translateX(100%); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

/* Sidebar Scroll */
.sidebar {
    height: 100vh;
    overflow-y: auto; /* Allows 27 modules to be scrollable */
    padding-bottom: 50px;
}