/* admin.css - أنماط لوحة التحكم (نسخة محدثة كاملة) */

/* ---------- الشريط العلوي ---------- */
.admin-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 60px;
    background: linear-gradient(135deg, #2c3e50 0%, #34495e 100%);
    color: white;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 20px;
    z-index: 1000;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.admin-logo {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 18px;
    font-weight: bold;
}

.admin-logo i {
    font-size: 24px;
    color: #3498db;
}

.admin-nav {
    display: flex;
    gap: 15px;
}

.admin-nav .nav-link {
    color: rgba(255,255,255,0.8);
    text-decoration: none;
    padding: 8px 15px;
    border-radius: 5px;
    transition: all 0.3s;
    background: none;
    border: none;
    cursor: pointer;
    font-size: 14px;
}

.admin-nav .nav-link:hover {
    color: white;
    background: rgba(255,255,255,0.1);
}

/* ---------- المحتوى الرئيسي ---------- */
.admin-main {
    display: flex;
    margin-top: 60px;
    min-height: calc(100vh - 60px);
}

/* ---------- الشريط الجانبي ---------- */
.admin-sidebar {
    width: 260px;
    background: #2c3e50;
    min-height: calc(100vh - 60px);
    position: fixed;
    right: 0;
    top: 60px;
    overflow-y: auto;
}

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

.menu-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 15px 20px;
    color: rgba(255,255,255,0.7);
    text-decoration: none;
    transition: all 0.3s;
    position: relative;
}

.menu-item:hover,
.menu-item.active {
    color: white;
    background: rgba(255,255,255,0.1);
}

.menu-item.active::before {
    content: '';
    position: absolute;
    right: 0;
    top: 0;
    bottom: 0;
    width: 4px;
    background: #3498db;
}

.menu-item i {
    width: 20px;
    text-align: center;
}

.menu-item .badge {
    margin-right: auto;
    background: #e74c3c;
    color: white;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 11px;
}

/* ---------- المحتوى ---------- */
.admin-content {
    flex: 1;
    margin-right: 260px;
    padding: 30px;
    background: #f5f7fa;
    min-height: calc(100vh - 60px);
}

.content-section {
    display: none;
}

.content-section.active {
    display: block;
}

.section-title {
    font-size: 24px;
    color: #2c3e50;
    margin-bottom: 25px;
    padding-bottom: 15px;
    border-bottom: 2px solid #e0e0e0;
}

/* ---------- الإحصائيات ---------- */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.stat-card {
    background: white;
    border-radius: 12px;
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 15px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.08);
    transition: all 0.3s;
}

.stat-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 4px 20px rgba(0,0,0,0.12);
}

.stat-icon {
    width: 60px;
    height: 60px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    color: white;
}

.stat-icon.blue { background: linear-gradient(135deg, #3498db, #2980b9); }
.stat-icon.orange { background: linear-gradient(135deg, #f39c12, #e67e22); }
.stat-icon.green { background: linear-gradient(135deg, #27ae60, #2ecc71); }
.stat-icon.purple { background: linear-gradient(135deg, #9b59b6, #8e44ad); }
.stat-icon.red { background: linear-gradient(135deg, #e74c3c, #c0392b); }

.stat-info {
    flex: 1;
}

.stat-number {
    font-size: 28px;
    font-weight: bold;
    color: #2c3e50;
}

.stat-label {
    font-size: 14px;
    color: #7f8c8d;
}

/* ---------- الرسوم البيانية ---------- */
.dashboard-charts {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 20px;
}

.chart-card {
    background: white;
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.08);
}

.chart-card h3 {
    font-size: 16px;
    color: #2c3e50;
    margin-bottom: 20px;
}

.chart-placeholder {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.chart-bar-container {
    background: #f5f7fa;
    border-radius: 8px;
    overflow: hidden;
    height: 35px;
}

.chart-bar {
    height: 100%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    display: flex;
    align-items: center;
    padding: 0 15px;
    color: white;
    font-size: 13px;
    transition: width 0.5s ease;
}

/* ---------- إجراءات القسم ---------- */
.section-actions {
    display: flex;
    gap: 15px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.section-actions .filter-group {
    flex: 1;
    min-width: 200px;
}

.section-actions input,
.section-actions select {
    width: 100%;
    padding: 10px 15px;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 14px;
}

/* ---------- الجداول ---------- */
.data-table {
    width: 100%;
    background: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(0,0,0,0.08);
}

.data-table th,
.data-table td {
    padding: 15px;
    text-align: right;
    border-bottom: 1px solid #eee;
}

.data-table th {
    background: #f8f9fa;
    font-weight: 600;
    color: #2c3e50;
    font-size: 13px;
    text-transform: uppercase;
}

.data-table tbody tr:hover {
    background: #f8f9fa;
}

.data-table img {
    width: 60px;
    height: 60px;
    object-fit: cover;
    border-radius: 8px;
}

.data-table .status-badge {
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 500;
}

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

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

.status-badge.rejected {
    background: #f8d7da;
    color: #721c24;
}

.data-table .actions {
    display: flex;
    gap: 5px;
}

.data-table .action-btn {
    padding: 6px 12px;
    border: none;
    border-radius: 5px;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.3s;
}

.action-btn.approve {
    background: #28a745;
    color: white;
}

.action-btn.reject {
    background: #dc3545;
    color: white;
}

.action-btn.delete {
    background: #6c757d;
    color: white;
}

.action-btn.view {
    background: #17a2b8;
    color: white;
}

.action-btn.feature {
    background: #ffc107;
    color: #333;
}

/* ---------- نماذج الإشعارات والإعدادات ---------- */
.notification-form,
.settings-form {
    background: white;
    border-radius: 12px;
    padding: 25px;
    max-width: 500px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.08);
}

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

.notification-form label,
.settings-form label {
    display: block;
    margin-bottom: 8px;
    font-size: 14px;
    color: #555;
    font-weight: 500;
}

.notification-form input,
.notification-form textarea,
.notification-form select,
.settings-form input {
    width: 100%;
    padding: 12px 15px;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 14px;
    transition: all 0.3s;
}

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

.settings-form label:has(input[type="checkbox"]) {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
}

.settings-form input[type="checkbox"] {
    width: auto;
}

/* ---------- المودالات ---------- */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.5);
    z-index: 2000;
    align-items: center;
    justify-content: center;
}

.modal.show {
    display: flex;
}

.modal-content {
    background: white;
    border-radius: 12px;
    padding: 25px;
    max-width: 400px;
    width: 90%;
    text-align: center;
}

.modal-content h3 {
    margin-bottom: 15px;
    color: #2c3e50;
}

.modal-content p {
    color: #666;
    margin-bottom: 20px;
}

.modal-actions {
    display: flex;
    gap: 10px;
    justify-content: center;
}

/* ---------- رسائل الإشعارات ---------- */
#notificationContainer {
    position: fixed;
    top: 80px;
    left: 20px;
    z-index: 3000;
}

.notification-toast {
    background: white;
    border-radius: 8px;
    padding: 15px 20px;
    margin-bottom: 10px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.15);
    display: flex;
    align-items: center;
    gap: 10px;
    animation: slideIn 0.3s ease;
    min-width: 250px;
}

.notification-toast.success {
    border-right: 4px solid #28a745;
}

.notification-toast.error {
    border-right: 4px solid #dc3545;
}

.notification-toast.info {
    border-right: 4px solid #17a2b8;
}

.notification-toast i {
    font-size: 20px;
}

.notification-toast.success i { color: #28a745; }
.notification-toast.error i { color: #dc3545; }
.notification-toast.info i { color: #17a2b8; }

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateX(-100%);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* ---------- التجاوبية ---------- */
@media (max-width: 1024px) {
    .admin-sidebar {
        width: 200px;
    }
    
    .admin-content {
        margin-right: 200px;
    }
}

@media (max-width: 768px) {
    .admin-sidebar {
        width: 100%;
        position: fixed;
        bottom: 0;
        top: auto;
        height: 60px;
        display: flex;
        overflow-x: auto;
        z-index: 1000;
    }
    
    .sidebar-menu {
        display: flex;
        padding: 0;
        width: 100%;
    }
    
    .menu-item {
        flex: 1;
        flex-direction: column;
        padding: 10px;
        gap: 5px;
        font-size: 11px;
    }
    
    .menu-item span {
        display: none;
    }
    
    .menu-item.active::before {
        display: none;
    }
    
    .menu-item .badge {
        position: absolute;
        top: 5px;
        right: 5px;
    }
    
    .admin-content {
        margin-right: 0;
        margin-bottom: 60px;
        padding: 20px;
    }
    
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .stat-card {
        padding: 15px;
    }
    
    .stat-icon {
        width: 45px;
        height: 45px;
        font-size: 18px;
    }
    
    .stat-number {
        font-size: 20px;
    }
    
    .dashboard-charts {
        grid-template-columns: 1fr;
    }
    
    .data-table {
        font-size: 12px;
    }
    
    .data-table th,
    .data-table td {
        padding: 10px;
    }
    
    .section-actions {
        flex-direction: column;
    }
    
    .section-actions .filter-group {
        min-width: 100%;
    }
}

@media (max-width: 480px) {
    .admin-header {
        padding: 0 15px;
    }
    
    .admin-logo span {
        display: none;
    }
    
    .admin-nav .nav-link span {
        display: none;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
    }
    
    .data-table {
        display: block;
        overflow-x: auto;
    }
}

/* ---------- الوضع المظلم ---------- */
body.dark-mode .admin-header {
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
}

body.dark-mode .admin-sidebar {
    background: #1a1a2e;
}

body.dark-mode .admin-content {
    background: #0f0f23;
}

body.dark-mode .stat-card,
body.dark-mode .chart-card,
body.dark-mode .data-table,
body.dark-mode .notification-form,
body.dark-mode .settings-form,
body.dark-mode .modal-content {
    background: #1a1a2e;
    color: #fff;
}

body.dark-mode .section-title,
body.dark-mode .chart-card h3,
body.dark-mode .modal-content h3 {
    color: #fff;
}

body.dark-mode .data-table th {
    background: #252540;
    color: #fff;
}

body.dark-mode .data-table tbody tr:hover {
    background: #252540;
}

body.dark-mode .stat-number {
    color: #fff;
}

body.dark-mode .notification-form label,
body.dark-mode .settings-form label {
    color: #ccc;
}

body.dark-mode .notification-form input,
body.dark-mode .notification-form textarea,
body.dark-mode .notification-form select,
body.dark-mode .settings-form input {
    background: #252540;
    color: #fff;
    border-color: #3d3d5c;
}
