:root {
    --primary: #1a3a5c;
    --secondary: #2e7d32;
    --accent: #e8f5e9;
    --sidebar-width: 260px;
}

@font-face {
    font-family: 'IranSans';
    src: url('../fonts/IRANSansWeb(FaNum).eot') format('eot'),
         url('../fonts/IRANSansWeb(FaNum).woff') format('woff'),
         url('../fonts/IRANSansWeb(FaNum).ttf') format('ttf');
    font-weight: normal;
    font-style: normal;
}

* {
    font-family: 'IranSans', Tahoma, sans-serif;
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    background: #f0f4f8;
    color: #222;
    overflow: hidden;
}

.d-flex {
    display: flex !important;
}

/* Sidebar */
.sidebar {
    width: var(--sidebar-width);
    min-width: var(--sidebar-width);
    height: 100vh;
    background: var(--primary);
    position: fixed;
    right: 0;
    top: 0;
    overflow-y: auto;
    padding-top: 20px;
    z-index: 100;
}

.sidebar .logo {
    text-align: center;
    padding: 15px;
    border-bottom: 1px solid rgba(255,255,255,0.15);
    margin-bottom: 10px;
}

.sidebar .logo h5 {
    color: #fff;
    margin: 8px 0 0;
    font-size: 1rem;
}

.sidebar nav {
    display: flex;
    flex-direction: column;
    height: calc(100vh - 120px);
}

.sidebar .nav-link {
    color: rgba(255,255,255,0.8);
    padding: 12px 20px;
    display: flex;
    align-items: center;
    gap: 10px;
    transition: all 0.2s;
    border-right: 3px solid transparent;
    text-decoration: none;
}

.sidebar .nav-link:hover,
.sidebar .nav-link.active {
    color: #fff;
    background: rgba(255,255,255,0.1);
    border-right-color: #4caf50;
}

.sidebar .nav-link svg {
    flex-shrink: 0;
}

/* Main content */
.main-content {
    margin-right: var(--sidebar-width);
    padding: 30px;
    height: 100vh;
    width: calc(100% - var(--sidebar-width));
    overflow-y: auto;
}

/* Top bar */
.topbar {
    background: #fff;
    border-radius: 12px;
    padding: 15px 20px;
    margin-bottom: 25px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.topbar .student-name {
    font-weight: 600;
    color: var(--primary);
}

/* Cards */
.card {
    border: none;
    border-radius: 12px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.07);
    transition: transform 0.2s, box-shadow 0.2s;
}

.card:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(0,0,0,0.1);
}

.card-header {
    background: var(--primary);
    color: #fff;
    border-radius: 12px 12px 0 0 !important;
    font-weight: 600;
    padding: 14px 20px;
}

/* Lesson list */
.lesson-item {
    background: #fff;
    border-radius: 10px;
    padding: 16px 20px;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    box-shadow: 0 2px 6px rgba(0,0,0,0.05);
    transition: all 0.2s;
}

.lesson-item:hover {
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    transform: translateX(-3px);
}

.lesson-item .lesson-title {
    font-weight: 600;
    color: var(--primary);
}

.html-entry {
    text-align: left;
    direction: ltr;
}

/* Buttons */
.btn-primary {
    background: var(--primary);
    border-color: var(--primary);
}

.btn-primary:hover {
    background: #142d4a;
    border-color: #142d4a;
}

.btn-success {
    background: var(--secondary);
    border-color: var(--secondary);
}

/* Exam */
.question-card {
    background: #fff;
    border-radius: 10px;
    padding: 20px;
    margin-bottom: 16px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}

.question-card .question-num {
    background: var(--primary);
    color: #fff;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.85rem;
    margin-left: 10px;
}

.form-check-input:checked {
    background-color: var(--secondary);
    border-color: var(--secondary);
}

/* Login page */
.login-wrapper {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--primary) 0%, #2e7d32 100%);
}

.login-card {
    width: 100%;
    max-width: 400px;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
}

.login-card .card-header {
    text-align: center;
    padding: 30px 20px;
    font-size: 1.2rem;
}

/* Table */
.table th {
    background: var(--primary);
    color: #fff;
}

@media (max-width: 768px) {
    body {
        overflow: auto;
    }
    .sidebar { 
        display: none; 
    }
    .main-content { 
        margin-right: 0; 
        padding: 15px;
        width: 100%;
        height: auto;
    }
}
