:root {
    --primary: #2563eb;
    --primary-dark: #1d4ed8;
    --secondary: #64748b;
    --success: #10b981;
    --warning: #f59e0b;
    --danger: #ef4444;
    --dark: #1e293b;
    --light: #f8fafc;
    --gray: #94a3b8;
    --border: #e2e8f0;
    --shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    --radius: 12px;
    --transition: all 0.3s ease;
}

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

body {
    font-family: 'Inter', 'Tajawal', sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: var(--dark);
    line-height: 1.6;
    min-height: 100vh;
}

[dir="rtl"] {
    text-align: right;
}

[dir="ltr"] {
    text-align: left;
}

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

/* شريط اللغة */
.language-bar {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    padding: 10px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.language-switcher {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
}

.language-switcher a {
    color: white;
    text-decoration: none;
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 0.9rem;
    transition: var(--transition);
    background: rgba(255, 255, 255, 0.1);
}

.language-switcher a.active,
.language-switcher a:hover {
    background: rgba(255, 255, 255, 0.2);
}

/* الهيدر */
.main-header {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    padding: 20px 0;
    box-shadow: var(--shadow);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    display: flex;
    align-items: center;
    gap: 15px;
}

.logo i {
    font-size: 2.5rem;
    color: var(--primary);
}

.logo-text h1 {
    font-size: 1.8rem;
    color: var(--dark);
    margin-bottom: 5px;
}

.logo-text p {
    color: var(--secondary);
    font-size: 0.9rem;
}

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

.nav-btn {
    padding: 12px 24px;
    border-radius: var(--radius);
    text-decoration: none;
    font-weight: 500;
    transition: var(--transition);
    display: flex;
    align-items: center;
    gap: 8px;
}

.nav-btn.primary {
    background: var(--primary);
    color: white;
}

.nav-btn.primary:hover {
    background: var(--primary-dark);
    transform: translateY(-2px);
    box-shadow: var(--shadow);
}

.nav-btn.secondary {
    background: var(--light);
    color: var(--dark);
    border: 2px solid var(--border);
}

.nav-btn.secondary:hover {
    background: white;
    border-color: var(--primary);
    transform: translateY(-2px);
}

/* قسم البطل */
.hero-section {
    padding: 80px 0;
    color: white;
}

.hero-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 60px;
    align-items: center;
}

.hero-text h2 {
    font-size: 3rem;
    margin-bottom: 20px;
    font-weight: 700;
}

.hero-text p {
    font-size: 1.2rem;
    margin-bottom: 30px;
    opacity: 0.9;
}

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

.btn {
    padding: 15px 30px;
    border-radius: var(--radius);
    text-decoration: none;
    font-weight: 500;
    transition: var(--transition);
    border: none;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 1rem;
}

.btn-primary {
    background: var(--success);
    color: white;
}

.btn-primary:hover {
    background: #0da271;
    transform: translateY(-2px);
    box-shadow: var(--shadow);
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.2);
    color: white;
    backdrop-filter: blur(10px);
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: translateY(-2px);
}

.btn-large {
    padding: 18px 36px;
    font-size: 1.1rem;
}

.hero-image {
    position: relative;
    height: 400px;
}

.floating-card {
    position: absolute;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    padding: 25px;
    border-radius: var(--radius);
    text-align: center;
    box-shadow: var(--shadow);
    border: 1px solid rgba(255, 255, 255, 0.2);
    animation: float 3s ease-in-out infinite;
}

.floating-card:nth-child(1) {
    top: 0;
    left: 0;
    animation-delay: 0s;
}

.floating-card:nth-child(2) {
    top: 50%;
    right: 0;
    transform: translateY(-50%);
    animation-delay: 1s;
}

.floating-card:nth-child(3) {
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    animation-delay: 2s;
}

.floating-card i {
    font-size: 2.5rem;
    margin-bottom: 15px;
    color: var(--success);
}

.floating-card h3 {
    font-size: 1.2rem;
    margin: 0;
}

@keyframes float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

/* المميزات */
.features-section {
    padding: 80px 0;
    background: white;
}

.section-title {
    text-align: center;
    font-size: 2.5rem;
    margin-bottom: 50px;
    color: var(--dark);
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 30px;
}

.feature-card {
    background: var(--light);
    padding: 40px 30px;
    border-radius: var(--radius);
    text-align: center;
    transition: var(--transition);
    border: 1px solid var(--border);
}

.feature-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg);
    border-color: var(--primary);
}

.feature-icon {
    width: 80px;
    height: 80px;
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 20px;
}

.feature-icon i {
    font-size: 2rem;
    color: white;
}

.feature-card h3 {
    font-size: 1.4rem;
    margin-bottom: 15px;
    color: var(--dark);
}

.feature-card p {
    color: var(--secondary);
    line-height: 1.6;
}

/* الإحصائيات */
.stats-section {
    padding: 80px 0;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

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

.stat-item {
    text-align: center;
    padding: 30px;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border-radius: var(--radius);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.stat-item i {
    font-size: 3rem;
    margin-bottom: 15px;
    color: var(--success);
}

.stat-number {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 5px;
}

.stat-label {
    font-size: 1.1rem;
    opacity: 0.9;
}

/* الفوتر */
.main-footer {
    background: var(--dark);
    color: white;
    padding: 50px 0 20px;
}

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

.footer-section h3,
.footer-section h4 {
    margin-bottom: 20px;
    color: var(--success);
}

.footer-section h3 i,
.footer-section h4 i {
    margin-right: 10px;
}

.footer-section p {
    margin-bottom: 10px;
    opacity: 0.8;
}

.footer-section a {
    display: block;
    color: white;
    text-decoration: none;
    margin-bottom: 8px;
    opacity: 0.8;
    transition: var(--transition);
}

.footer-section a:hover {
    opacity: 1;
    color: var(--success);
}

.footer-bottom {
    text-align: center;
    padding-top: 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    opacity: 0.7;
}

/* التجاوب */
@media (max-width: 768px) {
    .hero-content {
        grid-template-columns: 1fr;
        text-align: center;
    }
    
    .header-content {
        flex-direction: column;
        gap: 20px;
    }
    
    .hero-text h2 {
        font-size: 2rem;
    }
    
    .features-grid {
        grid-template-columns: 1fr;
    }
    
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .floating-card {
        position: relative;
        margin-bottom: 20px;
    }
    
    .hero-image {
        height: auto;
    }
}

/* لوحة الإدارة */
.admin-container {
    min-height: 100vh;
    background: #f8fafc;
}

.admin-sidebar {
    width: 280px;
    background: white;
    box-shadow: var(--shadow);
    position: fixed;
    height: 100vh;
    overflow-y: auto;
}

.admin-main {
    margin-right: 280px;
    min-height: 100vh;
}

.sidebar-header {
    padding: 30px 20px;
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: white;
    text-align: center;
}

.sidebar-header h2 {
    margin: 10px 0 5px;
    font-size: 1.3rem;
}

.sidebar-header p {
    opacity: 0.8;
    font-size: 0.9rem;
}

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

.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 15px 25px;
    color: var(--secondary);
    text-decoration: none;
    transition: var(--transition);
    border-right: 3px solid transparent;
}

.nav-item:hover,
.nav-item.active {
    background: var(--light);
    color: var(--primary);
    border-right-color: var(--primary);
}

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

.admin-content {
    padding: 30px;
}

.content-header {
    display: flex;
    justify-content: between;
    align-items: center;
    margin-bottom: 30px;
}

.content-header h1 {
    font-size: 2rem;
    color: var(--dark);
}

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

.stat-card {
    background: white;
    padding: 25px;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    border-left: 4px solid var(--primary);
}

.stat-card.warning {
    border-left-color: var(--warning);
}

.stat-card.success {
    border-left-color: var(--success);
}

.stat-card.danger {
    border-left-color: var(--danger);
}

.stat-card h3 {
    font-size: 0.9rem;
    color: var(--secondary);
    margin-bottom: 10px;
}

.stat-card .number {
    font-size: 2rem;
    font-weight: 700;
    color: var(--dark);
}

.data-table {
    background: white;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    overflow: hidden;
}

.table-header {
    padding: 20px;
    background: var(--light);
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: between;
    align-items: center;
}

.table-header h3 {
    margin: 0;
    color: var(--dark);
}

table {
    width: 100%;
    border-collapse: collapse;
}

th, td {
    padding: 15px 20px;
    text-align: right;
    border-bottom: 1px solid var(--border);
}

th {
    background: var(--light);
    font-weight: 600;
    color: var(--dark);
}

tr:hover {
    background: var(--light);
}

.badge {
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 500;
}

.badge.success {
    background: #dcfce7;
    color: #166534;
}

.badge.warning {
    background: #fef3c7;
    color: #92400e;
}

.badge.danger {
    background: #fee2e2;
    color: #991b1b;
}

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

.form-label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: var(--dark);
}

.form-control {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid var(--border);
    border-radius: var(--radius);
    font-family: inherit;
    font-size: 1rem;
    transition: var(--transition);
}

.form-control:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

/* زر التبديل */
.switch {
    position: relative;
    display: inline-block;
    width: 60px;
    height: 34px;
}

.switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #ccc;
    transition: .4s;
    border-radius: 34px;
}

.slider:before {
    position: absolute;
    content: "";
    height: 26px;
    width: 26px;
    left: 4px;
    bottom: 4px;
    background-color: white;
    transition: .4s;
    border-radius: 50%;
}

input:checked + .slider {
    background-color: var(--success);
}

input:checked + .slider:before {
    transform: translateX(26px);
}

/* أنماط القائمة الجانبية للموبايل */
.mobile-menu-btn {
    display: none;
    background: none;
    border: none;
    font-size: 1.5rem;
    color: var(--dark);
    cursor: pointer;
    padding: 10px;
}

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

.admin-sidebar.mobile-open {
    transform: translateX(0);
}

.sidebar-close {
    display: none;
    position: absolute;
    top: 15px;
    left: 15px;
    background: none;
    border: none;
    font-size: 1.5rem;
    color: white;
    cursor: pointer;
    z-index: 1001;
}

/* تنسيقات للهواتف */
@media (max-width: 1024px) {
    .mobile-menu-btn {
        display: block;
    }
    
    .admin-sidebar {
        position: fixed;
        left: -280px;
        top: 0;
        height: 100vh;
        z-index: 1000;
        transition: transform 0.3s ease;
        transform: translateX(-100%);
    }
    
    .admin-sidebar.mobile-open {
        transform: translateX(280px);
        left: 0;
    }
    
    .admin-main {
        margin-right: 0;
    }
    
    .sidebar-close {
        display: block;
    }
    
    .admin-content {
        padding: 20px 15px;
    }
    
    .content-header {
        flex-direction: column;
        gap: 15px;
        align-items: flex-start;
    }
    
    .stats-cards {
        grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
        gap: 15px;
    }
    
    .stat-card .number {
        font-size: 1.5rem;
    }
    
    .data-table {
        overflow-x: auto;
    }
    
    table {
        min-width: 600px;
    }
    
    th, td {
        padding: 10px 12px;
        font-size: 0.9rem;
    }
}

@media (max-width: 768px) {
    .admin-content {
        padding: 15px 10px;
    }
    
    .content-header h1 {
        font-size: 1.5rem;
    }
    
    .stats-cards {
        grid-template-columns: 1fr 1fr;
    }
    
    .stat-card {
        padding: 20px;
    }
    
    .stat-card .number {
        font-size: 1.3rem;
    }
    
    .charts-section {
        grid-template-columns: 1fr;
    }
    
    .chart-container {
        height: 300px;
    }
    
    .btn {
        padding: 10px 15px;
        font-size: 0.9rem;
    }
    
    .form-control {
        padding: 12px;
    }
}

@media (max-width: 480px) {
    .stats-cards {
        grid-template-columns: 1fr;
    }
    
    .content-header {
        text-align: center;
    }
    
    .content-header h1 {
        font-size: 1.3rem;
    }
    
    .header-actions {
        width: 100%;
        display: flex;
        justify-content: center;
    }
    
    .admin-content {
        padding: 10px 5px;
    }
    
    .table-header {
        flex-direction: column;
        gap: 10px;
        text-align: center;
    }
    
    .table-header h3 {
        font-size: 1.1rem;
    }
}

/* تحسينات للشاشات الصغيرة */
@media (max-width: 360px) {
    .admin-content {
        padding: 5px;
    }
    
    .stat-card {
        padding: 15px;
    }
    
    .stat-card .number {
        font-size: 1.2rem;
    }
    
    .btn {
        padding: 8px 12px;
        font-size: 0.8rem;
    }
}