* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-color: #2196F3;
    --secondary-color: #4CAF50;
    --danger-color: #f44336;
    --warning-color: #ff9800;
    --dark-color: #212529;
    --light-color: #f8f9fa;
    --border-color: #dee2e6;
    --text-color: #212529;
    --text-muted: #6c757d;
    --sidebar-bg: #1e3a5f;
    --sidebar-hover: #2a4d75;
}

body {
    font-family: 'Vazirmatn', 'Tahoma', sans-serif;
    direction: rtl;
    text-align: right;
    background-color: #f5f5f5;
    color: var(--text-color);
    line-height: 1.6;
}

/* App Container */
.app-container {
    display: flex;
    min-height: 100vh;
}

/* Sidebar */
.sidebar {
    width: 280px;
    background-color: var(--sidebar-bg);
    color: white;
    display: flex;
    flex-direction: column;
    position: fixed;
    height: 100vh;
    right: 0;
    top: 0;
    box-shadow: -2px 0 10px rgba(0,0,0,0.1);
}

.sidebar-header {
    padding: 30px 20px;
    border-bottom: 1px solid rgba(255,255,255,0.1);
}

.sidebar-header h2 {
    font-size: 1.3rem;
    font-weight: 700;
    margin-bottom: 5px;
}

.sidebar-header p {
    font-size: 0.85rem;
    color: rgba(255,255,255,0.8);
}

.sidebar-nav {
    flex: 1;
    padding: 20px 0;
    overflow-y: auto;
}

.nav-item {
    display: flex;
    align-items: center;
    padding: 15px 20px;
    color: rgba(255,255,255,0.8);
    text-decoration: none;
    transition: all 0.3s;
    border-right: 3px solid transparent;
}

.nav-item i {
    width: 24px;
    margin-left: 15px;
    font-size: 1.1rem;
}

.nav-item:hover {
    background-color: var(--sidebar-hover);
    color: white;
}

.nav-item.active {
    background-color: white;
    color: var(--sidebar-bg);
    border-right-color: var(--primary-color);
    font-weight: 600;
}

.sidebar-footer {
    padding: 20px;
    border-top: 1px solid rgba(255,255,255,0.1);
}

.logout-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 12px 20px;
    background-color: var(--danger-color);
    color: white;
    text-decoration: none;
    border-radius: 6px;
    transition: all 0.3s;
    font-weight: 500;
}

.logout-btn i {
    margin-left: 10px;
}

.logout-btn:hover {
    background-color: #d32f2f;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.2);
}

/* Main Content */
.main-content {
    flex: 1;
    margin-right: 280px;
    padding: 30px;
    min-height: 100vh;
}

.main-content.full-width {
    margin-right: 0;
    max-width: 1200px;
    margin-left: auto;
    margin-right: auto;
}

/* Dashboard */
.dashboard-header {
    margin-bottom: 30px;
}

.header-title {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
}

.dashboard-header h1 {
    font-size: 2rem;
    font-weight: 700;
    color: var(--dark-color);
}

.welcome-message {
    color: var(--text-muted);
    font-size: 1rem;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.stat-card {
    background: white;
    border-radius: 12px;
    padding: 25px;
    display: flex;
    align-items: center;
    gap: 20px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    transition: transform 0.3s, box-shadow 0.3s;
}

.stat-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 4px 16px rgba(0,0,0,0.15);
}

.stat-card-orange {
    border-top: 4px solid #ff9800;
}

.stat-card-purple {
    border-top: 4px solid #9c27b0;
}

.stat-card-green {
    border-top: 4px solid #4CAF50;
}

.stat-card-blue {
    border-top: 4px solid #2196F3;
}

.stat-icon {
    width: 60px;
    height: 60px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.8rem;
    color: white;
}

.stat-card-orange .stat-icon {
    background: linear-gradient(135deg, #ff9800, #f57c00);
}

.stat-card-purple .stat-icon {
    background: linear-gradient(135deg, #9c27b0, #7b1fa2);
}

.stat-card-green .stat-icon {
    background: linear-gradient(135deg, #4CAF50, #388e3c);
}

.stat-card-blue .stat-icon {
    background: linear-gradient(135deg, #2196F3, #1976D2);
}

.stat-content {
    flex: 1;
}

.stat-label {
    color: var(--text-muted);
    font-size: 0.9rem;
    margin-bottom: 8px;
}

.stat-number {
    font-size: 2.2rem;
    font-weight: 700;
    color: var(--dark-color);
}

.dashboard-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

.guide-section {
    background: linear-gradient(135deg, #2196F3, #1976D2);
    color: white;
    padding: 30px;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.guide-section h2 {
    font-size: 1.5rem;
    margin-bottom: 20px;
    font-weight: 700;
}

.guide-list {
    list-style: none;
    counter-reset: step-counter;
    padding: 0;
    direction: rtl;
}

.guide-list li {
    counter-increment: step-counter;
    padding: 15px 50px 15px 0; /* space از راست */
    position: relative;
    font-size: 1rem;
    line-height: 1.8;
}

.guide-list li::before {
    content: counter(step-counter);
    position: absolute;
    right: 0;
    top: 15px;
    width: 35px;
    height: 35px;
    background: rgba(255,255,255,0.2);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 1.1rem;
}

.about-section {
    background: white;
    padding: 30px;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.about-section h2 {
    font-size: 1.5rem;
    margin-bottom: 25px;
    color: var(--dark-color);
    font-weight: 700;
}

.feature-list {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.feature-item {
    display: flex;
    align-items: flex-start;
    gap: 15px;
}

.feature-icon {
    width: 50px;
    height: 50px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    color: white;
    flex-shrink: 0;
}

.feature-icon-blue {
    background: linear-gradient(135deg, #2196F3, #1976D2);
}

.feature-icon-green {
    background: linear-gradient(135deg, #4CAF50, #388e3c);
}

.feature-icon-purple {
    background: linear-gradient(135deg, #9c27b0, #7b1fa2);
}

.feature-content h3 {
    font-size: 1.1rem;
    margin-bottom: 5px;
    color: var(--dark-color);
    font-weight: 600;
}

.feature-content p {
    color: var(--text-muted);
    font-size: 0.9rem;
}

/* Cards */
.card {
    background: white;
    border-radius: 8px;
    padding: 25px;
    margin-bottom: 20px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.card h2 {
    margin-bottom: 20px;
    color: var(--dark-color);
    border-bottom: 2px solid var(--primary-color);
    padding-bottom: 10px;
}

/* Forms */
.form {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.form-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
}

.form-group {
    display: flex;
    flex-direction: column;
}

.form-group label {
    margin-bottom: 5px;
    font-weight: 500;
    color: var(--text-color);
}

.form-group input,
.form-group select,
.form-group textarea {
    padding: 10px;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    font-family: 'Vazirmatn', 'Tahoma', sans-serif;
    font-size: 14px;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 2px rgba(33, 150, 243, 0.1);
}

.form-group small {
    color: var(--text-muted);
    font-size: 12px;
    margin-top: 5px;
}

/* Buttons */
.btn {
    padding: 10px 20px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-family: 'Vazirmatn', 'Tahoma', sans-serif;
    font-size: 14px;
    font-weight: 500;
    text-decoration: none;
    display: inline-block;
    transition: all 0.2s;
    text-align: center;
}

.btn-primary {
    background-color: var(--primary-color);
    color: white;
}

.btn-primary:hover {
    background-color: #1976D2;
}

.btn-secondary {
    background-color: var(--text-muted);
    color: white;
}

.btn-secondary:hover {
    background-color: #5a6268;
}

.btn-success {
    background-color: var(--secondary-color);
    color: white;
}

.btn-success:hover {
    background-color: #45a049;
}

.btn-danger {
    background-color: var(--danger-color);
    color: white;
}

.btn-danger:hover {
    background-color: #da190b;
}

.btn-sm {
    padding: 6px 12px;
    font-size: 12px;
}

/* Tables */
.data-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 15px;
}

.data-table thead {
    background-color: var(--light-color);
}

.data-table th,
.data-table td {
    padding: 12px;
    text-align: right;
    border-bottom: 1px solid var(--border-color);
}

.data-table th {
    font-weight: 600;
    color: var(--dark-color);
}

.data-table tbody tr:hover {
    background-color: #f8f9fa;
}

.table-responsive {
    overflow-x: auto;
}

/* Page Container */
.page-container {
    max-width: 1200px;
    margin: 0 auto;
}

.page-container h1 {
    margin-bottom: 20px;
    color: var(--dark-color);
}

/* Messages */
.messages {
    margin-bottom: 20px;
}

.message {
    padding: 12px 20px;
    border-radius: 4px;
    margin-bottom: 10px;
}

.error-message {
    background-color: #ffebee;
    color: #c62828;
    padding: 12px 20px;
    border-radius: 4px;
    margin-bottom: 15px;
    border-right: 4px solid var(--danger-color);
}

.success-message {
    background-color: #e8f5e9;
    color: #2e7d32;
    padding: 12px 20px;
    border-radius: 4px;
    margin-bottom: 15px;
    border-right: 4px solid var(--secondary-color);
}

/* Badges */
.badge {
    display: inline-block;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 500;
}

.badge-success {
    background-color: #e8f5e9;
    color: #2e7d32;
}

.badge-warning {
    background-color: #fff3e0;
    color: #e65100;
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.5);
    overflow: auto;
}

.modal-content {
    background-color: white;
    margin: 50px auto;
    padding: 30px;
    border-radius: 8px;
    width: 90%;
    max-width: 600px;
    position: relative;
}

.close {
    position: absolute;
    left: 20px;
    top: 20px;
    font-size: 28px;
    font-weight: bold;
    color: var(--text-muted);
    cursor: pointer;
}

.close:hover {
    color: var(--dark-color);
}

/* Answer Form */
.answer-form {
    margin-top: 20px;
}

.questions-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 15px;
    margin: 20px 0;
}

.question-item {
    background: var(--light-color);
    padding: 15px;
    border-radius: 8px;
    border: 1px solid var(--border-color);
}

.question-number {
    display: block;
    font-weight: 600;
    margin-bottom: 10px;
    color: var(--text-color);
}

.options-group {
    display: flex;
    gap: 10px;
    justify-content: space-around;
}

.option-label {
    display: flex;
    align-items: center;
    cursor: pointer;
    padding: 5px 10px;
    border-radius: 4px;
    transition: background 0.2s;
}

.option-label:hover {
    background: #e9ecef;
}

.option-label input[type="radio"] {
    margin-left: 5px;
}

.form-actions {
    margin-top: 30px;
    padding-top: 20px;
    border-top: 2px solid var(--border-color);
    display: flex;
    gap: 10px;
}

/* Login Page */
.login-page {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.login-container {
    width: 100%;
    max-width: 400px;
    padding: 20px;
}

.login-box {
    background: white;
    padding: 40px;
    border-radius: 10px;
    box-shadow: 0 10px 25px rgba(0,0,0,0.2);
}

.login-box h1 {
    text-align: center;
    margin-bottom: 30px;
    color: var(--dark-color);
}

/* Responsive */
@media (max-width: 1024px) {
    .dashboard-content {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .sidebar {
        width: 100%;
        height: auto;
        position: relative;
        transform: translateX(100%);
        transition: transform 0.3s;
    }
    
    .sidebar.open {
        transform: translateX(0);
    }
    
    .main-content {
        margin-right: 0;
        padding: 20px;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
    }
    
    .form-row {
        grid-template-columns: 1fr;
    }
    
    .questions-grid {
        grid-template-columns: 1fr;
    }
    
    .table-responsive {
        overflow-x: scroll;
    }
}
