/* لوحة تحكم احترافية للكمبيوتر */
/* =============================== */

/* إعادة تعيين شاملة */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

.dashboard-desktop {
    font-family: 'Tajawal', sans-serif;
    background: #f8fafc;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* الهيدر العلوي */
.dashboard-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 0.75rem 2rem;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 1000;
    min-height: 65px;
}

.dashboard-header .logo {
    display: flex;
    align-items: center;
    font-size: 1.5rem;
    font-weight: 700;
}

.dashboard-header .logo img {
    width: 40px;
    height: 40px;
    margin-left: 0.5rem;
    border-radius: 50%;
}

.header-search {
    flex: 1;
    max-width: 400px;
    margin: 0 2rem;
}

.header-search input {
    width: 100%;
    padding: 0.75rem 1rem;
    border: none;
    border-radius: 25px;
    background: rgba(255,255,255,0.15);
    color: white;
    backdrop-filter: blur(10px);
}

.header-search input::placeholder {
    color: rgba(255,255,255,0.7);
}

.header-search input:focus {
    outline: none;
    background: rgba(255,255,255,0.25);
}

.header-user {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.header-notifications {
    position: relative;
    cursor: pointer;
}

.header-notifications .badge {
    position: absolute;
    top: -5px;
    right: -5px;
    background: #ff4757;
    color: white;
    font-size: 0.7rem;
    padding: 2px 6px;
    border-radius: 10px;
}

.user-dropdown {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 8px;
    transition: background 0.3s;
}

.user-dropdown:hover {
    background: rgba(255,255,255,0.1);
}

/* تنسيق الإشعارات */
.header-notifications {
    position: relative;
    cursor: pointer;
}

.notifications-dropdown .notification-item {
    padding: 1rem;
    border-bottom: 1px solid #f8f9fa;
    transition: background 0.3s;
}

.notifications-dropdown .notification-item:hover {
    background: #f8f9fa;
}

.notifications-dropdown .notification-item:last-child {
    border-bottom: none;
}

.notification-icon {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: #f8f9fa;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-left: 1rem;
    flex-shrink: 0;
}

.notification-content {
    flex: 1;
}

.notification-content h6 {
    font-size: 0.9rem;
    font-weight: 600;
}

.notification-content p {
    font-size: 0.8rem;
    margin: 0;
}

.notification-content small {
    font-size: 0.75rem;
}

/* تنسيق قائمة المستخدم */
.user-dropdown .dropdown-menu {
    min-width: 250px;
    margin-top: 0.5rem;
}

.user-dropdown .dropdown-header {
    padding: 1rem;
    background: #f8f9fa;
}

.user-dropdown .dropdown-item {
    padding: 0.75rem 1rem;
    transition: all 0.3s;
}

.user-dropdown .dropdown-item:hover {
    background: #f8f9fa;
    color: #667eea;
}

.user-dropdown .dropdown-item.text-danger:hover {
    background: #fee;
    color: #dc3545;
}

.user-avatar {
    width: 35px;
    height: 35px;
    border-radius: 50%;
    border: 2px solid rgba(255,255,255,0.3);
}

/* المحتوى الرئيسي */
.dashboard-main {
    display: flex;
    flex: 1;
    min-height: calc(100vh - 80px);
}

/* القائمة الجانبية */
.dashboard-sidebar {
    width: 280px;
    background: white;
    box-shadow: 2px 0 10px rgba(0,0,0,0.05);
    border-left: 1px solid #e2e8f0;
    padding: 2rem 0;
    overflow-y: auto;
}

.sidebar-section {
    margin-bottom: 2rem;
}

.sidebar-section h6 {
    color: #718096;
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 1rem;
    padding: 0 1.5rem;
}

.sidebar-menu {
    list-style: none;
}

.sidebar-menu li {
    margin-bottom: 0.25rem;
}

.sidebar-menu a {
    display: flex;
    align-items: center;
    padding: 0.75rem 1.5rem;
    color: #4a5568;
    text-decoration: none;
    transition: all 0.3s;
    position: relative;
}

.sidebar-menu a:hover {
    background: #f7fafc;
    color: #667eea;
}

.sidebar-menu a.active {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-radius: 0 25px 25px 0;
    margin-left: 0.5rem;
}

.sidebar-menu a.active::before {
    content: '';
    position: absolute;
    right: 0;
    top: 0;
    height: 100%;
    width: 4px;
    background: #667eea;
}

.sidebar-menu i {
    width: 20px;
    text-align: center;
    margin-left: 0.75rem;
    font-size: 1.1rem;
}

/* منطقة المحتوى */
.dashboard-content {
    flex: 1;
    padding: 2rem;
    background: #f8fafc;
    overflow-y: auto;
}

/* بطاقات الإحصائيات */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.stat-card {
    background: white;
    padding: 1.5rem;
    border-radius: 12px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
    border: 1px solid #e2e8f0;
    transition: transform 0.3s, box-shadow 0.3s;
}

.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 20px rgba(0,0,0,0.1);
}

.stat-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.stat-icon {
    width: 50px;
    height: 50px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    color: white;
}

.stat-icon.videos {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.stat-icon.users {
    background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
}

.stat-icon.coins {
    background: linear-gradient(135deg, #ffd700 0%, #ffed4e 100%);
    color: #2d3748;
}

.stat-icon.views {
    background: linear-gradient(135deg, #ff6b6b 0%, #ffa500 100%);
}

.stat-value {
    font-size: 2.5rem;
    font-weight: 900;
    color: #2d3748;
    line-height: 1;
}

.stat-label {
    color: #718096;
    font-size: 0.9rem;
    margin-top: 0.5rem;
}

.stat-change {
    font-size: 0.8rem;
    font-weight: 600;
    margin-top: 0.5rem;
}

.stat-change.positive {
    color: #48bb78;
}

.stat-change.negative {
    color: #f56565;
}

/* شبكة المحتوى */
.content-grid {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 2rem;
    margin-bottom: 2rem;
}

/* بطاقة الرسوم البيانية */
.chart-card {
    background: white;
    padding: 2rem;
    border-radius: 12px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
    border: 1px solid #e2e8f0;
}

.chart-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.chart-title {
    font-size: 1.25rem;
    font-weight: 600;
    color: #2d3748;
}

.chart-filters {
    display: flex;
    gap: 0.5rem;
}

.filter-btn {
    padding: 0.5rem 1rem;
    border: 1px solid #e2e8f0;
    background: white;
    color: #4a5568;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s;
    font-size: 0.8rem;
}

.filter-btn.active {
    background: #667eea;
    color: white;
    border-color: #667eea;
}

.chart-container {
    height: 300px;
    position: relative;
}

/* بطاقة الأنشطة */
.activity-card {
    background: white;
    padding: 2rem;
    border-radius: 12px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
    border: 1px solid #e2e8f0;
}

.activity-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.activity-item {
    display: flex;
    align-items: center;
    padding: 1rem 0;
    border-bottom: 1px solid #f7fafc;
}

.activity-item:last-child {
    border-bottom: none;
}

.activity-icon {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-left: 1rem;
    font-size: 1.1rem;
    color: white;
}

.activity-icon.video {
    background: #667eea;
}

.activity-icon.user {
    background: #4facfe;
}

.activity-icon.coin {
    background: #ffd700;
    color: #2d3748;
}

.activity-content {
    flex: 1;
}

.activity-title {
    font-weight: 600;
    color: #2d3748;
    margin-bottom: 0.25rem;
}

.activity-description {
    color: #718096;
    font-size: 0.9rem;
}

.activity-time {
    color: #a0aec0;
    font-size: 0.8rem;
}

/* جدول البيانات */
.data-table {
    background: white;
    border-radius: 12px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
    border: 1px solid #e2e8f0;
    overflow: hidden;
}

.table-header {
    padding: 1.5rem 2rem;
    border-bottom: 1px solid #e2e8f0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.table-title {
    font-size: 1.25rem;
    font-weight: 600;
    color: #2d3748;
}

.table-actions {
    display: flex;
    gap: 1rem;
}

.table-search {
    position: relative;
}

.table-search input {
    padding: 0.5rem 1rem 0.5rem 2.5rem;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    font-size: 0.9rem;
}

.table-search i {
    position: absolute;
    left: 0.75rem;
    top: 50%;
    transform: translateY(-50%);
    color: #a0aec0;
}

.table-container {
    overflow-x: auto;
}

.data-table table {
    width: 100%;
    border-collapse: collapse;
}

.data-table th,
.data-table td {
    padding: 1rem 2rem;
    text-align: right;
    border-bottom: 1px solid #f7fafc;
}

.data-table th {
    background: #f8fafc;
    font-weight: 600;
    color: #4a5568;
    font-size: 0.9rem;
}

.data-table td {
    color: #2d3748;
}

/* حالات مختلفة */
.status-badge {
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
}

.status-badge.active {
    background: #c6f6d5;
    color: #276749;
}

.status-badge.inactive {
    background: #fed7d7;
    color: #c53030;
}

.status-badge.pending {
    background: #fef5e7;
    color: #d69e2e;
}

/* أزرار العمليات */
.action-buttons {
    display: flex;
    gap: 0.5rem;
}

.action-btn {
    padding: 0.5rem;
    border: none;
    background: none;
    color: #718096;
    cursor: pointer;
    border-radius: 4px;
    transition: all 0.3s;
}

.action-btn:hover {
    background: #f7fafc;
    color: #2d3748;
}

.action-btn.edit:hover {
    color: #667eea;
}

.action-btn.delete:hover {
    color: #f56565;
}

/* Loading states */
.loading-skeleton {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: loading 1.5s infinite;
}

@keyframes loading {
    0% {
        background-position: 200% 0;
    }
    100% {
        background-position: -200% 0;
    }
}

/* إعدادات متجاوبة */
@media (max-width: 1200px) {
    .dashboard-sidebar {
        width: 250px;
    }
    
    .content-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 992px) {
    .dashboard-sidebar {
        position: fixed;
        left: -280px;
        height: calc(100vh - 80px);
        z-index: 999;
        transition: left 0.3s;
    }
    
    .dashboard-sidebar.open {
        left: 0;
    }
    
    .dashboard-content {
        padding: 1rem;
    }
    
    .stats-grid {
        grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
        gap: 1rem;
    }
}

@media (max-width: 768px) {
    .dashboard-header {
        padding: 1rem;
    }
    
    .header-search {
        display: none;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
    }
    
    .data-table th,
    .data-table td {
        padding: 0.75rem 1rem;
    }
    
    .notifications-dropdown {
        width: 300px;
    }
}

/* إعدادات الإشعارات الحقيقية */
.header-notifications {
    position: relative;
}

.notification-badge {
    position: absolute;
    top: -8px;
    right: -8px;
    background: #dc3545;
    color: white;
    border-radius: 50%;
    font-size: 12px;
    min-width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
}

.notifications-dropdown {
    position: absolute;
    top: 100%;
    right: 0;
    width: 350px;
    max-height: 400px;
    overflow-y: auto;
    background: white;
    border-radius: 12px;
    box-shadow: 0 10px 25px rgba(0,0,0,0.15);
    z-index: 1000;
    border: 1px solid #e9ecef;
    color: #333;
}

.notifications-dropdown.show {
    display: block !important;
}

.notification-header {
    padding: 15px 20px;
    border-bottom: 1px solid #e9ecef;
    background: #f8f9fa;
    border-radius: 12px 12px 0 0;
    font-weight: 600;
}

.notification-item {
    padding: 15px 20px;
    border-bottom: 1px solid #f1f3f4;
    cursor: pointer;
    transition: background-color 0.2s;
    display: flex;
    align-items: flex-start;
    gap: 12px;
}

.notification-item:hover {
    background-color: #f8f9fa;
}

.notification-item:last-child {
    border-bottom: none;
}

.notification-icon {
    width: 35px;
    height: 35px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f8f9fa;
    flex-shrink: 0;
}

.notification-content {
    flex-grow: 1;
    min-width: 0;
}

.notification-text {
    font-size: 14px;
    line-height: 1.4;
    margin-bottom: 4px;
    color: #333;
}

.notification-time {
    font-size: 12px;
    color: #6c757d;
}

.notification-avatar {
    width: 35px;
    height: 35px;
    flex-shrink: 0;
}

.notification-avatar img {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
}

.notification-footer {
    padding: 12px 20px;
    border-top: 1px solid #e9ecef;
    background: #f8f9fa;
    border-radius: 0 0 12px 12px;
    text-align: center;
}

.view-all-notifications {
    color: #667eea;
    text-decoration: none;
    font-weight: 500;
    font-size: 14px;
}

.view-all-notifications:hover {
    color: #764ba2;
    text-decoration: underline;
}
