/* استيراد خط عصري */
@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;600;800&display=swap');

/* المتغيرات (الألوان الأساسية) */
:root {
    --bg-dark: #09090b;
    --card-bg: #18181b;
    --accent-neon: #ff0055;
    --accent-blue: #00f0ff;
    --text-main: #f4f4f5;
    --text-muted: #a1a1aa;
}

body {
    font-family: 'Poppins', sans-serif;
    background-color: var(--bg-dark);
    color: var(--text-main);
    margin: 0;
    padding: 0;
    line-height: 1.6;
}

/* شريط التنقل */
header {
    background: rgba(24, 24, 27, 0.9);
    backdrop-filter: blur(10px);
    padding: 20px 5%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 2px solid var(--accent-neon);
    position: sticky;
    top: 0;
    z-index: 100;
}

header h1 {
    margin: 0;
    font-weight: 800;
    font-size: 28px;
    background: linear-gradient(90deg, var(--accent-neon), var(--accent-blue));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    text-transform: uppercase;
    letter-spacing: 2px;
}

nav a {
    color: var(--text-muted);
    text-decoration: none;
    margin-left: 30px;
    font-weight: 600;
    text-transform: uppercase;
    font-size: 14px;
    transition: all 0.3s ease;
}

nav a:hover {
    color: var(--text-main);
    text-shadow: 0 0 10px var(--accent-blue);
}

.container { padding: 40px 5%; }

/* شبكة البطاقات الاحترافية */
.card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 30px;
    margin-top: 30px;
}

.card {
    background-color: var(--card-bg);
    border-radius: 12px;
    overflow: hidden;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    border: 1px solid #27272a;
    position: relative;
}

.card:hover {
    transform: translateY(-10px);
    box-shadow: 0 10px 20px rgba(255, 0, 85, 0.2);
    border-color: var(--accent-neon);
}

.card img {
    width: 100%;
    height: 200px;
    object-fit: cover;
    border-bottom: 2px solid #27272a;
}

.card-content { padding: 20px; }
.card-title { margin: 0 0 10px 0; font-size: 20px; font-weight: 600; }
.card-desc { color: var(--text-muted); font-size: 14px; margin-bottom: 15px; }

/* عناصر الألعاب الإضافية (التقييم والمنصة) */
.badge {
    background: var(--accent-neon);
    color: white;
    padding: 5px 10px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: bold;
    display: inline-block;
    margin-bottom: 10px;
}

.platform { color: var(--accent-blue); font-size: 13px; font-weight: 600; }

/* لوحة التحكم الجديدة */
.admin-form {
    background-color: var(--card-bg);
    padding: 40px;
    border-radius: 12px;
    max-width: 600px;
    margin: 0 auto;
    border: 1px solid var(--accent-blue);
    box-shadow: 0 0 20px rgba(0, 240, 255, 0.1);
}

.admin-form input, .admin-form textarea, .admin-form select {
    width: 100%; padding: 12px; margin-bottom: 20px;
    background: var(--bg-dark); border: 1px solid #3f3f46;
    color: white; border-radius: 6px; box-sizing: border-box;
    font-family: 'Poppins', sans-serif;
}

.admin-form input:focus, .admin-form textarea:focus {
    outline: none; border-color: var(--accent-neon);
}

.admin-form button {
    background: linear-gradient(90deg, var(--accent-neon), var(--accent-blue));
    color: white; border: none; padding: 15px 20px; font-size: 16px;
    font-weight: bold; cursor: pointer; border-radius: 6px; width: 100%;
    text-transform: uppercase; transition: opacity 0.3s;
}

.admin-form button:hover { opacity: 0.8; }
/* --- شريط البحث في القائمة العلوية --- */
.search-box {
    margin-left: auto;
    display: flex;
    align-items: center;
}
.search-box input {
    background: #18181b;
    border: 1px solid #3f3f46;
    color: white;
    padding: 8px 15px;
    border-radius: 20px;
    outline: none;
    font-family: 'Poppins', sans-serif;
    transition: all 0.3s ease;
}
.search-box input:focus {
    border-color: var(--accent-blue);
    box-shadow: 0 0 10px rgba(0, 240, 255, 0.2);
    width: 250px;
}

/* --- الصفحة الرئيسية (Hero Section) --- */
.hero {
    height: 60vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    background: linear-gradient(rgba(9, 9, 11, 0.8), rgba(9, 9, 11, 0.9)), url('https://images.unsplash.com/photo-1542751371-adc38448a05e?q=80&w=2070&auto=format&fit=crop') center/cover;
    border-bottom: 2px solid var(--accent-neon);
    padding: 0 20px;
}
.hero h2 {
    font-size: 45px;
    margin-bottom: 10px;
    text-shadow: 0 0 20px var(--accent-neon);
}
.hero p {
    font-size: 18px;
    color: var(--text-muted);
    max-width: 600px;
    margin-bottom: 30px;
}
.btn-primary {
    background: var(--accent-neon);
    color: white;
    padding: 12px 30px;
    text-decoration: none;
    border-radius: 25px;
    font-weight: bold;
    text-transform: uppercase;
    transition: 0.3s;
}
.btn-primary:hover {
    box-shadow: 0 0 20px var(--accent-neon);
    transform: scale(1.05);
}

/* --- أزرار التعديل والحذف في لوحة التحكم --- */
.admin-list {
    margin-top: 40px;
    background: var(--card-bg);
    padding: 20px;
    border-radius: 12px;
}
.admin-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: var(--bg-dark);
    padding: 15px;
    margin-bottom: 10px;
    border-radius: 8px;
    border-left: 4px solid var(--accent-blue);
}
.action-btns button {
    padding: 5px 15px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-weight: bold;
    margin-left: 5px;
}
.btn-edit { background: var(--accent-blue); color: black; }
.btn-delete { background: var(--accent-neon); color: white; }
/* --- شاشة التحميل (Preloader) المحدثة --- */
#preloader {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background: var(--bg-dark); z-index: 9999;
    display: flex; justify-content: center; align-items: center;
    transition: opacity 0.5s ease;
}

/* الشعار النابض */
.loader-logo {
    width: 100px;
    height: 100px;
    animation: pulseGlow 1.5s ease-in-out infinite alternate;
}

/* حركة النبض وتغيير لون التوهج (من الوردي للأزرق) */
@keyframes pulseGlow {
    0% { 
        transform: scale(0.9); 
        filter: drop-shadow(0 0 10px var(--accent-neon)); 
    }
    100% { 
        transform: scale(1.1); 
        filter: drop-shadow(0 0 25px var(--accent-blue)); 
    }
}
/* --- تذييل الموقع (Footer) --- */
footer {
    background: #18181b; padding: 40px 5% 20px;
    border-top: 2px solid var(--accent-blue); margin-top: 50px;
}
.footer-content {
    display: flex; justify-content: space-between; flex-wrap: wrap; gap: 20px;
}
.footer-col { flex: 1; min-width: 200px; }
.footer-col h3 { color: var(--accent-blue); margin-bottom: 15px; }
.footer-col a {
    display: block; color: var(--text-muted); text-decoration: none;
    margin-bottom: 10px; transition: 0.3s;
}
.footer-col a:hover { color: var(--accent-neon); padding-left: 10px; }
.footer-bottom {
    text-align: center; color: var(--text-muted); margin-top: 30px;
    padding-top: 20px; border-top: 1px solid #27272a; font-size: 14px;
}

/* --- زر الصعود للأعلى --- */
#back-to-top {
    position: fixed; bottom: 30px; right: 30px;
    background: var(--accent-neon); color: white; width: 40px; height: 40px;
    border-radius: 50%; border: none; font-size: 20px; cursor: pointer;
    display: none; box-shadow: 0 0 15px var(--accent-neon); z-index: 1000;
}

/* --- صفحة التفاصيل والتعليقات --- */
.details-container { max-width: 800px; margin: 0 auto; background: var(--card-bg); padding: 30px; border-radius: 12px; }
.details-img { width: 100%; height: 400px; object-fit: cover; border-radius: 12px; margin-bottom: 20px; }
.comments-section { margin-top: 40px; border-top: 1px solid #27272a; padding-top: 20px; }
.comment-box { background: var(--bg-dark); padding: 15px; border-left: 3px solid var(--accent-blue); margin-bottom: 10px; border-radius: 4px; }
#comment-input { width: 100%; padding: 10px; background: var(--bg-dark); border: 1px solid #3f3f46; color: white; margin-bottom: 10px; border-radius: 4px; }
.btn-share { background: #1da1f2; color: white; border: none; padding: 10px 20px; border-radius: 20px; cursor: pointer; font-weight: bold; margin-top: 15px; }

/* جعل البطاقات قابلة للضغط */
.card { cursor: pointer; }
/* --- تصميم القائمة المنسدلة (Dropdown Menu) --- */
.dropdown {
    position: relative;
    display: inline-block;
}

/* 🪄 الجسر الخفي الذي يمنع اختفاء القائمة عند نزول الماوس */
.dropdown::after {
    content: "";
    position: absolute;
    bottom: -20px; /* يغطي الفراغ بين الزر والقائمة */
    left: 0;
    width: 100%;
    height: 20px;
    background: transparent; /* شفاف تماماً لا يُرى */
}

.dropdown .arrow {
    font-size: 10px;
    margin-left: 5px;
    color: var(--accent-neon);
}

.dropdown-content {
    display: none;
    position: absolute;
    background-color: var(--card-bg);
    min-width: 260px;
    box-shadow: 0px 10px 30px rgba(0, 0, 0, 0.8);
    z-index: 1000;
    border-radius: 8px;
    border: 1px solid var(--accent-blue);
    top: 100%;
    left: 0;
    overflow: hidden;
    margin-top: 15px; /* تركنا المسافة الأنيقة كما هي */
}

/* السهم الصغير الذي يربط القائمة بالزر */
.dropdown-content::before {
    content: "";
    position: absolute;
    top: -10px;
    left: 20px;
    border-width: 0 10px 10px 10px;
    border-style: solid;
    border-color: transparent transparent var(--accent-blue) transparent;
}

.dropdown-content a {
    color: var(--text-main);
    padding: 15px 20px;
    text-decoration: none;
    display: block;
    margin: 0;
    border-bottom: 1px solid #27272a;
    font-size: 14px;
    transition: all 0.3s ease;
}

.dropdown-content a:last-child {
    border-bottom: none;
}

.dropdown-content a:hover {
    background-color: #27272a;
    color: var(--accent-neon);
    padding-left: 25px; /* حركة جميلة عند تمرير الماوس */
}

/* إظهار القائمة عند تمرير الماوس */
.dropdown:hover .dropdown-content {
    display: block;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}