/* =====================================================================
   LMS PKPOINT (lms.pkpoint.com) - MODERN EDUCATIONAL DESIGN SYSTEM
   Theme: Clean, Accessible, Dual Light/Dark Mode with High Readability
   ===================================================================== */

:root {
    --font-sans: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    --font-heading: 'Outfit', 'Inter', sans-serif;
    --font-mono: 'Fira Code', 'JetBrains Mono', Menlo, Monaco, Consolas, monospace;

    /* Light Mode Variables (PKPOINT Official Emerald/Slate Theme) */
    --bg-page: #f8fafc;
    --bg-surface: #ffffff;
    --bg-surface-elevated: #ffffff;
    --bg-subtle: #f1f5f9;
    --text-main: #0f172a;
    --text-muted: #64748b;
    --text-subtle: #94a3b8;
    --border-color: #e2e8f0;
    --border-subtle: #edf2f7;

    --brand-primary: #059669;
    --brand-primary-hover: #047857;
    --brand-primary-light: #ecfdf5;
    --brand-accent: #f59e0b;

    --color-success: #10b981;
    --color-success-bg: #ecfdf5;
    --color-danger: #ef4444;
    --color-danger-bg: #fef2f2;
    --color-warning: #f59e0b;
    --color-info: #0284c7;

    --radius-sm: 8px;
    --radius-md: 14px;
    --radius-lg: 20px;
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.07), 0 2px 4px -2px rgba(0, 0, 0, 0.05);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.08), 0 4px 6px -4px rgba(0, 0, 0, 0.05);
    --transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    --font-urdu: 'Noto Nastaliq Urdu', 'Jameel Noori Nastaleeq', 'Urdu Typesetting', serif;
}

html.dark, .dark, [data-theme="dark"] {
    /* Dark Mode Variables */
    --bg-page: #020617;
    --bg-surface: #0f172a;
    --bg-surface-elevated: #1e293b;
    --bg-subtle: #1e293b;
    --text-main: #f8fafc;
    --text-muted: #94a3b8;
    --text-subtle: #64748b;
    --border-color: #1e293b;
    --border-subtle: #334155;

    --brand-primary: #10b981;
    --brand-primary-hover: #059669;
    --brand-primary-light: rgba(16, 185, 129, 0.15);

    --color-success-bg: rgba(16, 185, 129, 0.15);
    --color-danger-bg: rgba(239, 68, 68, 0.15);
}

/* Bilingual Urdu Typography Support */
.urdu-text {
    font-family: var(--font-urdu);
    direction: rtl;
    text-align: right;
    line-height: 2.3;
    font-size: 1.1rem;
    letter-spacing: 0;
}

.urdu-badge {
    font-family: var(--font-urdu);
    font-size: 0.85rem;
    padding: 0.15rem 0.6rem;
    line-height: 1.8;
}

.bilingual-card {
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    margin-bottom: 1.5rem;
    overflow: hidden;
    transition: var(--transition);
}

.bilingual-card:hover {
    border-color: var(--brand-primary);
    box-shadow: var(--shadow-sm);
}

.bilingual-header {
    background: var(--bg-subtle);
    padding: 0.85rem 1.25rem;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.bilingual-body-en {
    padding: 1.25rem;
    border-bottom: 1px dashed var(--border-color);
}

.bilingual-body-ur {
    padding: 1.25rem;
    background: rgba(5, 150, 105, 0.02);
}

.real-world-analogy {
    background: #ecfdf5;
    border-left: 4px solid #10b981;
    border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
    padding: 0.85rem 1rem;
    margin-top: 0.75rem;
    font-size: 0.9rem;
    color: #065f46;
}

html.dark .real-world-analogy, .dark .real-world-analogy, [data-theme="dark"] .real-world-analogy {
    background: rgba(16, 185, 129, 0.1);
    color: #6ee7b7;
}

body {
    font-family: var(--font-sans);
    background-color: var(--bg-page);
    color: var(--text-main);
    line-height: 1.6;
    transition: background-color 0.25s ease, color 0.25s ease;
    margin: 0;
    padding: 0;
}

/* Navbar */
.lms-navbar {
    background: var(--bg-surface);
    border-bottom: 1px solid var(--border-color);
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
}

.brand-badge {
    font-size: 0.72rem;
    padding: 0.2rem 0.55rem;
    font-weight: 600;
    border-radius: 9999px;
    background: var(--brand-primary-light);
    color: var(--brand-primary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Cards */
.lms-card {
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
    overflow: hidden;
}

.lms-card:hover {
    border-color: var(--brand-primary);
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}

.lms-card-header {
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid var(--border-color);
    background: transparent;
}

.lms-card-body {
    padding: 1.5rem;
}

/* Interactive Subject & Book Cards */
.subject-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.4rem 0.85rem;
    font-size: 0.85rem;
    font-weight: 500;
    border-radius: 9999px;
    background: var(--bg-subtle);
    color: var(--text-main);
    border: 1px solid var(--border-color);
    text-decoration: none;
    transition: var(--transition);
}

.subject-pill:hover, .subject-pill.active {
    background: var(--brand-primary);
    color: #ffffff;
    border-color: var(--brand-primary);
}

/* Chapter Item in List */
.chapter-row-card {
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 1.25rem;
    margin-bottom: 1rem;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: space-between;
    text-decoration: none;
    color: inherit;
}

.chapter-row-card:hover {
    border-color: var(--brand-primary);
    background: var(--brand-primary-light);
    color: inherit;
    transform: translateX(4px);
}

.chapter-badge-num {
    width: 42px;
    height: 42px;
    border-radius: var(--radius-sm);
    background: var(--brand-primary-light);
    color: var(--brand-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 1.1rem;
    flex-shrink: 0;
}

/* Concept Cards */
.concept-card {
    background: var(--bg-surface);
    border-left: 4px solid var(--brand-primary);
    border-top: 1px solid var(--border-color);
    border-right: 1px solid var(--border-color);
    border-bottom: 1px solid var(--border-color);
    border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
    padding: 1.1rem 1.25rem;
    margin-bottom: 1rem;
}

.concept-title {
    font-weight: 700;
    font-size: 1rem;
    margin-bottom: 0.35rem;
    color: var(--brand-primary);
}

/* Code Snippet Box */
.code-box {
    border-radius: var(--radius-md);
    background: #1e1e2e;
    color: #cdd6f4;
    margin: 1.5rem 0;
    overflow: hidden;
    box-shadow: var(--shadow-md);
    border: 1px solid #313244;
}

.code-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.65rem 1.1rem;
    background: #181825;
    border-bottom: 1px solid #313244;
    font-size: 0.85rem;
    font-family: var(--font-mono);
}

.code-header .lang-badge {
    color: #89b4fa;
    text-transform: uppercase;
    font-weight: 600;
    font-size: 0.75rem;
}

.btn-copy {
    background: transparent;
    border: 1px solid #45475a;
    color: #a6adc8;
    padding: 0.2rem 0.6rem;
    font-size: 0.75rem;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: var(--transition);
}

.btn-copy:hover {
    background: #313244;
    color: #ffffff;
}

.code-content {
    padding: 1.2rem;
    margin: 0;
    font-family: var(--font-mono);
    font-size: 0.9rem;
    line-height: 1.55;
    overflow-x: auto;
}

/* Quiz Interface */
.quiz-question-box {
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    transition: var(--transition);
}

.mcq-option-label {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.85rem 1.1rem;
    border: 1.5px solid var(--border-color);
    border-radius: var(--radius-sm);
    margin-bottom: 0.65rem;
    cursor: pointer;
    background: var(--bg-surface);
    transition: var(--transition);
    font-size: 0.95rem;
}

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

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

.mcq-option-label.is-correct {
    border-color: var(--color-success) !important;
    background: var(--color-success-bg) !important;
    font-weight: 600;
}

.mcq-option-label.is-incorrect {
    border-color: var(--color-danger) !important;
    background: var(--color-danger-bg) !important;
    text-decoration: line-through;
}

.explanation-alert {
    display: none;
    padding: 0.85rem 1.1rem;
    border-radius: var(--radius-sm);
    font-size: 0.88rem;
    margin-top: 0.75rem;
    border-left: 4px solid var(--brand-primary);
    background: var(--bg-subtle);
}

/* PDF Viewer Frame */
.pdf-viewer-wrapper {
    position: relative;
    border-radius: var(--radius-md);
    overflow: hidden;
    border: 1px solid var(--border-color);
    background: #334155;
    box-shadow: var(--shadow-md);
}

.pdf-toolbar {
    background: #1e293b;
    padding: 0.65rem 1rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    color: #f8fafc;
    font-size: 0.88rem;
}

.pdf-iframe {
    width: 100%;
    height: 750px;
    border: none;
    display: block;
}

/* Admin Dashboard Specific */
.admin-metric-card {
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 1.5rem;
    display: flex;
    align-items: center;
    gap: 1.25rem;
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
}

.admin-metric-card:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}

.metric-icon-box {
    width: 52px;
    height: 52px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
}

/* Light / Dark Mode Toggle Button */
.theme-toggle-btn {
    background: var(--bg-subtle);
    border: 1px solid var(--border-color);
    color: var(--text-main);
    width: 38px;
    height: 38px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: var(--transition);
}

.theme-toggle-btn:hover {
    background: var(--border-color);
}

