/* LessonNote AI - Main Stylesheet */
:root {
    --primary: #2563eb;
    --primary-dark: #1d4ed8;
    --primary-light: #dbeafe;
    --secondary: #f59e0b;
    --success: #10b981;
    --danger: #ef4444;
    --warning: #f59e0b;
    --dark: #1e293b;
    --gray-50: #f8fafc;
    --gray-100: #f1f5f9;
    --gray-200: #e2e8f0;
    --gray-300: #cbd5e1;
    --gray-400: #94a3b8;
    --gray-500: #64748b;
    --gray-600: #475569;
    --gray-700: #334155;
    --gray-800: #1e293b;
    --radius: 12px;
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow: 0 4px 6px -1px rgb(0 0 0 / 0.1);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1);
    --shadow-xl: 0 20px 25px -5px rgb(0 0 0 / 0.1);
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--gray-50);
    color: var(--gray-800);
    line-height: 1.6;
    overflow-x: hidden;
}

/* ===== HEADER ===== */
.header {
    background: white;
    border-bottom: 1px solid var(--gray-200);
    padding: 0 2rem;
    position: fixed;
    top: 0; left: 0; right: 0;
    z-index: 1000;
    height: 64px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    box-shadow: var(--shadow-sm);
}

.logo {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-weight: 700;
    font-size: 1.25rem;
    color: var(--primary);
    text-decoration: none;
}

.logo-icon {
    width: 36px; height: 36px;
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1.1rem;
}

.nav-links {
    display: flex;
    gap: 2rem;
    align-items: center;
}

.nav-links a {
    text-decoration: none;
    color: var(--gray-600);
    font-weight: 500;
    font-size: 0.9rem;
    transition: color 0.2s;
    cursor: pointer;
    padding: 0.5rem 0;
    border-bottom: 2px solid transparent;
}

.nav-links a:hover, .nav-links a.active {
    color: var(--primary);
    border-bottom-color: var(--primary);
}

/* ===== BUTTONS ===== */
.btn {
    padding: 0.5rem 1.25rem;
    border-radius: 8px;
    border: none;
    font-weight: 600;
    font-size: 0.875rem;
    cursor: pointer;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    font-family: inherit;
    text-decoration: none;
}

.btn-primary {
    background: var(--primary);
    color: white;
}
.btn-primary:hover {
    background: var(--primary-dark);
    transform: translateY(-1px);
    box-shadow: var(--shadow);
}

.btn-secondary {
    background: white;
    color: var(--gray-700);
    border: 1px solid var(--gray-300);
}
.btn-secondary:hover {
    background: var(--gray-50);
    border-color: var(--gray-400);
}

.btn-success {
    background: var(--success);
    color: white;
}
.btn-success:hover { background: #059669; }

.btn-danger {
    background: var(--danger);
    color: white;
}
.btn-danger:hover { background: #dc2626; }

.btn-warning {
    background: var(--warning);
    color: white;
}
.btn-warning:hover { background: #d97706; }

.btn-sm { padding: 0.375rem 0.875rem; font-size: 0.8rem; }
.btn-lg { padding: 0.75rem 2rem; font-size: 1rem; }
.btn-block { width: 100%; justify-content: center; }

/* ===== MAIN LAYOUT ===== */
.main-container {
    margin-top: 64px;
    min-height: calc(100vh - 64px);
}

.page {
    display: none;
    animation: fadeIn 0.3s ease;
}
.page.active { display: block; }

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* ===== HERO SECTION ===== */
.hero {
    background: linear-gradient(135deg, #1e3a5f 0%, #2563eb 100%);
    color: white;
    padding: 4rem 2rem;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.hero::before {
    content: '';
    position: absolute;
    top: -50%; left: -50%;
    width: 200%; height: 200%;
    background: radial-gradient(circle, rgba(255,255,255,0.1) 1px, transparent 1px);
    background-size: 30px 30px;
    opacity: 0.3;
}

.hero-content {
    position: relative;
    z-index: 1;
    max-width: 800px;
    margin: 0 auto;
}

.hero h1 {
    font-size: 3rem;
    font-weight: 700;
    margin-bottom: 1rem;
    line-height: 1.2;
}

.hero p {
    font-size: 1.25rem;
    opacity: 0.9;
    margin-bottom: 2rem;
}

.hero-stats {
    display: flex;
    justify-content: center;
    gap: 3rem;
    margin-top: 3rem;
}

.stat { text-align: center; }
.stat-number {
    font-size: 2.5rem;
    font-weight: 700;
    display: block;
}
.stat-label {
    font-size: 0.875rem;
    opacity: 0.8;
}

/* ===== FEATURES ===== */
.features {
    padding: 4rem 2rem;
    max-width: 1200px;
    margin: 0 auto;
}

.section-title {
    text-align: center;
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 3rem;
    color: var(--gray-800);
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 2rem;
}

.feature-card {
    background: white;
    padding: 2rem;
    border-radius: var(--radius);
    border: 1px solid var(--gray-200);
    transition: all 0.3s;
}

.feature-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
    border-color: var(--primary-light);
}

.feature-icon {
    width: 48px; height: 48px;
    background: var(--primary-light);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--primary);
    font-size: 1.25rem;
    margin-bottom: 1rem;
}

.feature-card h3 {
    font-size: 1.125rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.feature-card p {
    color: var(--gray-500);
    font-size: 0.9rem;
}

/* ===== GENERATOR PAGE ===== */
.generator-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 2rem;
    display: grid;
    grid-template-columns: 340px 1fr;
    gap: 2rem;
}

.sidebar {
    background: white;
    border-radius: var(--radius);
    border: 1px solid var(--gray-200);
    padding: 1.5rem;
    height: fit-content;
    position: sticky;
    top: 80px;
    max-height: calc(100vh - 100px);
    overflow-y: auto;
}

.sidebar::-webkit-scrollbar {
    width: 6px;
}

.sidebar::-webkit-scrollbar-thumb {
    background: var(--gray-300);
    border-radius: 3px;
}

.sidebar h3 {
    font-size: 0.875rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--gray-500);
    margin-bottom: 1rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid var(--gray-200);
}

.form-group {
    margin-bottom: 1.25rem;
}

.form-label {
    display: block;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--gray-700);
    margin-bottom: 0.375rem;
}

.form-input, .form-select, .form-textarea {
    width: 100%;
    padding: 0.625rem 0.875rem;
    border: 1px solid var(--gray-300);
    border-radius: 8px;
    font-family: inherit;
    font-size: 0.875rem;
    transition: all 0.2s;
    background: white;
    color: var(--gray-800);
}

.form-input:focus, .form-select:focus, .form-textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-light);
}

.form-textarea {
    resize: vertical;
    min-height: 80px;
}

.form-hint {
    font-size: 0.75rem;
    color: var(--gray-400);
    margin-top: 0.25rem;
}

/* ===== CURRICULUM SELECTOR ===== */
.curriculum-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.5rem;
    margin-top: 0.5rem;
}

.curriculum-option {
    border: 2px solid var(--gray-200);
    border-radius: 8px;
    padding: 0.625rem 0.5rem;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s;
    font-size: 0.75rem;
    font-weight: 500;
    background: white;
}

.curriculum-option:hover {
    border-color: var(--primary);
    background: var(--primary-light);
    color: var(--primary);
}

.curriculum-option.active {
    border-color: var(--primary);
    background: var(--primary-light);
    color: var(--primary);
    font-weight: 600;
}

.curriculum-option i {
    display: block;
    font-size: 1.1rem;
    margin-bottom: 0.35rem;
}

/* ===== EDITOR AREA ===== */
.editor-area {
    background: white;
    border-radius: var(--radius);
    border: 1px solid var(--gray-200);
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.editor-toolbar {
    background: var(--gray-50);
    border-bottom: 1px solid var(--gray-200);
    padding: 0.75rem 1rem;
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    align-items: center;
}

.toolbar-group {
    display: flex;
    gap: 0.25rem;
    padding-right: 0.75rem;
    border-right: 1px solid var(--gray-300);
    margin-right: 0.25rem;
    align-items: center;
}

.toolbar-group:last-child {
    border-right: none;
    padding-right: 0;
    margin-right: 0;
}

.toolbar-btn {
    width: 32px; height: 32px;
    border: none;
    background: transparent;
    border-radius: 6px;
    cursor: pointer;
    color: var(--gray-600);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    font-size: 0.875rem;
}

.toolbar-btn:hover {
    background: var(--gray-200);
    color: var(--gray-800);
}

.toolbar-btn.active {
    background: var(--primary);
    color: white;
}

.toolbar-select {
    height: 32px;
    border: 1px solid var(--gray-300);
    border-radius: 6px;
    background: white;
    font-family: inherit;
    font-size: 0.8rem;
    padding: 0 0.5rem;
    cursor: pointer;
    color: var(--gray-700);
}

.toolbar-divider {
    width: 1px;
    height: 24px;
    background: var(--gray-300);
    margin: 0 0.25rem;
}

.editor-content {
    min-height: 600px;
    padding: 2rem;
    font-family: Georgia, 'Times New Roman', serif;
    font-size: 1rem;
    line-height: 1.8;
    color: var(--gray-800);
    outline: none;
    overflow-y: auto;
    max-height: 70vh;
    flex: 1;
}

.editor-content:empty:before {
    content: 'Start typing your lesson note here... Use the toolbar to add tables, images, and diagrams.';
    color: var(--gray-400);
    font-style: italic;
}

/* Editor Content Styles */
.editor-content h1 { 
    font-size: 2rem; 
    font-weight: 700; 
    margin: 1.5rem 0 1rem; 
    color: var(--dark);
    font-family: 'Inter', sans-serif;
    border-bottom: 2px solid var(--gray-200);
    padding-bottom: 0.5rem;
}

.editor-content h2 { 
    font-size: 1.5rem; 
    font-weight: 700; 
    margin: 1.25rem 0 0.75rem; 
    color: var(--gray-800);
    font-family: 'Inter', sans-serif;
}

.editor-content h3 { 
    font-size: 1.25rem; 
    font-weight: 600; 
    margin: 1rem 0 0.5rem; 
    font-family: 'Inter', sans-serif;
    color: var(--gray-700);
}

.editor-content p { margin-bottom: 1rem; }

.editor-content ul, .editor-content ol { 
    margin: 1rem 0; 
    padding-left: 2rem; 
}

.editor-content li { margin-bottom: 0.5rem; }

.editor-content table {
    width: 100%;
    border-collapse: collapse;
    margin: 1.5rem 0;
    font-family: 'Inter', sans-serif;
    font-size: 0.9rem;
    box-shadow: var(--shadow-sm);
    border-radius: 8px;
    overflow: hidden;
}

.editor-content th, .editor-content td {
    border: 1px solid var(--gray-300);
    padding: 0.75rem;
    text-align: left;
}

.editor-content th {
    background: linear-gradient(135deg, var(--gray-100), var(--gray-200));
    font-weight: 600;
    color: var(--gray-700);
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.editor-content tr:nth-child(even) {
    background: var(--gray-50);
}

.editor-content tr:hover {
    background: var(--primary-light);
}

.editor-content img {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    margin: 1rem 0;
    box-shadow: var(--shadow);
    display: block;
}

.editor-content blockquote {
    border-left: 4px solid var(--primary);
    padding-left: 1rem;
    margin: 1rem 0;
    color: var(--gray-600);
    font-style: italic;
    background: var(--gray-50);
    padding: 1rem 1rem 1rem 1.5rem;
    border-radius: 0 8px 8px 0;
}

.editor-content .diagram-container {
    background: var(--gray-50);
    border: 2px dashed var(--gray-300);
    border-radius: 12px;
    padding: 2rem;
    margin: 1.5rem 0;
    text-align: center;
    position: relative;
    transition: all 0.3s;
}

.editor-content .diagram-container:hover {
    border-color: var(--primary);
    background: var(--primary-light);
}

.editor-content .diagram-svg {
    max-width: 100%;
    height: auto;
}

.editor-content .image-caption {
    text-align: center;
    font-size: 0.85rem;
    color: var(--gray-500);
    margin-top: 0.5rem;
    font-style: italic;
    font-family: 'Inter', sans-serif;
}

.editor-content .diagram-caption {
    text-align: center;
    font-size: 0.85rem;
    color: var(--gray-500);
    margin-top: 1rem;
    font-style: italic;
    font-family: 'Inter', sans-serif;
}

/* ===== MCQ SECTION ===== */
.mcq-section {
    background: white;
    border-radius: var(--radius);
    border: 1px solid var(--gray-200);
    margin-top: 2rem;
    overflow: hidden;
}

.mcq-header {
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: white;
    padding: 1.25rem 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.mcq-header h3 {
    font-size: 1.125rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.mcq-body {
    padding: 1.5rem;
}

.mcq-question {
    background: var(--gray-50);
    border-radius: 10px;
    padding: 1.25rem;
    margin-bottom: 1rem;
    border-left: 4px solid var(--secondary);
    transition: all 0.2s;
}

.mcq-question:hover {
    box-shadow: var(--shadow);
    transform: translateX(4px);
}

.mcq-question-number {
    font-weight: 700;
    color: var(--primary);
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.mcq-question-text {
    font-weight: 500;
    margin-bottom: 0.75rem;
    color: var(--gray-800);
    line-height: 1.5;
}

.mcq-options {
    display: grid;
    gap: 0.5rem;
}

.mcq-option {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.625rem 1rem;
    background: white;
    border: 1px solid var(--gray-200);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
    font-size: 0.9rem;
}

.mcq-option:hover {
    border-color: var(--primary);
    background: var(--primary-light);
}

.mcq-option.correct {
    border-color: var(--success);
    background: #d1fae5;
    color: #065f46;
}

.mcq-option.wrong {
    border-color: var(--danger);
    background: #fee2e2;
    color: #991b1b;
}

.mcq-option input[type="radio"] {
    cursor: pointer;
    width: 18px;
    height: 18px;
    accent-color: var(--primary);
}

.mcq-answer-reveal {
    margin-top: 0.75rem;
    padding: 0.75rem;
    background: white;
    border-radius: 6px;
    font-size: 0.85rem;
    display: none;
}

.mcq-answer-reveal.show {
    display: block;
}

.mcq-answer-reveal.correct-ans {
    border-left: 3px solid var(--success);
    color: #065f46;
}

.mcq-answer-reveal.wrong-ans {
    border-left: 3px solid var(--danger);
    color: #991b1b;
}

/* ===== ASSIGNMENT PREVIEW ===== */
.assignment-preview {
    background: white;
    border: 1px solid var(--gray-200);
    border-radius: var(--radius);
    padding: 2rem;
    margin-top: 2rem;
    box-shadow: var(--shadow-sm);
}

.assignment-header {
    text-align: center;
    border-bottom: 2px solid var(--gray-800);
    padding-bottom: 1.5rem;
    margin-bottom: 2rem;
}

.assignment-header h2 {
    font-size: 1.5rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--gray-800);
}

.assignment-header .subtitle {
    color: var(--gray-500);
    margin-top: 0.5rem;
    font-size: 0.9rem;
}

.assignment-meta {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
    margin-bottom: 2rem;
    font-size: 0.9rem;
    padding: 1rem;
    background: var(--gray-50);
    border-radius: 8px;
}

.assignment-meta div {
    display: flex;
    gap: 0.5rem;
}

.assignment-meta strong {
    color: var(--gray-700);
    min-width: 70px;
}

.assignment-footer {
    margin-top: 2rem;
    padding-top: 2rem;
    border-top: 1px solid var(--gray-200);
    text-align: center;
}

.assignment-footer p {
    font-size: 0.8rem;
    color: var(--gray-500);
}

/* ===== DASHBOARD ===== */
.dashboard {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem;
}

.dashboard-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    flex-wrap: wrap;
    gap: 1rem;
}

.dashboard-header h2 {
    font-size: 1.5rem;
    font-weight: 700;
}

.search-box {
    position: relative;
    width: 300px;
}

.search-box input {
    width: 100%;
    padding: 0.625rem 1rem 0.625rem 2.5rem;
    border: 1px solid var(--gray-300);
    border-radius: 8px;
    font-family: inherit;
    font-size: 0.875rem;
    transition: all 0.2s;
}

.search-box input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-light);
}

.search-box i {
    position: absolute;
    left: 0.875rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--gray-400);
}

.notes-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 1.5rem;
}

.note-card {
    background: white;
    border-radius: var(--radius);
    border: 1px solid var(--gray-200);
    padding: 1.5rem;
    transition: all 0.3s;
    cursor: pointer;
    position: relative;
    overflow: hidden;
}

.note-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
    border-color: var(--primary-light);
}

.note-card::before {
    content: '';
    position: absolute;
    top: 0; left: 0;
    width: 4px; height: 100%;
    background: var(--primary);
    opacity: 0;
    transition: opacity 0.3s;
}

.note-card:hover::before {
    opacity: 1;
}

.note-card .subject-tag {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    background: var(--primary-light);
    color: var(--primary);
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    margin-bottom: 0.75rem;
}

.note-card .grade-tag {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    background: var(--gray-100);
    color: var(--gray-600);
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 500;
    margin-left: 0.5rem;
}

.note-card h4 {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: var(--gray-800);
    line-height: 1.4;
}

.note-card .excerpt {
    font-size: 0.85rem;
    color: var(--gray-500);
    line-height: 1.5;
    margin-bottom: 1rem;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.note-card .meta {
    font-size: 0.8rem;
    color: var(--gray-500);
    display: flex;
    gap: 1rem;
    align-items: center;
    padding-top: 1rem;
    border-top: 1px solid var(--gray-100);
}

.note-card .meta i {
    margin-right: 0.25rem;
}

.note-card .actions {
    position: absolute;
    top: 1rem;
    right: 1rem;
    display: flex;
    gap: 0.5rem;
    opacity: 0;
    transition: opacity 0.2s;
}

.note-card:hover .actions {
    opacity: 1;
}

.action-btn {
    width: 32px; height: 32px;
    border: none;
    background: var(--gray-100);
    border-radius: 8px;
    cursor: pointer;
    color: var(--gray-600);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    transition: all 0.2s;
}

.action-btn:hover {
    background: var(--danger);
    color: white;
    transform: scale(1.1);
}

.action-btn.edit:hover {
    background: var(--primary);
}

.action-btn.view:hover {
    background: var(--success);
}

/* ===== MODALS ===== */
.modal-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.5);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    backdrop-filter: blur(4px);
    padding: 1rem;
}

.modal-overlay.active {
    display: flex;
}

.modal {
    background: white;
    border-radius: var(--radius);
    width: 90%;
    max-width: 600px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: var(--shadow-xl);
    animation: modalSlide 0.3s ease;
}

.modal-lg {
    max-width: 900px;
}

@keyframes modalSlide {
    from { transform: translateY(-20px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

.modal-header {
    padding: 1.5rem;
    border-bottom: 1px solid var(--gray-200);
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    background: white;
    z-index: 10;
}

.modal-header h3 {
    font-size: 1.25rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.modal-close {
    width: 36px; height: 36px;
    border: none;
    background: var(--gray-100);
    border-radius: 10px;
    cursor: pointer;
    color: var(--gray-500);
    font-size: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.modal-close:hover {
    background: var(--danger);
    color: white;
}

.modal-body {
    padding: 1.5rem;
}

.modal-footer {
    padding: 1rem 1.5rem;
    border-top: 1px solid var(--gray-200);
    display: flex;
    justify-content: flex-end;
    gap: 0.75rem;
    position: sticky;
    bottom: 0;
    background: white;
}

/* ===== DIAGRAM TYPES ===== */
.diagram-types {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
}

.diagram-type {
    border: 2px solid var(--gray-200);
    border-radius: 12px;
    padding: 1.5rem 1rem;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s;
    background: white;
}

.diagram-type:hover {
    border-color: var(--primary);
    background: var(--primary-light);
    transform: translateY(-2px);
    box-shadow: var(--shadow);
}

.diagram-type i {
    font-size: 2.5rem;
    color: var(--primary);
    margin-bottom: 1rem;
    display: block;
}

.diagram-type h4 {
    font-size: 0.95rem;
    font-weight: 600;
    margin-bottom: 0.35rem;
    color: var(--gray-800);
}

.diagram-type p {
    font-size: 0.8rem;
    color: var(--gray-500);
    line-height: 1.4;
}

/* ===== TABLE CONTROLS ===== */
.table-controls {
    position: absolute;
    background: var(--gray-800);
    color: white;
    padding: 0.5rem;
    border-radius: 8px;
    display: none;
    gap: 0.25rem;
    z-index: 100;
    box-shadow: var(--shadow-lg);
    font-size: 0.75rem;
}

.table-controls.active {
    display: flex;
}

.table-controls button {
    background: transparent;
    border: none;
    color: white;
    cursor: pointer;
    padding: 0.35rem 0.6rem;
    border-radius: 6px;
    font-size: 0.75rem;
    display: flex;
    align-items: center;
    gap: 0.35rem;
    transition: all 0.2s;
    white-space: nowrap;
}

.table-controls button:hover {
    background: rgba(255,255,255,0.2);
}

/* ===== LOADING ===== */
.loading-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(255,255,255,0.95);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 3000;
    flex-direction: column;
    gap: 1.5rem;
}

.loading-overlay.active {
    display: flex;
}

.spinner {
    width: 56px; height: 56px;
    border: 4px solid var(--gray-200);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.loading-text {
    color: var(--gray-600);
    font-weight: 500;
    font-size: 1rem;
}

.loading-subtext {
    color: var(--gray-400);
    font-size: 0.85rem;
}

/* ===== TOAST ===== */
.toast-container {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    z-index: 4000;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    max-width: 400px;
}

.toast {
    background: var(--gray-800);
    color: white;
    padding: 1rem 1.25rem;
    border-radius: 10px;
    box-shadow: var(--shadow-lg);
    display: flex;
    align-items: center;
    gap: 0.75rem;
    animation: toastIn 0.3s ease;
    font-size: 0.9rem;
    cursor: pointer;
}

.toast.success { 
    background: var(--success); 
    border-left: 4px solid #059669;
}
.toast.error { 
    background: var(--danger); 
    border-left: 4px solid #dc2626;
}
.toast.warning { 
    background: var(--warning); 
    border-left: 4px solid #d97706;
}
.toast.info { 
    background: var(--primary); 
    border-left: 4px solid var(--primary-dark);
}

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

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

.toast.hiding {
    animation: toastOut 0.3s ease forwards;
}

/* ===== EMPTY STATE ===== */
.empty-state {
    text-align: center;
    padding: 4rem 2rem;
    color: var(--gray-400);
    grid-column: 1 / -1;
}

.empty-state i {
    font-size: 4rem;
    margin-bottom: 1.5rem;
    display: block;
    opacity: 0.5;
}

.empty-state h3 {
    color: var(--gray-600);
    margin-bottom: 0.5rem;
    font-size: 1.25rem;
}

.empty-state p {
    margin-bottom: 1.5rem;
    max-width: 400px;
    margin-left: auto;
    margin-right: auto;
}

/* ===== PRINT STYLES ===== */
@media print {
    .header, .sidebar, .editor-toolbar, .btn, .mcq-header .btn,
    .actions, .nav-links, .modal-overlay, .loading-overlay, .toast-container,
    .table-controls {
        display: none !important;
    }

    .editor-content {
        max-height: none;
        overflow: visible;
        padding: 0;
    }

    .generator-container {
        grid-template-columns: 1fr;
        padding: 0;
    }

    .mcq-section, .assignment-preview {
        break-inside: avoid;
        page-break-inside: avoid;
    }

    .page { display: block !important; }
    .main-container { margin-top: 0; }
    body { background: white; }
}

/* ===== RESPONSIVE ===== */
@media (max-width: 1024px) {
    .generator-container {
        grid-template-columns: 1fr;
    }

    .sidebar {
        position: static;
        max-height: none;
        order: 2;
    }

    .editor-area {
        order: 1;
    }

    .diagram-types {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .hero h1 { font-size: 2rem; }
    .hero-stats { gap: 1.5rem; }
    .features-grid { grid-template-columns: 1fr; }
    .notes-grid { grid-template-columns: 1fr; }
    .dashboard-header { flex-direction: column; align-items: stretch; }
    .search-box { width: 100%; }
    .assignment-meta { grid-template-columns: 1fr; }
    .curriculum-grid { grid-template-columns: repeat(2, 1fr); }
    .diagram-types { grid-template-columns: 1fr; }
    .nav-links { display: none; }
    .header { padding: 0 1rem; }
    .generator-container { padding: 1rem; }
}

@media (max-width: 480px) {
    .hero { padding: 2rem 1rem; }
    .hero h1 { font-size: 1.5rem; }
    .hero p { font-size: 1rem; }
    .stat-number { font-size: 1.75rem; }
    .editor-content { padding: 1rem; min-height: 400px; }
}

/* ===== SCROLLBAR ===== */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: var(--gray-100);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb {
    background: var(--gray-300);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--gray-400);
}

/* ===== UTILITY ===== */
.text-center { text-align: center; }
.text-right { text-align: right; }
.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }
.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.hidden { display: none !important; }
.flex { display: flex; }
.flex-col { flex-direction: column; }
.gap-2 { gap: 1rem; }
.gap-3 { gap: 1.5rem; }
.w-full { width: 100%; }

/* Preview Mode */
.preview-mode .editor-toolbar,
.preview-mode .sidebar {
    display: none;
}

.preview-mode .generator-container {
    grid-template-columns: 1fr;
}

.preview-watermark {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    background: var(--gray-800);
    color: white;
    padding: 0.5rem 1rem;
    border-radius: 20px;
    font-size: 0.75rem;
    opacity: 0.7;
    z-index: 100;
}

/* Color swatches in toolbar */
.color-swatch {
    width: 20px;
    height: 20px;
    border-radius: 4px;
    border: 1px solid var(--gray-300);
    cursor: pointer;
    display: inline-block;
}

/* Image upload dropzone */
.dropzone {
    border: 2px dashed var(--gray-300);
    border-radius: 12px;
    padding: 2rem;
    text-align: center;
    transition: all 0.3s;
    cursor: pointer;
    background: var(--gray-50);
}

.dropzone:hover, .dropzone.dragover {
    border-color: var(--primary);
    background: var(--primary-light);
}

.dropzone i {
    font-size: 2.5rem;
    color: var(--gray-400);
    margin-bottom: 1rem;
    display: block;
}

.dropzone p {
    color: var(--gray-600);
    font-size: 0.9rem;
    margin-bottom: 0.5rem;
}

.dropzone small {
    color: var(--gray-400);
    font-size: 0.75rem;
}
