/* ============================================================
   التصميم الرئيسي - Assala Gaming Store
   النسخة الاحترافية 2.0
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Cairo:wght@300;400;600;700;800;900&display=swap');

/* ============================================================
   المتغيرات العامة
   ============================================================ */
:root {
    /* الألوان الأساسية - تدرجات احترافية */
    --primary: #8b5cf6;
    --primary-dark: #6d28d9;
    --primary-light: #a78bfa;
    --primary-gradient: linear-gradient(135deg, #8b5cf6 0%, #6d28d9 50%, #4c1d95 100%);
    --primary-glow: rgba(139, 92, 246, 0.4);
    
    --secondary: #fbbf24;
    --secondary-dark: #d97706;
    --secondary-light: #fcd34d;
    --secondary-gradient: linear-gradient(135deg, #fbbf24 0%, #d97706 100%);
    
    --accent: #ec4899;
    --accent-dark: #be185d;
    --accent-gradient: linear-gradient(135deg, #ec4899 0%, #be185d 100%);
    
    --success: #10b981;
    --success-dark: #059669;
    --danger: #ef4444;
    --danger-dark: #dc2626;
    --warning: #f59e0b;
    --info: #3b82f6;
    
    /* الخلفيات */
    --bg-dark: #0b0e1a;
    --bg-card: rgba(255, 255, 255, 0.04);
    --bg-glass: rgba(255, 255, 255, 0.06);
    --bg-glass-hover: rgba(255, 255, 255, 0.10);
    
    /* النصوص */
    --text-primary: #ffffff;
    --text-secondary: #e2e8f0;
    --text-muted: #94a3b8;
    --text-dark: #1e293b;
    
    /* الحدود والظلال */
    --border-color: rgba(255, 255, 255, 0.08);
    --border-hover: rgba(139, 92, 246, 0.3);
    --shadow-color: rgba(139, 92, 246, 0.15);
    --shadow-lg: 0 25px 50px rgba(0, 0, 0, 0.5);
    
    /* الأبعاد */
    --header-height: 70px;
    --sidebar-width: 280px;
    --border-radius: 16px;
    --border-radius-sm: 10px;
    --border-radius-lg: 24px;
    --transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ============================================================
   إعادة تعيين القيم الافتراضية
   ============================================================ */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Cairo', sans-serif;
    background: var(--bg-dark);
    color: var(--text-primary);
    min-height: 100vh;
    overflow-x: hidden;
    line-height: 1.7;
}

/* ============================================================
   خلفية متحركة احترافية
   ============================================================ */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: 
        radial-gradient(ellipse at 10% 20%, rgba(139, 92, 246, 0.10) 0%, transparent 50%),
        radial-gradient(ellipse at 90% 80%, rgba(251, 191, 36, 0.06) 0%, transparent 50%),
        radial-gradient(ellipse at 50% 50%, rgba(236, 72, 153, 0.04) 0%, transparent 70%);
    z-index: -1;
    pointer-events: none;
    animation: bgPulse 20s ease-in-out infinite alternate;
}

@keyframes bgPulse {
    0% { opacity: 0.6; transform: scale(1); }
    50% { opacity: 1; transform: scale(1.02); }
    100% { opacity: 0.6; transform: scale(1); }
}

/* ============================================================
   تأثير الزجاج (Glassmorphism)
   ============================================================ */
.glass {
    background: var(--bg-glass);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    transition: var(--transition);
}

.glass:hover {
    background: var(--bg-glass-hover);
    border-color: var(--border-hover);
}

.glass-dark {
    background: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
}

/* ============================================================
   تأثير 3D للبطاقات
   ============================================================ */
.card-3d {
    perspective: 1000px;
    transform-style: preserve-3d;
    transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275), 
                box-shadow 0.4s ease;
    cursor: pointer;
}

.card-3d:hover {
    transform: translateY(-10px) rotateY(2deg) rotateX(2deg);
    box-shadow: 0 30px 60px rgba(0, 0, 0, 0.5), 0 0 40px var(--shadow-color);
}

/* ============================================================
   بطاقات المنتجات الاحترافية
   ============================================================ */
.product-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    overflow: hidden;
    transition: var(--transition);
    position: relative;
}

.product-card:hover {
    border-color: var(--primary);
    transform: translateY(-4px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4);
}

.product-card .image-container {
    position: relative;
    overflow: hidden;
    aspect-ratio: 1;
    background: rgba(0, 0, 0, 0.3);
}

.product-card .image-container img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.product-card:hover .image-container img {
    transform: scale(1.08);
}

.product-card .image-container::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(180deg, transparent 50%, rgba(0,0,0,0.6) 100%);
    opacity: 0;
    transition: var(--transition);
}

.product-card:hover .image-container::after {
    opacity: 1;
}

.product-card .badge {
    position: absolute;
    top: 12px;
    right: 12px;
    padding: 4px 14px;
    border-radius: 50px;
    font-size: 0.7rem;
    font-weight: 700;
    z-index: 2;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.product-card .badge.sale {
    background: linear-gradient(135deg, #ef4444, #dc2626);
    color: white;
    box-shadow: 0 4px 15px rgba(239, 68, 68, 0.4);
}

.product-card .badge.featured {
    background: var(--secondary-gradient);
    color: #1e293b;
    box-shadow: 0 4px 15px rgba(251, 191, 36, 0.4);
}

.product-card .badge.new {
    background: var(--primary-gradient);
    color: white;
    box-shadow: 0 4px 15px rgba(139, 92, 246, 0.4);
}

.product-card .badge.out-of-stock {
    background: rgba(100, 116, 139, 0.9);
    color: white;
    right: auto;
    left: 12px;
}

/* ============================================================
   الهيدر وشريط التواصل
   ============================================================ */
.social-bar {
    background: rgba(0, 0, 0, 0.4);
    border-bottom: 1px solid var(--border-color);
    font-size: 0.75rem;
}

.social-bar a {
    color: var(--text-muted);
    transition: var(--transition);
    text-decoration: none;
}

.social-bar a:hover {
    color: var(--primary-light);
    transform: translateY(-1px);
}

/* ============================================================
   السايدبار
   ============================================================ */
.sidebar {
    position: fixed;
    top: 0;
    right: -380px;
    width: 340px;
    height: 100%;
    background: var(--bg-dark);
    border-left: 1px solid var(--border-color);
    transition: right 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 999;
    padding: 2rem 1.5rem;
    overflow-y: auto;
}

.sidebar.open {
    right: 0;
}

.sidebar::-webkit-scrollbar {
    width: 4px;
}

.sidebar::-webkit-scrollbar-track {
    background: transparent;
}

.sidebar::-webkit-scrollbar-thumb {
    background: var(--primary);
    border-radius: 4px;
}

.overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(4px);
    z-index: 998;
    display: none;
    opacity: 0;
    transition: opacity 0.4s ease;
}

.overlay.active {
    display: block;
    opacity: 1;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 14px;
    border-radius: var(--border-radius-sm);
    color: var(--text-muted);
    transition: var(--transition);
    text-decoration: none;
    position: relative;
}

.nav-link:hover {
    background: rgba(139, 92, 246, 0.10);
    color: var(--text-primary);
    transform: translateX(-4px);
}

.nav-link.active {
    background: rgba(139, 92, 246, 0.15);
    color: var(--primary);
    border-right: 3px solid var(--primary);
}

.nav-link .icon {
    width: 24px;
    text-align: center;
    font-size: 1.1rem;
}

/* ============================================================
   شريط البحث
   ============================================================ */
.search-box {
    background: rgba(255, 255, 255, 0.06);
    border-radius: 50px;
    padding: 8px 16px;
    display: flex;
    align-items: center;
    gap: 10px;
    border: 1px solid var(--border-color);
    transition: var(--transition);
}

.search-box:focus-within {
    border-color: var(--primary);
    box-shadow: 0 0 30px rgba(139, 92, 246, 0.10);
    background: rgba(255, 255, 255, 0.08);
}

.search-box input {
    background: transparent;
    border: none;
    outline: none;
    color: var(--text-primary);
    width: 100%;
    font-size: 0.95rem;
}

.search-box input::placeholder {
    color: var(--text-muted);
}

/* ============================================================
   الأزرار
   ============================================================ */
.btn-primary {
    background: var(--primary-gradient);
    color: white;
    border: none;
    padding: 12px 28px;
    border-radius: var(--border-radius-sm);
    font-weight: 700;
    font-size: 1rem;
    cursor: pointer;
    transition: var(--transition);
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    box-shadow: 0 4px 15px rgba(139, 92, 246, 0.3);
}

.btn-primary:hover {
    transform: translateY(-2px) scale(1.02);
    box-shadow: 0 8px 30px rgba(139, 92, 246, 0.4);
}

.btn-primary:active {
    transform: scale(0.98);
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.08);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
    padding: 12px 28px;
    border-radius: var(--border-radius-sm);
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.12);
    border-color: var(--primary);
}

.btn-danger {
    background: linear-gradient(135deg, #ef4444, #dc2626);
    color: white;
    border: none;
    padding: 12px 28px;
    border-radius: var(--border-radius-sm);
    font-weight: 700;
    cursor: pointer;
    transition: var(--transition);
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    box-shadow: 0 4px 15px rgba(239, 68, 68, 0.3);
}

.btn-danger:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 30px rgba(239, 68, 68, 0.4);
}

.btn-success {
    background: linear-gradient(135deg, #10b981, #059669);
    color: white;
    border: none;
    padding: 12px 28px;
    border-radius: var(--border-radius-sm);
    font-weight: 700;
    cursor: pointer;
    transition: var(--transition);
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.btn-success:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 30px rgba(16, 185, 129, 0.4);
}

/* ============================================================
   رسائل التنبيه
   ============================================================ */
.flash-message {
    padding: 14px 20px;
    border-radius: var(--border-radius-sm);
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    animation: slideDown 0.5s ease;
    border: 1px solid transparent;
    backdrop-filter: blur(10px);
}

.flash-success {
    background: rgba(16, 185, 129, 0.15);
    border-color: #10b981;
    color: #6ee7b7;
}

.flash-error {
    background: rgba(239, 68, 68, 0.15);
    border-color: #ef4444;
    color: #fca5a5;
}

.flash-warning {
    background: rgba(251, 191, 36, 0.15);
    border-color: #fbbf24;
    color: #fcd34d;
}

.flash-info {
    background: rgba(59, 130, 246, 0.15);
    border-color: #3b82f6;
    color: #93c5fd;
}

@keyframes slideDown {
    0% { opacity: 0; transform: translateY(-20px); }
    100% { opacity: 1; transform: translateY(0); }
}

/* ============================================================
   أنيميشن
   ============================================================ */
.animate-fade-up {
    animation: fadeUp 0.8s ease-out forwards;
}

@keyframes fadeUp {
    0% { opacity: 0; transform: translateY(30px); }
    100% { opacity: 1; transform: translateY(0); }
}

.animate-fade-in {
    animation: fadeIn 0.6s ease-out forwards;
}

@keyframes fadeIn {
    0% { opacity: 0; }
    100% { opacity: 1; }
}

.animate-scale-in {
    animation: scaleIn 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
}

@keyframes scaleIn {
    0% { opacity: 0; transform: scale(0.8); }
    100% { opacity: 1; transform: scale(1); }
}

.animate-pulse-slow {
    animation: pulseSlow 3s ease-in-out infinite;
}

@keyframes pulseSlow {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.7; }
}

/* ============================================================
   نماذج الإدخال
   ============================================================ */
.form-input {
    width: 100%;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-sm);
    padding: 12px 16px;
    color: var(--text-primary);
    transition: var(--transition);
    font-size: 0.95rem;
}

.form-input:focus {
    border-color: var(--primary);
    outline: none;
    box-shadow: 0 0 20px rgba(139, 92, 246, 0.10);
    background: rgba(255, 255, 255, 0.08);
}

.form-input::placeholder {
    color: var(--text-muted);
}

.form-input.error {
    border-color: #ef4444;
    box-shadow: 0 0 20px rgba(239, 68, 68, 0.1);
}

.form-label {
    display: block;
    color: var(--text-secondary);
    margin-bottom: 6px;
    font-weight: 600;
    font-size: 0.9rem;
}

.form-label .required {
    color: #ef4444;
    margin-right: 4px;
}

/* ============================================================
   الجداول
   ============================================================ */
.table-wrapper {
    overflow-x: auto;
    border-radius: var(--border-radius);
    border: 1px solid var(--border-color);
    background: var(--bg-card);
}

.table-wrapper table {
    width: 100%;
    border-collapse: collapse;
    min-width: 600px;
}

.table-wrapper th {
    background: rgba(255, 255, 255, 0.06);
    padding: 14px 16px;
    text-align: right;
    font-weight: 700;
    color: var(--text-secondary);
    border-bottom: 1px solid var(--border-color);
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.table-wrapper td {
    padding: 12px 16px;
    border-bottom: 1px solid var(--border-color);
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.table-wrapper tr:last-child td {
    border-bottom: none;
}

.table-wrapper tr:hover td {
    background: rgba(255, 255, 255, 0.03);
}

/* ============================================================
   حالة الطلب
   ============================================================ */
.status-badge {
    display: inline-block;
    padding: 4px 14px;
    border-radius: 50px;
    font-size: 0.75rem;
    font-weight: 600;
}

.status-pending { background: rgba(251, 191, 36, 0.2); color: #fcd34d; }
.status-confirmed { background: rgba(59, 130, 246, 0.2); color: #60a5fa; }
.status-processing { background: rgba(139, 92, 246, 0.2); color: #a78bfa; }
.status-shipped { background: rgba(99, 102, 241, 0.2); color: #818cf8; }
.status-delivered { background: rgba(16, 185, 129, 0.2); color: #6ee7b7; }
.status-cancelled { background: rgba(239, 68, 68, 0.2); color: #fca5a5; }
.status-archived { background: rgba(255, 255, 255, 0.05); color: #94a3b8; }

/* ============================================================
   سلة التسوق
   ============================================================ */
.cart-badge {
    position: absolute;
    top: -8px;
    right: -8px;
    background: var(--primary-gradient);
    color: white;
    font-size: 0.65rem;
    font-weight: 700;
    min-width: 20px;
    height: 20px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 0 20px rgba(139, 92, 246, 0.4);
    padding: 0 4px;
}

/* ============================================================
   نصوص مميزة
   ============================================================ */
.glow-text {
    text-shadow: 0 0 30px rgba(139, 92, 246, 0.2);
}

.gradient-text {
    background: var(--primary-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.gradient-text-gold {
    background: var(--secondary-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* ============================================================
   تنسيق الصور
   ============================================================ */
.img-cover {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.img-contain {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.thumbnail {
    width: 48px;
    height: 48px;
    object-fit: cover;
    border-radius: 8px;
    border: 1px solid var(--border-color);
}

/* ============================================================
   تجاوب (Responsive)
   ============================================================ */
@media (max-width: 1024px) {
    .sidebar {
        width: 300px;
        right: -340px;
    }
}

@media (max-width: 768px) {
    .sidebar {
        width: 100%;
        right: -100%;
        padding: 1.5rem 1rem;
    }
    .sidebar.open {
        right: 0;
    }
    .search-box {
        max-width: 160px;
        padding: 6px 12px;
    }
    .search-box input {
        font-size: 0.85rem;
    }
    .product-card .image-container {
        aspect-ratio: 1;
    }
    .table-wrapper {
        border-radius: 12px;
    }
    .table-wrapper th,
    .table-wrapper td {
        padding: 8px 10px;
        font-size: 0.8rem;
    }
    .btn-primary, .btn-secondary, .btn-danger {
        padding: 10px 18px;
        font-size: 0.9rem;
    }
}

@media (max-width: 480px) {
    .search-box {
        max-width: 120px;
        padding: 4px 10px;
    }
    .search-box input {
        font-size: 0.75rem;
    }
    .social-bar {
        font-size: 0.65rem;
    }
    .social-bar span {
        display: none;
    }
    .product-card .badge {
        font-size: 0.6rem;
        padding: 2px 10px;
    }
}

/* ============================================================
   تخصيص السكرول بار
   ============================================================ */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

::-webkit-scrollbar-track {
    background: var(--bg-dark);
}

::-webkit-scrollbar-thumb {
    background: var(--primary);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--primary-dark);
}

/* ============================================================
   تحسينات الأداء والتفاعل
   ============================================================ */
* {
    -webkit-tap-highlight-color: transparent;
}

img {
    max-width: 100%;
    height: auto;
}

a {
    text-decoration: none;
}

button {
    cursor: pointer;
}

/* ============================================================
   تحسينات للطباعة
   ============================================================ */
@media print {
    .sidebar, .social-bar, .search-box, .nav-link {
        display: none !important;
    }
    body {
        background: white !important;
        color: black !important;
    }
    .glass {
        background: white !important;
        border: 1px solid #ddd !important;
        backdrop-filter: none !important;
    }
}