﻿/* === أنماط لوحة التحكم === */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Tajawal', 'Arial', sans-serif;
    background-color: #f5f6fa;
    color: #2c3e50;
    line-height: 1.6;
    direction: rtl;
}

/* === شريط التنقل العلوي === */
.top-navbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    background: linear-gradient(135deg, #FF7B00 0%, #FF8C00 100%);
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    z-index: 1000;
    height: 70px;
}

.navbar-container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 100%;
    padding: 0 2rem;
}

.navbar-brand {
    display: flex;
    align-items: center;
    color: white;
    font-size: 1.2rem;
    font-weight: bold;
}

.navbar-brand .logo {
    width: 40px;
    height: 40px;
    margin-left: 10px;
    border-radius: 50%;
}

.user-dropdown {
    position: relative;
}

.user-btn {
    background: rgba(255,255,255,0.1);
    border: none;
    color: white;
    padding: 10px 15px;
    border-radius: 25px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.3s ease;
}

.user-btn:hover {
    background: rgba(255,255,255,0.2);
}

.dropdown-menu {
    position: absolute;
    top: 100%;
    right: 0;
    background: white;
    border-radius: 10px;
    box-shadow: 0 5px 20px rgba(0,0,0,0.15);
    min-width: 200px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.3s ease;
    margin-top: 10px;
}

.dropdown-menu.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.dropdown-menu a {
    display: flex;
    align-items: center;
    padding: 12px 16px;
    color: #2c3e50;
    text-decoration: none;
    transition: background 0.3s ease;
    gap: 10px;
}

.dropdown-menu a:hover {
    background: #f8f9fa;
}

.dropdown-divider {
    height: 1px;
    background: #e9ecef;
    margin: 5px 0;
}

/* === الشريط الجانبي === */
.sidebar {
    position: fixed;
    top: 70px;
    right: 0;
    width: 280px;
    height: calc(100vh - 70px);
    background: white;
    box-shadow: 2px 0 10px rgba(0,0,0,0.1);
    overflow-y: auto;
    z-index: 999;
}

.sidebar-header {
    padding: 2rem 1.5rem 1rem;
    border-bottom: 1px solid #e9ecef;
}

.sidebar-header h3 {
    color: #2c3e50;
    font-size: 1.3rem;
}

.sidebar-nav ul {
    list-style: none;
    padding: 1rem 0;
}

.sidebar-nav li a {
    display: flex;
    align-items: center;
    padding: 12px 1.5rem;
    color: #6c757d;
    text-decoration: none;
    transition: all 0.3s ease;
    gap: 12px;
    position: relative;
}

.sidebar-nav li a:hover,
.sidebar-nav li.active a {
    background: linear-gradient(90deg, rgba(255, 123, 0, 0.1) 0%, transparent 100%);
    color: #FF7B00;
}

.sidebar-nav li.active a::before {
    content: '';
    position: absolute;
    right: 0;
    top: 0;
    bottom: 0;
    width: 3px;
    background: #FF7B00;
}

.badge {
    background: #e74c3c;
    color: white;
    padding: 2px 6px;
    border-radius: 10px;
    font-size: 0.75rem;
    margin-right: auto;
}

/* === المحتوى الرئيسي === */
.main-content {
    margin-right: 280px;
    margin-top: 70px;
    padding: 2rem;
    min-height: calc(100vh - 70px);
}

.content-section {
    display: none;
}

.content-section.active {
    display: block;
}

.section-header {
    margin-bottom: 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.section-header h2 {
    font-size: 1.8rem;
    color: #2c3e50;
    margin: 0;
}

.section-header h3 {
    font-size: 1.5rem;
    color: #2c3e50;
    margin: 0 0 1rem 0;
}

.btn {
    padding: 10px 20px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-family: 'Tajawal', sans-serif;
    font-weight: 600;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.btn-primary {
    background: linear-gradient(135deg, #FF7B00 0%, #FF8C00 100%);
    color: white;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(255, 123, 0, 0.3);
}

.btn-secondary {
    background: #6c757d;
    color: white;
}

.btn-secondary:hover {
    background: #5a6268;
    transform: translateY(-2px);
}

/* === البطاقات الإحصائية === */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.stat-card {
    background: white;
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.08);
    padding: 1.5rem;
    display: flex;
    align-items: center;
    transition: transform 0.3s ease;
}

.stat-card:hover {
    transform: translateY(-5px);
}

.stat-icon {
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, #FF7B00 0%, #FF8C00 100%);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-left: 1rem;
    flex-shrink: 0;
}

.stat-icon i {
    color: white;
    font-size: 1.5rem;
}

.stat-content h3 {
    font-size: 2rem;
    margin: 0 0 0.5rem 0;
    color: #2c3e50;
}

.stat-content p {
    margin: 0;
    color: #6c757d;
    font-size: 0.9rem;
}

/* === قسم البرامج الحالية === */
.dashboard-section {
    background: white;
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.08);
    padding: 1.5rem;
    margin-bottom: 2rem;
}

.current-programs {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem;
}

.program-card {
    border: 1px solid #e9ecef;
    border-radius: 10px;
    overflow: hidden;
    transition: all 0.3s ease;
}

.program-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 15px rgba(0,0,0,0.1);
}

.program-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem;
    background: #f8f9fa;
    border-bottom: 1px solid #e9ecef;
}

.program-header h4 {
    margin: 0;
    font-size: 1.1rem;
    color: #2c3e50;
}

.status-badge {
    padding: 4px 10px;
    border-radius: 15px;
    font-size: 0.8rem;
    font-weight: 600;
}

.status-badge.active {
    background: #d4edda;
    color: #155724;
}

.status-badge.completed {
    background: #d1ecf1;
    color: #0c5460;
}

.status-badge.pending {
    background: #fff3cd;
    color: #856404;
}

.status-badge.cancelled {
    background: #f8d7da;
    color: #721c24;
}

.program-progress {
    padding: 1rem;
    display: flex;
    align-items: center;
    gap: 1rem;
}

.progress-bar {
    flex: 1;
    height: 8px;
    background: #e9ecef;
    border-radius: 4px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #FF7B00, #FF8C00);
    border-radius: 4px;
    transition: width 0.5s ease;
}

.progress-text {
    font-size: 0.9rem;
    color: #6c757d;
    white-space: nowrap;
}

.program-meta {
    display: flex;
    justify-content: space-between;
    padding: 0 1rem 1rem;
    font-size: 0.9rem;
    color: #6c757d;
}

.program-meta span {
    display: flex;
    align-items: center;
    gap: 5px;
}

.program-grade {
    padding: 0 1rem 1rem;
    font-size: 0.9rem;
    color: #6c757d;
    display: flex;
    align-items: center;
    gap: 5px;
}

/* === الأنشطة الحديثة === */
.activity-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.activity-item {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    padding: 1rem;
    background: #f8f9fa;
    border-radius: 8px;
    transition: background 0.3s ease;
}

.activity-item:hover {
    background: #e9ecef;
}

.activity-icon {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    background: rgba(102, 126, 234, 0.1);
}

.activity-icon i {
    font-size: 1rem;
}

.text-success {
    color: #FF7B00;
}

.text-warning {
    color: #ffc107;
}

.text-primary {
    color: #FF7B00;
}

.activity-content {
    flex: 1;
}

.activity-content p {
    margin: 0 0 0.5rem 0;
    color: #2c3e50;
}

.activity-time {
    font-size: 0.8rem;
    color: #6c757d;
}

/* === قسم البرامج === */
.programs-filter {
    display: flex;
    gap: 1rem;
    margin-bottom: 2rem;
    flex-wrap: wrap;
}

.filter-btn {
    padding: 8px 16px;
    background: #e9ecef;
    border: none;
    border-radius: 20px;
    cursor: pointer;
    font-family: 'Tajawal', sans-serif;
    transition: all 0.3s ease;
}

.filter-btn.active,
.filter-btn:hover {
    background: linear-gradient(135deg, #FF7B00 0%, #FF8C00 100%);
    color: white;
}

.programs-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 2rem;
}

.program-image {
    height: 180px;
    overflow: hidden;
}

.program-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.program-details {
    padding: 1rem;
}

.program-details .program-meta {
    display: flex;
    justify-content: space-between;
    padding: 0 0 1rem;
    border-bottom: 1px solid #e9ecef;
    margin-bottom: 1rem;
}

.program-details .program-meta span {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 0.9rem;
    color: #6c757d;
}

.program-dates {
    padding: 1rem 0;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    font-size: 0.9rem;
    color: #6c757d;
}

.program-dates span {
    display: flex;
    align-items: center;
    gap: 5px;
}

.program-actions {
    display: flex;
    gap: 1rem;
    padding: 1rem;
    border-top: 1px solid #e9ecef;
    background: #f8f9fa;
}

/* === قسم الدرجات === */
.grades-summary {
    display: grid;
    grid-template-columns: 1fr 2fr;
    gap: 2rem;
    margin-bottom: 2rem;
}

.grade-card {
    background: white;
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.08);
    padding: 2rem;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.grade-card h4 {
    margin: 0 0 1rem 0;
    color: #2c3e50;
}

.grade-circle {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    background: linear-gradient(135deg, #FF7B00 0%, #FF8C00 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1rem;
}

.grade-value {
    color: white;
    font-size: 2rem;
    font-weight: bold;
}

.grade-status span {
    padding: 5px 15px;
    border-radius: 20px;
    font-weight: 600;
}

.grade-status .excellent {
    background: #d4edda;
    color: #155724;
}

.grade-status .very-good {
    background: #d1ecf1;
    color: #0c5460;
}

.grade-status .good {
    background: #fff3cd;
    color: #856404;
}

.grade-status .acceptable {
    background: #cce5ff;
    color: #004085;
}

.grade-status .weak {
    background: #f8d7da;
    color: #721c24;
}

.grade-breakdown {
    background: white;
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.08);
    padding: 2rem;
}

.grade-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1.5rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid #e9ecef;
}

.grade-item:last-child {
    margin-bottom: 0;
    padding-bottom: 0;
    border-bottom: none;
}

.grade-item .subject {
    flex: 1;
    font-weight: 600;
    color: #2c3e50;
}

.grade-item .grade {
    font-weight: bold;
    min-width: 60px;
    text-align: center;
}

.grade-bar {
    flex: 2;
    height: 8px;
    background: #e9ecef;
    border-radius: 4px;
    overflow: hidden;
}

.grade-fill {
    height: 100%;
    background: linear-gradient(90deg, #FF7B00, #FF8C00);
    border-radius: 4px;
    transition: width 0.5s ease;
}

.grades-table {
    background: white;
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.08);
    overflow: hidden;
}

.grades-table table {
    width: 100%;
    border-collapse: collapse;
}

.grades-table th,
.grades-table td {
    padding: 1rem;
    text-align: right;
    border-bottom: 1px solid #e9ecef;
}

.grades-table th {
    background: #f8f9fa;
    font-weight: 600;
    color: #2c3e50;
}

.grades-table td {
    color: #6c757d;
}

.grade-badge {
    background: #d1ecf1;
    color: #0c5460;
    padding: 4px 10px;
    border-radius: 15px;
    font-size: 0.9rem;
    font-weight: 600;
}

/* === قسم المدفوعات === */
.payments-table {
    background: white;
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.08);
    overflow: hidden;
}

.payments-table table {
    width: 100%;
    border-collapse: collapse;
}

.payments-table th,
.payments-table td {
    padding: 1rem;
    text-align: right;
    border-bottom: 1px solid #e9ecef;
}

.payments-table th {
    background: #f8f9fa;
    font-weight: 600;
    color: #2c3e50;
}

.payments-table td {
    color: #6c757d;
}

/* === قسم الشهادات === */
.certificates-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
}

.certificate-card {
    background: white;
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.08);
    overflow: hidden;
    transition: transform 0.3s ease;
}

.certificate-card:hover {
    transform: translateY(-5px);
}

.certificate-header {
    background: linear-gradient(135deg, #FF7B00 0%, #FF8C00 100%);
    color: white;
    padding: 1.5rem;
    text-align: center;
}

.certificate-header i {
    font-size: 2rem;
    margin-bottom: 1rem;
}

.certificate-header h4 {
    margin: 0;
    font-size: 1.2rem;
}

.certificate-details {
    padding: 1.5rem;
}

.certificate-details p {
    margin: 0 0 0.8rem 0;
    display: flex;
    align-items: center;
    gap: 10px;
    color: #6c757d;
    font-size: 0.9rem;
}

.certificate-details i {
    width: 20px;
    color: #FF7B00;
}

.certificate-actions {
    display: flex;
    gap: 1rem;
    padding: 0 1.5rem 1.5rem;
}

/* === حالة فارغة === */
.empty-state {
    text-align: center;
    padding: 3rem 1rem;
    color: #6c757d;
}

.empty-state i {
    font-size: 3rem;
    margin-bottom: 1rem;
    color: #ced4da;
}

.empty-state h3 {
    margin: 0 0 1rem 0;
    color: #2c3e50;
}

.empty-state p {
    margin: 0 0 1.5rem 0;
    font-size: 1.1rem;
}

/* === نموذج طلب الشهادة === */
.certificate-request-form {
    background: white;
    border-radius: 10px;
    padding: 2rem;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
    margin-top: 2rem;
}

.certificate-request-form .form-group {
    margin-bottom: 1.5rem;
}

.certificate-request-form label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: #2c3e50;
}

.certificate-request-form .form-control {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid #ddd;
    border-radius: 5px;
    font-size: 1rem;
    transition: border-color 0.3s ease;
}

.certificate-request-form .form-control:focus {
    outline: none;
    border-color: #FF7B00;
    box-shadow: 0 0 0 3px rgba(255, 123, 0, 0.1);
}

.certificate-request-form textarea.form-control {
    resize: vertical;
    min-height: 100px;
}

.certificate-request-form .btn {
    padding: 0.75rem 1.5rem;
    font-size: 1rem;
    border-radius: 5px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 600;
}

.form-actions {
    margin-top: 1.5rem;
}

/* === أنماط النموذج المنبثق === */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1001;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-content {
    background: white;
    border-radius: 12px;
    box-shadow: 0 5px 30px rgba(0, 0, 0, 0.2);
    width: 90%;
    max-width: 500px;
    max-height: 90vh;
    overflow-y: auto;
}

.modal-header {
    padding: 1.5rem;
    border-bottom: 1px solid #e9ecef;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h3 {
    margin: 0;
    color: #2c3e50;
}

.close {
    font-size: 1.5rem;
    cursor: pointer;
    color: #6c757d;
}

.close:hover {
    color: #2c3e50;
}

.modal-body {
    padding: 1.5rem;
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: #2c3e50;
}

.form-control {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-family: 'Tajawal', sans-serif;
}

.form-control:focus {
    outline: none;
    border-color: #FF7B00;
    box-shadow: 0 0 0 3px rgba(255, 123, 0, 0.1);
}

.form-actions {
    display: flex;
    gap: 1rem;
    justify-content: flex-end;
}

.alert {
    padding: 1rem;
    border-radius: 8px;
    margin-bottom: 1rem;
}

.alert-info {
    background: #e3f2fd;
    border: 1px solid #bbdefb;
    color: #0d47a1;
}

.alert-success {
    background: #e8f5e9;
    border: 1px solid #c8e6c9;
    color: #2e7d32;
}

.alert-danger {
    background: #ffebee;
    border: 1px solid #ffcdd2;
    color: #c62828;
}

/* === التقويم === */
.schedule-calendar {
    background: white;
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.08);
    padding: 2rem;
    min-height: 400px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.calendar-placeholder {
    text-align: center;
    color: #6c757d;
}

.calendar-placeholder i {
    font-size: 3rem;
    margin-bottom: 1rem;
    color: #ced4da;
}

.calendar-placeholder h3 {
    margin: 0 0 1rem 0;
    color: #2c3e50;
}

/* === رسائل === */
.messages-list {
    background: white;
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.08);
    padding: 2rem;
    min-height: 400px;
}

/* === Responsive Design === */
@media (max-width: 992px) {
    .sidebar {
        width: 250px;
    }
    
    .main-content {
        margin-right: 250px;
    }
    
    .stats-grid {
        grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    }
    
    .grades-summary {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .sidebar {
        transform: translateX(100%);
        transition: transform 0.3s ease;
    }
    
    .sidebar.show {
        transform: translateX(0);
    }
    
    .main-content {
        margin-right: 0;
        padding: 1rem;
    }
    
    .section-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }
    
    .programs-grid {
        grid-template-columns: 1fr;
    }
    
    .certificate-actions {
        flex-direction: column;
    }
    
    .navbar-container {
        padding: 0 1rem;
    }
    
    .stat-card {
        padding: 1rem;
    }
    
    .stat-content h3 {
        font-size: 1.5rem;
    }
}

@media (max-width: 576px) {
    .top-navbar {
        height: 60px;
    }
    
    .sidebar {
        width: 100%;
        top: 60px;
        height: calc(100vh - 60px);
    }
    
    .main-content {
        margin-top: 60px;
        padding: 1rem;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
    }
    
    .current-programs {
        grid-template-columns: 1fr;
    }
    
    .programs-filter {
        flex-direction: column;
    }
    
    .filter-btn {
        width: 100%;
    }
    
    .program-actions {
        flex-direction: column;
    }
    
    .certificate-actions {
        flex-direction: column;
    }
    
    .form-actions {
        flex-direction: column;
    }
    
    .btn {
        width: 100%;
        justify-content: center;
    }
}
