@import url('https://fonts.googleapis.com/css2?family=Tajawal:wght@400;500;700;900&display=swap');

:root {
    --primary-color: #fefffb;
    --secondary-color: #aac65d;
    --accent-color: #137980;
    --white: #ffffff;
    --light-gray: #f7f7f7;
    --dark-gray: #435f7a;
    --black: #000000;
    --success-color: #28a745;
    --warning-color: #ffc107;
    --info-color: #17a2b8;
    --error-color: #dc3545;
    --danger-color: #dc3545;
    --border-radius: 12px;
    --shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
    --transition: background-color 0.3s ease, border-color 0.3s ease, color 0.3s ease, box-shadow 0.3s ease, transform 0.3s ease, opacity 0.3s ease, filter 0.3s ease;
    --background-color: var(--white);
    --text-color: var(--accent-color);
    --border-color: #ddd;
    --input-bg: #fff;
    --text-muted: #666;
    --sidebar-width: 280px;
    --bg-secondary: #f2f5f0;

    --card-background: #ffffff;
    --text-primary: #333333;
    --text-secondary: #666666;
    --hover-bg: rgba(0, 0, 0, 0.05);
    --unread-bg: rgba(102, 126, 234, 0.08);

    /* Primary action buttons. Split out from --secondary-color so a teacher
       can recolour his call-to-action buttons without dragging every accent
       badge and highlight along with them (see dashboard-theme.js).

       --btn-bg defaults to the old value, so unthemed pages are unchanged.
       --btn-text is deliberately left UNDEFINED: the buttons that use it each
       had a different original colour (--white, --primary-color, literal
       white), so any single default here would recolour some of them. Each
       rule carries its original value as the var() fallback instead, and a
       teacher's palette defines --btn-text to take over everywhere at once. */
    --btn-bg: var(--secondary-color);
}

/* 🌙 Dark mode variables */
[data-theme="dark"] {
    --primary-color: #1a1a1a;
    --unread-bg: rgba(102, 126, 234, 0.12);
    --secondary-color: #8ba83f;
    --hover-bg: rgba(255, 255, 255, 0.05);
    --accent-color: #4a9ba5;
    --white: #2d2d2d;
    --light-gray: #2a2a2a;
    --dark-gray: #555555;
    --black: #000000;
    --shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
    --background-color: #2d2d2d;
    --text-color: #e0e0e0;
    --border-color: #444;
    --input-bg: #2a2a2a;
    --text-muted: #aaa;

    --card-background: #2a2a2a;
    --text-primary: #e0e0e0;
    --text-secondary: #aaaaaa;
    --bg-secondary: #232323;
}

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

body {
    font-family: 'Tajawal', sans-serif;
    background-color: var(--light-gray);
    color: var(--text-color);
    transition: var(--transition);
    line-height: 1.6;
}

/* ✅ Confirm Dialog */
.confirm-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.45);
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 0;
    visibility: hidden;
    z-index: 20000;
    transition: opacity 0.2s ease, visibility 0.2s ease;
    backdrop-filter: blur(2px);
}

.confirm-overlay.active {
    opacity: 1;
    visibility: visible;
}

.confirm-dialog {
    background: var(--background-color);
    color: var(--text-color);
    border-radius: var(--border-radius);
    padding: 25px 30px;
    width: 90%;
    max-width: 400px;
    box-shadow: var(--shadow);
    text-align: center;
    transform: translateY(-20px);
    transition: transform 0.25s ease;
}

.confirm-overlay.active .confirm-dialog {
    transform: translateY(0);
}

.confirm-message {
    font-size: 1.1rem;
    font-weight: 500;
    margin-bottom: 20px;
}

.confirm-actions {
    display: flex;
    justify-content: center;
    gap: 15px;
}

.btn-confirm,
.btn-cancel {
    padding: 8px 18px;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s ease, color 0.2s ease;
}

/* ✅ Buttons adapt to theme */
.btn-confirm {
    background: var(--accent-color);
    color: var(--white);
}

.btn-confirm:hover {
    background: var(--secondary-color);
}

.btn-cancel {
    background: var(--dark-gray);
    color: var(--black);
}

[data-theme="dark"] .btn-cancel {
    background: #444;
    color: #e0e0e0;
}

.btn-cancel:hover {
    background: #bbb;
}


.user-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background-color: var(--secondary-color);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    color: var(--primary-color);
    font-size: 1rem;
    overflow: hidden;
    border: 2px solid var(--accent-color);
}

.user-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Fix KaTeX math rendering direction inside RTL */
.katex, .katex-display {
    direction: ltr !important;
}
/* The glass/blur card treatment lives in css/glass.css, which is linked on
   every page. It cannot live here: base.css is loaded by only nine pages, so
   rules put here apply almost nowhere. */

/* Compact Stats Cards */
.stat-card {
    padding: 1rem !important;
}

.stat-value, .stat-number {
    font-size: 1.5rem !important;
}

.dashboard-card .card-body-content {
    padding: 1rem !important;
}

.dashboard-card .card-icon {
    width: 40px !important;
    height: 40px !important;
    font-size: 1.2rem !important;
}

.dashboard-card .card-title {
    font-size: 1.1rem !important;
}
