@font-face {
    font-family: IranSans;
    src: url(../font/IRANSans.ttf);
}
:root {
    --primary: #4361ee;
    --primary-light: #eef2ff;
    --primary-dark: #3a56d4;
    --secondary: #06d6a0;
    --secondary-light: #e6fcf5;
    --accent: #ff6b6b;
    --accent-light: #fff0f0;
    --warning: #ffd166;
    --warning-light: #fff9e6;
    --info: #4cc9f0;
    --info-light: #e6f7ff;
    --dark: #2d3748;
    --dark-light: #4a5568;
    --light: #f8fafc;
    --gray: #e2e8f0;
    --gray-light: #f1f5f9;
    --border: #e2e8f0;
    --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --radius: 12px;
    --radius-sm: 8px;
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-slow: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: IranSans;
    transition: 0.3s;
}
body {
    background-color: var(--light);
    color: var(--dark);
    direction: rtl;
    text-align: right;
    line-height: 1.6;
}
body.loading {
    overflow: hidden;
}
#loader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: var(--light);
    opacity: 1;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: opacity 0.6s ease, visibility 0.6s ease;
    z-index: 999999;
}
#loader.hidden {
    opacity: 0;
    visibility: hidden;
}
.spinner {
    width: 42px;
    height: 42px;
    border: 4px solid transparent;
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}
@keyframes spin {
    to { transform: rotate(360deg); }
}
.hide-student .student {
    display: none !important;
}
.hide-teacher .teacher {
    display: none !important;
}
.hide-admin .admin {
    display: none !important;
}
a {
    text-decoration: none;
    color: var(--primary);
}
.container {
    max-width: 1200px;
    margin: 32px auto;
    padding: 24px;
}
.back{
    margin-bottom: 16px;
    font-size: 16px;
    font-weight: 800;
}
.back:hover{
    transform: translateY(-4px);
}
.card {
    background-color: white;
    border-radius: 12px;
    box-shadow: var(--shadow);
    padding: 24px;
    margin-bottom: 24px;
}
.main-grid {
    display: grid;
    grid-template-columns: 3fr 1fr; 
    gap: 24px;
}
.profile-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.header-right{
    display: flex;
    gap: 16px;
}
.avatar-wrapper {
    position: relative;
    width: 100px;
    height: 100px;
    cursor: pointer;
}
.profile-avatar {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid var(--gray);
}
.edit-icon {
    position: absolute;
    bottom: 0;
    left: 0;
    background-color: var(--primary);
    color: white;
    border-radius: 50%;
    width: 30px;
    height: 30px;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 14px;
    border: 2px solid var(--gray);
    opacity: 0;
    transition: opacity 0.3s;
}
.profile-header.edit-mode .edit-icon {
    opacity: 1;
}
.profile-info{
    display: flex;
    flex-direction: column;
    justify-content: center;
}
.profile-info h1 {
    font-size: 24px;
    margin: 0;
}
.profile-info p {
    font-size: 16px;
    color: var(--dark);
    margin: 4px 0 0;
}
h2{
    font-size: 20px;
    margin-bottom: 24px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--gray);
}
h2 i{
    margin-left: 8px;
}
.form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
}
.form-group {
    display: flex;
    flex-direction: column;
}
.form-group label {
    font-size: 14px;
    font-weight: 800;
    margin-bottom: 4px;
    color: var(--dark);
}
.form-control {
    width: 100%;
    padding: 10px 16px;
    border: 1px solid var(--gray);
    border-radius: 8px;
    font-size: 16px;
    background-color: white;
    color: var(--dark);
    transition: all 0.2s;
}
.read-only .form-control[disabled] {
    background-color: var(--light);
    border-color: transparent;
    cursor: default;
}
.edit-mode .form-control:not([disabled]) {
    border-color: var(--primary);
    background-color: white;
}
.form-control:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(67, 97, 238, 0.2);
}
.action-buttons {
    display: flex;
    gap: 12px;
    justify-content: flex-start;
}
.btn {
    padding: 10px 20px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.2s;
}
.btn i{
    margin-left: 4px;
}
.btn-primary {
    background-color: var(--primary);
    color: white;
}
.btn-primary:hover {
    background-color: var(--primary-dark);
}
.btn-secondary {
    background-color: var(--light);
    color: var(--dark);
}
.btn-secondary:hover {
    background-color: #d1d5db;
}
#saveBtn, #cancelBtn {
    display: none;
}
.edit-mode #editBtn {
    display: none;
}
.edit-mode #saveBtn, .edit-mode #cancelBtn {
    display: block;
}
.chart-container {
    height: 300px;
}
@media (max-width: 768px) {
    .container{
        padding: 16px;
        padding-bottom: 0;
        margin-bottom: 0;
    }
    .main-grid {
        grid-template-columns: 1fr; 
        gap: 0;
    }
    .profile-header {
        align-items: start;
        flex-direction: column;
        gap: 16px;
    }
    .action-buttons{
        gap: 8px;
    }
    .btn {
        padding: 8px 12px;
        font-size: 12px;
    }
    .profile-info h1 {
        font-size: 20px;
    }
    .profile-info p {
        font-size: 12px;
    }
    h2{
        font-size: 18px;
    }
    .form-group label {
        font-size: 12px;
    }
    .form-control {
        padding: 6px 14px;
        font-size: 12px;
    }
    .chart-container {
        height: 240px;
    }
    .hide{
        display: none !important;
    }
    .card{
        padding: 16px 12px;
    }
}
@media (max-width: 425px) {
    .form-group{
        width: calc(100vw - 56px);
    }
    .details-section,
    .sidebar-section{
        width: calc(100vw - 32px);
    }
}
body.dark-mode {
    --light: #0f172a;
    --dark: #f8fafc;
    --dark-light: #cbd5e1;
    --gray-light: #1e293b;
    --border: #334155;
    --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.5);
    background-color: var(--light);
}
body.dark-mode .card,
body.dark-mode .stat-card{
    background: var(--gray-light) !important;
    color: #f8fafc;
    border-color: #334155;
}
body.dark-mode .form-control{
    background: var(--light) !important;
}