/**
 * Modern Ministry of Education Design System - Kurdish Sorani (RTL)
 * Kurdistan Regional Government (KRG) - حکومەتی هەرێمی کوردستان
 */

@font-face {
    font-family: 'PARWARDA-2026 BOLD';
    src: url('../fonts/PARWARDA-2026-BOLD.ttf') format('truetype'),
         url('../../PARWARDA-2026 BOLD.ttf') format('truetype');
    font-weight: bold;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'PARWARDA';
    src: url('../fonts/PARWARDA-2026-BOLD.ttf') format('truetype'),
         url('../../PARWARDA-2026 BOLD.ttf') format('truetype');
    font-weight: normal;
    font-style: normal;
    font-display: swap;
}

@import url('https://fonts.googleapis.com/css2?family=Noto+Kufi+Arabic:wght@300;400;500;600;700;800;900&family=Plus+Jakarta+Sans:wght@400;600;700&display=swap');

:root {
    --primary: #0F2744;
    --primary-light: #1E427B;
    --primary-dark: #0A1B30;
    --secondary: #1E5BB0;
    --accent-gold: #D4AF37;
    --accent-gold-light: #F6E08E;
    --accent-green: #10B981;
    --accent-red: #EF4444;
    --bg-main: #FFFFFF;
    --bg-card: #FFFFFF;
    --text-main: #000000;
    --text-muted: #475569;
    --border-color: #E2E8F0;
    --sidebar-width: 275px;
    --header-height: 70px;
    --transition-speed: 0.25s;
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.05), 0 1px 2px rgba(0,0,0,0.03);
    --shadow-md: 0 4px 6px -1px rgba(0,0,0,0.06), 0 2px 4px -1px rgba(0,0,0,0.03);
    --shadow-lg: 0 10px 25px -3px rgba(15, 39, 68, 0.06), 0 4px 6px -2px rgba(0,0,0,0.02);
    --shadow-xl: 0 20px 35px -5px rgba(15, 39, 68, 0.08);
}

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

body, button, input, select, textarea, .btn, .table, h1, h2, h3, h4, h5, h6, .badge {
    font-family: 'PARWARDA-2026 BOLD', 'PARWARDA', 'Noto Kufi Arabic', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif !important;
}

body {
    background-color: var(--bg-main);
    color: var(--text-main);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    overflow-x: hidden;
    direction: rtl;
    text-align: right;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 7px;
    height: 7px;
}
::-webkit-scrollbar-track {
    background: #e2e8f0;
}
::-webkit-scrollbar-thumb {
    background: #94a3b8;
    border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
    background: #64748b;
}

a {
    color: var(--secondary);
    text-decoration: none;
    transition: color var(--transition-speed);
}
a:hover {
    color: var(--primary);
}

/* Layout Wrapper */
.app-wrapper {
    display: flex;
    min-height: 100vh;
    width: 100%;
}

/* RTL Sidebar - Clean White Aesthetic */
.app-sidebar {
    width: var(--sidebar-width);
    background: #FFFFFF;
    color: #0F172A;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    z-index: 1040;
    transition: all var(--transition-speed) ease-in-out;
    border-left: 1px solid #E2E8F0;
    box-shadow: -2px 0 15px rgba(0, 0, 0, 0.03);
}

.sidebar-header {
    height: var(--header-height);
    display: flex;
    align-items: center;
    padding: 0 20px;
    border-bottom: 1px solid #F1F5F9;
    background: #FFFFFF;
}

.sidebar-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    color: #0F2744;
    font-weight: 800;
    font-size: 1rem;
    text-decoration: none;
}

.sidebar-brand:hover {
    color: #1E5BB0;
}

.sidebar-brand-icon {
    width: 38px;
    height: 38px;
    background: linear-gradient(135deg, var(--accent-gold) 0%, #B8860B 100%);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #0F2744;
    font-size: 1.25rem;
    box-shadow: 0 4px 10px rgba(212, 175, 55, 0.35);
}

.sidebar-nav {
    padding: 20px 12px;
    flex-grow: 1;
    overflow-y: auto;
}

.nav-section-title {
    font-size: 0.75rem;
    color: #64748B;
    padding: 12px 14px 6px 14px;
    font-weight: 800;
    letter-spacing: 0.3px;
}

.nav-item-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 11px 14px;
    color: #1E293B;
    border-radius: 10px;
    font-size: 0.92rem;
    font-weight: 600;
    margin-bottom: 4px;
    transition: all 0.2s ease;
}

.nav-item-link i {
    font-size: 1.15rem;
    width: 22px;
    text-align: center;
    color: #64748B;
    transition: transform 0.2s ease, color 0.2s ease;
}

.nav-item-link:hover {
    background: #F1F5F9;
    color: #0F2744;
    transform: translateX(-3px);
}

.nav-item-link:hover i {
    color: #1E5BB0;
    transform: scale(1.1);
}

.nav-item-link.active {
    background: #0F2744;
    color: #FFFFFF;
    font-weight: 700;
    box-shadow: 0 4px 14px rgba(15, 39, 68, 0.22);
}

.nav-item-link.active i {
    color: var(--accent-gold-light);
}

.sidebar-user-card {
    padding: 16px;
    margin: 12px;
    background: #F8FAFC;
    border-radius: 12px;
    border: 1px solid #E2E8F0;
    color: #0F2744;
}

/* Main Content Area */
.app-main {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
}

/* Top Navbar */
.app-topbar {
    height: var(--header-height);
    background: var(--bg-card);
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 28px;
    position: sticky;
    top: 0;
    z-index: 1020;
    box-shadow: var(--shadow-sm);
}

.page-content {
    padding: 28px;
    flex-grow: 1;
}

/* Stat Cards */
.stat-card {
    background: var(--bg-card);
    border-radius: 16px;
    padding: 22px;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-color);
    transition: all 0.25s ease;
    position: relative;
    overflow: hidden;
}

.stat-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
    border-color: #CBD5E1;
}

.stat-card-icon-wrapper {
    width: 52px;
    height: 52px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    flex-shrink: 0;
}

.stat-card.primary .stat-card-icon-wrapper { background: rgba(15, 39, 68, 0.1); color: var(--primary); }
.stat-card.secondary .stat-card-icon-wrapper { background: rgba(30, 91, 176, 0.1); color: var(--secondary); }
.stat-card.success .stat-card-icon-wrapper { background: rgba(16, 185, 129, 0.1); color: var(--accent-green); }
.stat-card.warning .stat-card-icon-wrapper { background: rgba(245, 158, 11, 0.1); color: #D97706; }
.stat-card.info .stat-card-icon-wrapper { background: rgba(2, 132, 199, 0.1); color: #0284C7; }

.stat-card-value {
    font-size: 1.85rem;
    font-weight: 800;
    color: var(--text-main);
    line-height: 1.1;
}

.stat-card-label {
    font-size: 0.86rem;
    color: var(--text-muted);
    font-weight: 600;
    margin-top: 4px;
}

/* Content Card */
.content-card {
    background: var(--bg-card);
    border-radius: 16px;
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-sm);
    margin-bottom: 24px;
    overflow: hidden;
}

.content-card-header {
    padding: 18px 24px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: #FAFCFE;
}

.content-card-title {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--primary);
    margin: 0;
    display: flex;
    align-items: center;
    gap: 10px;
}

.content-card-body {
    padding: 24px;
}

/* School Info Banner */
.school-info-banner {
    background: linear-gradient(135deg, #0F2744 0%, #1E5BB0 100%);
    color: white;
    padding: 20px 24px;
    border-radius: 16px;
    margin-bottom: 24px;
    box-shadow: var(--shadow-md);
    position: relative;
    overflow: hidden;
}

/* Form Controls */
.form-label {
    font-size: 0.88rem;
    font-weight: 700;
    color: #334155;
    margin-bottom: 6px;
}

.form-control, .form-select {
    padding: 10px 14px;
    font-size: 0.94rem;
    border: 1.5px solid var(--border-color);
    border-radius: 10px;
    transition: all 0.2s ease;
    background-color: #FFFFFF;
    text-align: right;
}

.form-control:focus, .form-select:focus {
    border-color: var(--secondary);
    box-shadow: 0 0 0 3px rgba(30, 91, 176, 0.15);
    background-color: #FFFFFF;
}

.form-control[readonly], .form-control:disabled, .form-select:disabled {
    background-color: #F8FAFC !important;
    color: #334155;
    border-color: #CBD5E1;
    font-weight: 600;
}

/* Upload Dropzone */
.upload-box {
    border: 2px dashed #CBD5E1;
    border-radius: 14px;
    padding: 22px 18px;
    text-align: center;
    background: #F8FAFC;
    transition: all 0.25s ease;
    cursor: pointer;
    position: relative;
    display: block;
}

.upload-box:hover {
    border-color: var(--secondary);
    background: #F0F7FF;
}

.upload-box.has-file {
    border-color: var(--accent-green);
    background: #F0FDF4;
}

.upload-icon {
    font-size: 2rem;
    color: var(--secondary);
    margin-bottom: 8px;
}

.upload-box.has-file .upload-icon {
    color: var(--accent-green);
}

.image-preview-container {
    max-width: 140px;
    max-height: 140px;
    margin: 10px auto;
    border-radius: 12px;
    overflow: hidden;
    border: 2px solid var(--border-color);
    box-shadow: var(--shadow-sm);
    display: none;
}

.image-preview-container img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* Tables */
.custom-table {
    width: 100%;
    margin-bottom: 0;
    vertical-align: middle;
    text-align: right;
}

.custom-table thead th {
    background-color: #F8FAFC;
    color: #475569;
    font-weight: 700;
    font-size: 0.82rem;
    padding: 14px 16px;
    border-bottom: 2px solid var(--border-color);
    white-space: nowrap;
}

.custom-table tbody td {
    padding: 14px 16px;
    font-size: 0.92rem;
    color: #334155;
    border-bottom: 1px solid var(--border-color);
    background-color: #FFFFFF;
}

.custom-table tbody tr:hover td {
    background-color: #F8FAFC;
}

.student-thumb {
    width: 46px;
    height: 46px;
    border-radius: 10px;
    object-fit: cover;
    border: 2px solid #E2E8F0;
    box-shadow: var(--shadow-sm);
}

/* Badges */
.badge {
    padding: 6px 10px;
    font-size: 0.78rem;
    font-weight: 700;
    border-radius: 8px;
}

/* Buttons */
.btn {
    padding: 9px 18px;
    font-weight: 700;
    border-radius: 10px;
    font-size: 0.92rem;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.btn-primary {
    background: linear-gradient(135deg, var(--secondary) 0%, #154586 100%);
    border: none;
    color: #ffffff;
    box-shadow: 0 4px 12px rgba(30, 91, 176, 0.25);
}

.btn-primary:hover {
    background: linear-gradient(135deg, #184C93 0%, #0F3263 100%);
    transform: translateY(-1px);
    box-shadow: 0 6px 16px rgba(30, 91, 176, 0.35);
}

.btn-gold {
    background: linear-gradient(135deg, var(--accent-gold) 0%, #B8860B 100%);
    color: #0F2744;
    border: none;
    font-weight: 800;
    box-shadow: 0 4px 12px rgba(212, 175, 55, 0.3);
}

.btn-gold:hover {
    background: linear-gradient(135deg, #E5C158 0%, #C99700 100%);
    color: #0F2744;
    transform: translateY(-1px);
}

/* Auth Pages - Clean Pure White Aesthetic */
.auth-bg {
    min-height: 100vh;
    background-color: #FFFFFF !important;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
}

.auth-card {
    width: 100%;
    max-width: 520px;
    background: #FFFFFF;
    border-radius: 22px;
    box-shadow: 0 12px 35px rgba(0, 0, 0, 0.08), 0 1px 3px rgba(0, 0, 0, 0.05);
    overflow: hidden;
    border: 1px solid #E2E8F0;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.auth-card:hover {
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.1);
}

.auth-header {
    background: #FFFFFF;
    padding: 32px 30px 20px 30px;
    text-align: center;
    color: #0F2744;
    border-bottom: 1px solid #F1F5F9;
}

.auth-logo-wrapper {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 0px;
    padding-bottom: 0px;
}

.auth-moe-logo {
    height: 165px;
    width: auto;
    max-width: 240px;
    object-fit: contain;
    filter: drop-shadow(0 6px 16px rgba(15, 39, 68, 0.14));
    transition: transform 0.3s ease;
    margin-bottom: 0px;
}

.auth-moe-logo:hover {
    transform: scale(1.03);
}

.auth-header h4 {
    color: #000000;
    font-weight: 800;
    font-size: 1.35rem;
    margin-top: 0px;
    margin-bottom: 2px;
}

.auth-header h5 {
    color: #1E5BB0;
    font-weight: 700;
    font-size: 1.15rem;
    margin-bottom: 4px;
}

.auth-header p {
    color: #64748B;
    font-size: 0.85rem;
}

.auth-body {
    padding: 30px 32px 36px 32px;
    background: #FFFFFF;
}

/* Document Cards */
.doc-card {
    border: 1px solid var(--border-color);
    border-radius: 14px;
    padding: 18px;
    background: #FFFFFF;
    transition: all 0.2s;
    height: 100%;
    display: flex;
    flex-direction: column;
}

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

.doc-preview-box {
    height: 160px;
    background: #F8FAFC;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 14px;
    overflow: hidden;
    border: 1px solid #E2E8F0;
}

.doc-preview-box img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.doc-preview-box i {
    font-size: 3.5rem;
    color: #94A3B8;
}

/* Print */
@media print {
    .app-sidebar, .app-topbar, .no-print, .btn, .pagination, .dataTables_filter {
        display: none !important;
    }
    body, .app-main, .page-content {
        background: white !important;
        padding: 0 !important;
        direction: rtl !important;
    }
    .print-header {
        display: block !important;
        text-align: center;
        margin-bottom: 25px;
        border-bottom: 2px solid #000;
        padding-bottom: 15px;
    }
    .content-card {
        border: none !important;
        box-shadow: none !important;
    }
}

/* Mobile */
@media (max-width: 992px) {
    .app-sidebar {
        position: fixed;
        right: -100%;
        left: auto;
        top: 0;
        bottom: 0;
        height: 100vh;
    }
    .app-sidebar.show {
        right: 0;
    }
    .sidebar-overlay {
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background: rgba(0,0,0,0.5);
        z-index: 1035;
        display: none;
    }
    .sidebar-overlay.show {
        display: block;
    }
    .page-content {
        padding: 16px;
    }
    .app-topbar {
        padding: 0 16px;
    }
}
