/* ============================================================
   Pakistani Paper Generator - Main Stylesheet
   ============================================================ */

/* ─── Google Fonts ─────────────────────────────────────────── */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap');
@import url('https://fonts.googleapis.com/css2?family=Noto+Nastaliq+Urdu:wght@400;700&display=swap');

/* ─── Base ──────────────────────────────────────────────────── */
:root {
    --primary: #0d6efd;
    --success: #198754;
    --sidebar-width: 260px;
    --topbar-height: 60px;
}

body {
    font-family: 'Inter', sans-serif;
    background-color: #f0f2f5;
    color: #333;
}

/* ─── Sidebar ───────────────────────────────────────────────── */
.sidebar {
    transition: transform 0.3s ease;
}

.sidebar.collapsed {
    transform: translateX(-100%);
}

/* ─── Main Content ──────────────────────────────────────────── */
.main-content {
    min-height: 100vh;
    transition: margin-left 0.3s ease;
}

/* ─── Topbar ────────────────────────────────────────────────── */
.navbar {
    height: var(--topbar-height);
    position: sticky;
    top: 0;
    z-index: 999;
}

/* ─── Cards ─────────────────────────────────────────────────── */
.card {
    border-radius: 12px;
    transition: transform 0.2s, box-shadow 0.2s;
}

.card:hover {
    transform: translateY(-1px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.1) !important;
}

/* ─── Buttons ───────────────────────────────────────────────── */
.btn {
    border-radius: 8px;
    font-weight: 500;
}

.btn-primary {
    background: linear-gradient(135deg, #0d6efd, #0a58ca);
    border: none;
}

.btn-primary:hover {
    background: linear-gradient(135deg, #0a58ca, #084298);
}

/* ─── Tables ────────────────────────────────────────────────── */
.table th {
    font-weight: 600;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #6c757d;
}

.table td {
    vertical-align: middle;
}

/* ─── Forms ─────────────────────────────────────────────────── */
.form-control, .form-select {
    border-radius: 8px;
    border-color: #dee2e6;
    padding: 0.5rem 0.75rem;
}

.form-control:focus, .form-select:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 0.2rem rgba(13, 110, 253, 0.15);
}

/* ─── Badges ────────────────────────────────────────────────── */
.badge {
    font-weight: 500;
    padding: 0.4em 0.7em;
    border-radius: 6px;
}

/* ─── Urdu Text ─────────────────────────────────────────────── */
.urdu-text {
    font-family: 'Noto Nastaliq Urdu', serif;
    font-size: 1.1em;
    line-height: 2;
}

/* ─── Paper Preview ─────────────────────────────────────────── */
.paper-container {
    background: white;
    max-width: 900px;
    margin: 0 auto;
    padding: 40px;
    box-shadow: 0 0 30px rgba(0,0,0,0.1);
    border-radius: 8px;
    font-family: 'Times New Roman', Times, serif;
    font-size: 14px;
    line-height: 1.8;
}

.paper-header {
    border-bottom: 3px double #333;
    padding-bottom: 15px;
}

.paper-section {
    margin-bottom: 30px;
}

.section-header {
    background: #f8f9fa;
    padding: 10px 15px;
    border-left: 4px solid var(--primary);
    margin-bottom: 15px;
    border-radius: 0 8px 8px 0;
}

.question-item {
    padding: 8px 0;
    border-bottom: 1px dotted #eee;
}

.question-item:last-child {
    border-bottom: none;
}

.marks-badge {
    font-weight: bold;
    color: var(--primary);
    white-space: nowrap;
    font-size: 0.9em;
}

.answer-line {
    border-bottom: 1px solid #ccc;
    margin-bottom: 14px;
    height: 22px;
}

.mcq-options {
    font-size: 0.95em;
    margin-top: 5px;
}

.option-label {
    font-weight: bold;
    margin-right: 4px;
}

/* ─── Dashboard Stats ───────────────────────────────────────── */
.stat-icon {
    width: 60px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

/* ─── Scrollbar ─────────────────────────────────────────────── */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
}

::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
}

/* ─── Responsive ────────────────────────────────────────────── */
@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-100%);
        z-index: 1050;
    }

    .sidebar.show {
        transform: translateX(0);
    }

    .main-content {
        margin-left: 0 !important;
    }

    .navbar {
        margin-left: 0 !important;
    }

    .paper-container {
        padding: 20px;
    }
}

/* ─── Print Styles ──────────────────────────────────────────── */
@media print {
    .no-print,
    .sidebar,
    .navbar,
    .btn,
    .breadcrumb,
    .alert {
        display: none !important;
    }

    .main-content {
        margin-left: 0 !important;
    }

    .paper-container {
        box-shadow: none;
        padding: 0;
        max-width: 100%;
        border-radius: 0;
    }

    body {
        background: white;
        font-size: 12pt;
    }

    .section-header {
        background: #f0f0f0 !important;
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }

    @page {
        margin: 1.5cm;
        size: A4 portrait;
    }

    .question-item {
        page-break-inside: avoid;
    }
}

/* ─── Animations ────────────────────────────────────────────── */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.card {
    animation: fadeIn 0.3s ease;
}

/* ─── Loading Spinner ───────────────────────────────────────── */
.spinner-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255,255,255,0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

/* ─── Sticky Sidebar Toggle ─────────────────────────────────── */
#sidebarToggle {
    display: none;
}

@media (max-width: 992px) {
    #sidebarToggle {
        display: block;
    }
}
