
@import url('https://fonts.googleapis.com/css2?family=Cairo:wght@300;400;600;700&display=swap');

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

body {
    font-family: 'Cairo', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    direction: rtl;
    font-size: 16px;
    line-height: 1.6;
}

.login-page {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.login-container {
    background: white;
    padding: 40px;
    border-radius: 20px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
    max-width: 450px;
    width: 100%;
    animation: fadeInUp 0.5s ease;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.login-container h1 {
    color: #667eea;
    margin-bottom: 30px;
    text-align: center;
    font-weight: 700;
    font-size: 28px;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    color: #333;
    font-weight: 600;
    font-size: 14px;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 14px 16px;
    border: 2px solid #e0e0e0;
    border-radius: 12px;
    font-size: 15px;
    transition: all 0.3s ease;
    font-family: 'Cairo', sans-serif;
    background-color: white;
}

.form-group select {
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23667eea' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6 9 12 15 18 9'%3e%3c/polyline%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: left 12px center;
    background-size: 20px;
    padding-left: 45px;
    cursor: pointer;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.form-group select option {
    padding: 10px;
    background-color: white;
    color: #333;
}

.btn {
    padding: 14px 32px;
    border: none;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    display: inline-block;
    font-family: 'Cairo', sans-serif;
}

.btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    width: 100%;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 25px rgba(102, 126, 234, 0.4);
}

.btn-success {
    background: linear-gradient(135deg, #11998e 0%, #38ef7d 100%);
    color: white;
}

.btn-success:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 25px rgba(17, 153, 142, 0.4);
}

.btn-danger {
    background: linear-gradient(135deg, #ee0979 0%, #ff6a00 100%);
    color: white;
}

.btn-danger:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 25px rgba(238, 9, 121, 0.4);
}

.btn-warning {
    background: linear-gradient(135deg, #f2994a 0%, #f2c94c 100%);
    color: #333;
}

.btn-info {
    background: linear-gradient(135deg, #3498db 0%, #2980b9 100%);
    color: white;
}

.btn-info:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 25px rgba(52, 152, 219, 0.4);
}

.alert {
    padding: 16px 20px;
    border-radius: 12px;
    margin-bottom: 20px;
    font-weight: 500;
    animation: slideIn 0.3s ease;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateX(20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.alert-error {
    background: #fee;
    color: #c33;
    border: 1px solid #fcc;
}

.alert-success {
    background: #efe;
    color: #3c3;
    border: 1px solid #cfc;
}

.install-note {
    margin-top: 20px;
    text-align: center;
    color: #666;
    font-size: 14px;
}

.install-note a {
    color: #667eea;
    text-decoration: none;
    font-weight: 600;
}

/* لوحة التحكم الجديدة */
.dashboard {
    background: #f5f7fa;
    min-height: 100vh;
    display: flex;
}

/* القائمة الجانبية */
.sidebar {
    width: 280px;
    background: linear-gradient(180deg, #2c3e50 0%, #34495e 100%);
    height: 100vh;
    position: fixed;
    right: 0;
    top: 0;
    overflow-y: auto;
    box-shadow: -2px 0 10px rgba(0,0,0,0.1);
    z-index: 1000;
    transition: all 0.3s ease;
}

.sidebar-header {
    padding: 25px 20px;
    background: rgba(0,0,0,0.2);
    border-bottom: 1px solid rgba(255,255,255,0.1);
}

.sidebar-header h2 {
    color: white;
    font-size: 20px;
    margin-bottom: 10px;
}

.sidebar-header .user-badge {
    display: inline-block;
    padding: 5px 12px;
    background: rgba(102, 126, 234, 0.3);
    border-radius: 20px;
    color: #fff;
    font-size: 12px;
    font-weight: 600;
}

.sidebar-menu {
    padding: 20px 0;
}

.menu-section {
    margin-bottom: 25px;
}

.menu-section-title {
    padding: 10px 20px;
    color: #95a5a6;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.menu-item {
    display: block;
    padding: 14px 20px;
    color: #ecf0f1;
    text-decoration: none;
    transition: all 0.3s ease;
    position: relative;
    font-weight: 500;
}

.menu-item:hover {
    background: rgba(255,255,255,0.1);
    color: white;
    padding-right: 25px;
}

.menu-item.active {
    background: linear-gradient(90deg, rgba(102, 126, 234, 0.3) 0%, transparent 100%);
    border-right: 4px solid #667eea;
    color: white;
}

.menu-item i {
    margin-left: 12px;
    width: 20px;
    display: inline-block;
}

.submenu {
    display: none;
    background: rgba(0,0,0,0.2);
    padding: 5px 0;
}

.submenu.active {
    display: block;
}

.submenu-item {
    display: block;
    padding: 10px 20px 10px 52px;
    color: #bdc3c7;
    text-decoration: none;
    font-size: 14px;
    transition: all 0.3s ease;
}

.submenu-item:hover {
    color: white;
    background: rgba(255,255,255,0.05);
}

.submenu-item.active {
    color: #667eea;
}

/* زر تبديل القائمة للموبايل */
.sidebar-toggle {
    display: none;
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 1001;
    background: #667eea;
    color: white;
    border: none;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(0,0,0,0.3);
}

/* المحتوى الرئيسي */
.main-content {
    margin-right: 280px;
    width: calc(100% - 280px);
    min-height: 100vh;
    transition: all 0.3s ease;
}

.navbar {
    background: white;
    padding: 20px 30px;
    box-shadow: 0 2px 20px rgba(0,0,0,0.08);
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 100;
}

.navbar h2 {
    color: #667eea;
    font-weight: 700;
    font-size: 24px;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.container {
    max-width: 1400px;
    margin: 30px auto;
    padding: 0 20px;
}

.stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 24px;
    margin-bottom: 30px;
}

.stat-card {
    background: white;
    padding: 28px;
    border-radius: 16px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.08);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.stat-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 30px rgba(0,0,0,0.15);
}

.stat-card h3 {
    color: #666;
    font-size: 14px;
    margin-bottom: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.stat-card .number {
    font-size: 36px;
    font-weight: 700;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.card {
    background: white;
    border-radius: 16px;
    padding: 28px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.08);
    margin-bottom: 24px;
    animation: fadeInUp 0.5s ease;
}

.card h2 {
    color: #333;
    margin-bottom: 24px;
    font-weight: 700;
    font-size: 22px;
}

table {
    width: 100%;
    border-collapse: collapse;
    overflow-x: auto;
    display: block;
}

@media (min-width: 768px) {
    table {
        display: table;
    }
}

table thead {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

table th,
table td {
    padding: 16px 12px;
    text-align: right;
    border-bottom: 1px solid #e0e0e0;
}

table th {
    color: white;
    font-weight: 600;
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

table tbody tr {
    transition: background 0.2s ease;
}

table tbody tr:hover {
    background: #f8f9fa;
}

.badge {
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    display: inline-block;
}

.badge-pending {
    background: #fff3cd;
    color: #856404;
}

.badge-in-progress {
    background: #d1ecf1;
    color: #0c5460;
}

.badge-completed {
    background: #d4edda;
    color: #155724;
}

.actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

/* Modal Styles */
#statusModal, #uploadModal, #editModal, .modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    overflow-y: auto;
    backdrop-filter: blur(4px);
}

.close {
    color: #aaa;
    float: left;
    font-size: 32px;
    font-weight: bold;
    cursor: pointer;
    line-height: 20px;
    transition: color 0.2s ease;
}

.close:hover,
.close:focus {
    color: #667eea;
}

.modal-content {
    background: white;
    padding: 32px;
    border-radius: 20px;
    max-width: 600px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    margin: 20px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
    animation: modalSlideIn 0.3s ease;
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: scale(0.9);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.modal-content .form-group {
    margin-bottom: 20px;
}

.modal-content select {
    width: 100%;
}

/* Progress Bar */
.progress-bar {
    position: relative;
    background: #e0e0e0;
    border-radius: 12px;
    height: 28px;
    overflow: hidden;
}

.progress {
    background: linear-gradient(90deg, #667eea, #764ba2);
    height: 100%;
    transition: width 0.3s ease;
    border-radius: 12px;
}

.progress-bar span {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: #333;
    font-weight: 700;
    font-size: 13px;
}

.btn-sm {
    padding: 8px 16px;
    font-size: 13px;
}

/* تحسين تنسيق الأزرار في الجداول */
table .actions {
    white-space: nowrap;
}

table .btn-sm {
    margin: 2px;
    display: inline-block;
}

/* تحسين تصميم القوائم في النماذج */
label.school-checkbox,
label {
    display: block;
    margin-bottom: 8px;
    cursor: pointer;
    font-weight: 500;
}

label input[type="checkbox"] {
    margin-left: 8px;
    cursor: pointer;
}

/* تحسينات للشاشات الصغيرة */
@media (max-width: 768px) {
    .sidebar {
        width: 280px;
        transform: translateX(100%);
    }
    
    .sidebar.active {
        transform: translateX(0);
    }
    
    .sidebar-toggle {
        display: block;
    }
    
    .main-content {
        margin-right: 0;
        width: 100%;
    }
    
    .navbar {
        flex-direction: column;
        gap: 15px;
        padding: 15px;
    }
    
    .navbar h2 {
        font-size: 20px;
    }
    
    .user-info {
        justify-content: center;
        width: 100%;
    }
    
    .modal-content {
        width: 95%;
        padding: 24px;
        margin: 10px;
    }
    
    .form-group select {
        font-size: 16px;
        padding: 12px;
    }
    
    table {
        font-size: 13px;
    }
    
    table th,
    table td {
        padding: 10px 6px;
    }
    
    .stats {
        grid-template-columns: 1fr;
    }
    
    .stat-card .number {
        font-size: 28px;
    }
    
    .btn {
        padding: 12px 24px;
        font-size: 14px;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 0 10px;
    }
    
    .card {
        padding: 20px;
        border-radius: 12px;
    }
    
    .login-container {
        padding: 30px 20px;
    }
    
    table th,
    table td {
        padding: 8px 4px;
        font-size: 12px;
    }
}

.form-group input[type="file"] {
    border: 2px dashed #ddd;
    padding: 30px;
    text-align: center;
    cursor: pointer;
    border-radius: 12px;
    transition: all 0.3s ease;
}

.form-group input[type="file"]:hover {
    border-color: #667eea;
    background: #f8f9ff;
}

/* تحسينات إضافية */
.install-note a:hover {
    text-decoration: underline;
}

/* تحسين عرض الجداول على الأجهزة المحمولة */
@media (max-width: 768px) {
    table {
        display: block;
        overflow-x: auto;
        white-space: nowrap;
    }
    
    table thead {
        display: table-header-group;
    }
    
    table tbody {
        display: table-row-group;
    }
}

/* أنماط للأيقونات والعناصر التفاعلية */
.btn:active {
    transform: scale(0.98);
}

.stat-card:nth-child(1)::before {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.stat-card:nth-child(2)::before {
    background: linear-gradient(135deg, #11998e 0%, #38ef7d 100%);
}

.stat-card:nth-child(3)::before {
    background: linear-gradient(135deg, #ee0979 0%, #ff6a00 100%);
}

.stat-card:nth-child(4)::before {
    background: linear-gradient(135deg, #f2994a 0%, #f2c94c 100%);
}

/* تحسين المسافات والهوامش */
.card + .card {
    margin-top: 24px;
}

/* تحسين شكل النماذج */
form {
    max-width: 100%;
}

/* إضافة تأثيرات سلسة للانتقالات */
* {
    transition: background-color 0.2s ease, border-color 0.2s ease;
}

button, a, input, select, textarea {
    transition: all 0.3s ease;
}

/* أيقونات القائمة */
.menu-item::before {
    content: '◆';
    margin-left: 10px;
    font-size: 10px;
    opacity: 0.6;
}

.sidebar-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    z-index: 999;
}

.sidebar-overlay.active {
    display: block;
}
