@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&family=JetBrains+Mono:wght@400;500&display=swap');

:root {
    --primary: #3b82f6;
    --primary-hover: #2563eb;
    --bg-main: #f8fafc;
    --bg-sidebar: #ffffff;
    --card: #ffffff;
    --text-main: #0f172a;
    --text-muted: #64748b;
    --border: #e2e8f0;
    --success: #10b981;
    --danger: #ef4444;
    --skeleton-bg: #e2e8f0;
    --skeleton-shine: #f8fafc;
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
}

[data-theme="dark"] {
    --primary: #6366f1;
    --primary-hover: #4f46e5;
    --bg-main: #0f172a;
    --bg-sidebar: #1e293b;
    --card: #1e293b;
    --text-main: #f8fafc;
    --text-muted: #94a3b8;
    --border: #334155;
    --skeleton-bg: #334155;
    --skeleton-shine: #1e293b;
}

/* Custom Scrollbar */
::-webkit-scrollbar { width: 8px; }
::-webkit-scrollbar-track { background: var(--bg-main); }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-muted); }

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--bg-main);
    color: var(--text-main);
    margin: 0;
    padding: 0;
    transition: background-color 0.3s ease;
}

/* Application Layout Grid */
.app-layout {
    display: flex;
    height: 100vh;
    overflow: hidden;
}

/* Sidebar Styling */
.sidebar {
    width: 280px;
    background-color: var(--bg-sidebar);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    padding: 1.5rem;
    z-index: 10;
}

.sidebar-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 2.5rem;
}

.sidebar-header .logo {
    background: var(--primary);
    color: white;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    font-size: 1.2rem;
}

.sidebar-header h2 {
    margin: 0;
    font-size: 1.2rem;
    font-weight: 700;
    letter-spacing: -0.5px;
}

.sidebar-nav {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    flex-grow: 1;
}

.sidebar-nav button {
    background: transparent;
    border: none;
    color: var(--text-muted);
    text-align: left;
    padding: 0.8rem 1rem;
    border-radius: 8px;
    font-weight: 500;
    font-size: 0.95rem;
    display: flex;
    align-items: center;
    gap: 10px;
    transition: all 0.2s ease;
    cursor: pointer;
}

.sidebar-nav button:hover {
    background: rgba(99, 102, 241, 0.1);
    color: var(--primary);
}

.sidebar-nav button.active {
    background: var(--primary);
    color: white;
    box-shadow: var(--shadow-md);
}

.theme-toggle {
    width: 100%;
    padding: 0.8rem;
    background: transparent;
    border: 1px solid var(--border);
    color: var(--text-main);
    border-radius: 8px;
    cursor: pointer;
}

/* Main Content Area */
.content-area {
    flex-grow: 1;
    overflow-y: auto;
    padding: 2.5rem 4rem;
}

.content-header {
    margin-bottom: 2rem;
}

.content-header h1 { margin: 0 0 0.5rem 0; font-size: 2rem; }
.content-header p { margin: 0; color: var(--text-muted); }

.card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 2rem;
    margin-bottom: 2rem;
    box-shadow: var(--shadow-sm);
}

.form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.input-group label {
    display: block;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 0.5rem;
}

input, select, textarea {
    width: 100%;
    padding: 0.8rem 1rem;
    background: var(--bg-main);
    border: 1px solid var(--border);
    color: var(--text-main);
    border-radius: 8px;
    font-family: 'Inter', sans-serif;
    font-size: 0.95rem;
    transition: all 0.2s;
}

input:focus, select:focus, textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.2);
}

.btn-primary { background: var(--primary); color: white; border: none; padding: 0.8rem 1.5rem; border-radius: 8px; font-weight: 600; cursor: pointer; transition: all 0.2s; }
.btn-primary:hover { background: var(--primary-hover); transform: translateY(-1px); box-shadow: var(--shadow-md); }
.btn-success { background: var(--success); color: white; border: none; padding: 0.8rem 1.5rem; border-radius: 8px; font-weight: 600; cursor: pointer; transition: all 0.2s; }

.action-row { display: flex; gap: 1rem; }

.tab-content { display: none; animation: fadeUp 0.3s ease forwards; }
.tab-content.active { display: block; }

/* Generated Content Typography */
.question-card { border-left: 4px solid var(--primary); }
.options { list-style: none; padding: 0; }
.options li { padding: 0.8rem; background: var(--bg-main); margin-bottom: 0.5rem; border-radius: 6px; border: 1px solid var(--border); font-family: 'Inter', sans-serif; }
.solution { margin-top: 1rem; padding: 1.5rem; background: rgba(99,102,241,0.05); border: 1px dashed var(--primary); border-radius: 8px; }

/* Exam Timer UI */
#exam-timer-bar {
    background: var(--card); border: 1px solid var(--border); padding: 1rem 1.5rem; border-radius: 8px; display: flex; align-items: center; gap: 10px; font-weight: 600; font-family: 'JetBrains Mono', monospace; margin-bottom: 1.5rem; box-shadow: var(--shadow-sm);
}
.pulse-dot { width: 10px; height: 10px; background: var(--danger); border-radius: 50%; animation: pulse 1.5s infinite; }

/* SHIMMER SKELETON LOADERS (The secret to Enterprise feel) */
.skeleton-box {
    background: linear-gradient(90deg, var(--skeleton-bg) 25%, var(--skeleton-shine) 50%, var(--skeleton-bg) 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
    border-radius: 8px;
    margin-bottom: 1rem;
}
.sk-title { height: 28px; width: 40%; }
.sk-text { height: 16px; width: 100%; }
.sk-text-short { height: 16px; width: 80%; }
.sk-block { height: 100px; width: 100%; margin-top: 1rem; }
.img-skeleton { height: 400px; width: 100%; }

/* Toast Notifications */
#toast-container { position: fixed; bottom: 20px; right: 20px; z-index: 9999; display: flex; flex-direction: column; gap: 10px; }
.toast { background: var(--card); color: var(--text-main); border-left: 4px solid var(--primary); padding: 1rem 1.5rem; border-radius: 8px; box-shadow: var(--shadow-md); font-weight: 500; animation: slideIn 0.3s ease forwards; }

@keyframes fadeUp { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }
@keyframes shimmer { 0% { background-position: -200% 0; } 100% { background-position: 200% 0; } }
@keyframes pulse { 0% { opacity: 1; transform: scale(1); } 50% { opacity: 0.5; transform: scale(1.2); } 100% { opacity: 1; transform: scale(1); } }
@keyframes slideIn { from { transform: translateX(100%); opacity: 0; } to { transform: translateX(0); opacity: 1; } }
.hidden { display: none !important; }
.text-center { text-align: center; }
