/* ========== RESET & BASE ========== */
* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }
body, html { width: 100%; height: 100%; overflow: hidden; font-family: 'Tajawal', sans-serif; }
:root {
  --primary: #0891b2; --primary-dark: #0e7490; --primary-light: #67e8f9;
  --accent: #f59e0b; --accent-light: #fbbf24;
  --bg-dark: #0c1222; --bg-card: rgba(15,23,42,0.75); --bg-card-hover: rgba(30,41,59,0.85);
  --text: #e2e8f0; --text-muted: #94a3b8; --text-heading: #7dd3fc;
  --glass: rgba(15,23,42,0.92); --glass-light: rgba(255,255,255,0.04);
  --radius: 18px; --radius-sm: 12px; --shadow: 0 10px 40px rgba(0,0,0,0.35);
  --transition: 0.3s cubic-bezier(0.4,0,0.2,1);
  --gradient-card: linear-gradient(145deg, rgba(15,23,42,0.8), rgba(30,58,90,0.6));
  --border-subtle: rgba(125,211,252,0.1);
  --glow: 0 0 20px rgba(8,145,178,0.15);
}
body.light-mode {
  --bg-dark: #f0f9ff; --bg-card: rgba(255,255,255,0.9); --bg-card-hover: rgba(255,255,255,0.98);
  --text: #1e293b; --text-muted: #64748b; --text-heading: #0e7490;
  --glass: rgba(255,255,255,0.95); --glass-light: rgba(0,0,0,0.02);
  --border-subtle: rgba(14,116,144,0.12);
}

/* ========== LAYOUT ========== */
#gameContainer { width: 100%; height: 100%; position: relative; background: linear-gradient(180deg, #0c1222 0%, #0f172a 15%, #162033 40%, #0f1b2d 65%, #0c1222 85%, #080e1a 100%); }
#gameCanvas { position: fixed; top: 0; left: 0; width: 100%; height: 100%; z-index: 0; pointer-events: none; }
#ui-layer { position: relative; z-index: 1; width: 100%; height: 100%; overflow-y: auto; overflow-x: hidden; }
.hidden { display: none !important; }

/* ========== LOADING ========== */
#loadingScreen { position: fixed; top: 0; left: 0; width: 100%; height: 100%; z-index: 9999; background: linear-gradient(135deg, #0c1222, #0f172a); display: flex; align-items: center; justify-content: center; transition: opacity 0.8s; }
#loadingScreen.fade-out { opacity: 0; pointer-events: none; }
.loader-content { text-align: center; color: #fff; }

/* Ocean floor ambient */
#ui-layer::before { content: ''; position: fixed; top: 0; left: 0; width: 100%; height: 100%; z-index: -1; pointer-events: none; background: radial-gradient(ellipse at 25% 75%, rgba(8,145,178,0.12) 0%, transparent 55%), radial-gradient(ellipse at 75% 85%, rgba(14,116,144,0.1) 0%, transparent 50%), radial-gradient(ellipse at 50% 15%, rgba(103,232,249,0.06) 0%, transparent 40%), radial-gradient(circle at 80% 20%, rgba(245,158,11,0.04) 0%, transparent 30%); }
.loader-fish { font-size: 4em; animation: fishSwim 2s ease-in-out infinite; }
@keyframes fishSwim { 0%,100% { transform: translateX(0) scaleX(1); } 25% { transform: translateX(30px) scaleX(1); } 50% { transform: translateX(0) scaleX(-1); } 75% { transform: translateX(-30px) scaleX(-1); } }
.loader-content h2 { font-size: 2em; margin: 15px 0; color: var(--primary-light); }
.loader-bar { width: 200px; height: 4px; background: rgba(255,255,255,0.2); border-radius: 4px; margin: 0 auto; overflow: hidden; }
.loader-fill { width: 0; height: 100%; background: var(--primary-light); border-radius: 4px; animation: loadFill 2s ease forwards; }
@keyframes loadFill { to { width: 100%; } }

/* ========== TOP CONTROLS ========== */
#topControls { position: fixed; top: 15px; left: 15px; z-index: 500; display: flex; gap: 8px; }
#topControls button { width: 44px; height: 44px; border-radius: 50%; border: 2px solid var(--primary); background: var(--glass); color: var(--text); font-size: 1.2em; cursor: pointer; transition: var(--transition); backdrop-filter: blur(10px); }
#topControls button:hover { background: var(--primary); transform: scale(1.1); }
#topControls button.active { background: var(--accent); border-color: var(--accent); }

/* ========== EDIT TOOLBAR ========== */
#editToolbar { position: fixed; bottom: 0; left: 0; width: 100%; z-index: 500; background: linear-gradient(135deg, rgba(255,111,0,0.95), rgba(230,81,0,0.95)); backdrop-filter: blur(10px); padding: 10px 0; }
.toolbar-inner { display: flex; align-items: center; justify-content: center; gap: 12px; padding: 0 20px; flex-wrap: wrap; }
.toolbar-label { color: #fff; font-weight: 700; font-size: 0.95em; }
#editToolbar button { background: rgba(255,255,255,0.2); color: #fff; border: 1px solid rgba(255,255,255,0.3); padding: 8px 16px; border-radius: var(--radius-sm); cursor: pointer; font-family: inherit; font-size: 0.85em; transition: var(--transition); }
#editToolbar button:hover { background: rgba(255,255,255,0.35); }
.btn-close-toolbar { background: rgba(0,0,0,0.3) !important; }

/* ========== NAV ========== */
#navbar { position: sticky; top: 0; z-index: 400; background: var(--glass); backdrop-filter: blur(20px); border-bottom: 1px solid var(--border-subtle); transition: var(--transition); }
#navbar.scrolled { box-shadow: 0 4px 20px rgba(0,0,0,0.3); }
.nav-inner { display: flex; align-items: center; gap: 20px; padding: 12px 30px; max-width: 1400px; margin: 0 auto; }
.nav-brand { font-size: 1.4em; font-weight: 800; color: var(--primary-light); cursor: pointer; text-decoration: none; }
.nav-links { display: flex; gap: 4px; flex-wrap: wrap; flex: 1; }
.nav-links a, .nav-links .nav-link-single { color: var(--text); text-decoration: none; padding: 8px 14px; border-radius: var(--radius-sm); cursor: pointer; transition: var(--transition); font-size: 0.9em; font-weight: 500; white-space: nowrap; }
.nav-links a:hover, .nav-links a.active, .nav-links .nav-link-single:hover { background: rgba(77,208,225,0.15); color: var(--primary-light); }

/* Nav Dropdowns */
.nav-dropdown { position: relative; }
.nav-drop-btn { background: none; border: none; color: var(--text); padding: 8px 14px; border-radius: var(--radius-sm); cursor: pointer; font-family: inherit; font-size: 0.9em; font-weight: 600; transition: var(--transition); display: flex; align-items: center; gap: 4px; white-space: nowrap; }
.nav-drop-btn:hover { background: rgba(77,208,225,0.15); color: var(--primary-light); }
.nav-drop-arrow { font-size: 0.7em; transition: transform 0.3s; }
.nav-dropdown:hover .nav-drop-arrow { transform: rotate(180deg); }
.nav-drop-menu { position: absolute; top: 100%; right: 0; min-width: 180px; background: var(--glass); backdrop-filter: blur(20px); border: 1px solid rgba(77,208,225,0.15); border-radius: var(--radius-sm); padding: 6px; opacity: 0; visibility: hidden; transform: translateY(8px); transition: all 0.25s ease; z-index: 500; box-shadow: 0 12px 40px rgba(0,0,0,0.4); }
.nav-dropdown:hover .nav-drop-menu { opacity: 1; visibility: visible; transform: translateY(2px); }
.nav-drop-menu a { display: block; padding: 10px 16px; border-radius: 8px; color: var(--text); text-decoration: none; cursor: pointer; transition: var(--transition); font-size: 0.9em; }
.nav-drop-menu a:hover { background: rgba(77,208,225,0.15); color: var(--primary-light); }

/* Mobile nav groups */
.mobile-nav-group { margin: 2px 0; }
.mobile-nav-group-title { display: flex; align-items: center; justify-content: space-between; padding: 12px 20px; color: var(--text); font-weight: 600; cursor: pointer; border-radius: var(--radius-sm); transition: var(--transition); }
.mobile-nav-group-title:hover { background: rgba(77,208,225,0.15); }
.mobile-arrow { font-size: 0.7em; transition: transform 0.3s; }
.mobile-nav-group.open .mobile-arrow { transform: rotate(-90deg); }
.mobile-nav-sub { max-height: 0; overflow: hidden; transition: max-height 0.3s ease; padding-right: 15px; }
.mobile-nav-group.open .mobile-nav-sub { max-height: 300px; }
.nav-hamburger { display: none; font-size: 1.8em; color: var(--text); cursor: pointer; margin-right: auto; }
#mobileMenu { position: fixed; top: 60px; left: 0; width: 100%; background: var(--glass); backdrop-filter: blur(15px); z-index: 399; display: flex; flex-direction: column; padding: 10px; border-bottom: 1px solid rgba(77,208,225,0.15); }
#mobileMenu a { color: var(--text); padding: 12px 20px; text-decoration: none; border-radius: var(--radius-sm); cursor: pointer; transition: var(--transition); }
#mobileMenu a:hover { background: rgba(77,208,225,0.15); }
@media(max-width:900px) { .nav-links { display: none; } .nav-hamburger { display: block; } }

/* ========== SECTIONS ========== */
.site-section { padding: 60px 20px; max-width: 1400px; margin: 0 auto; opacity: 0; transform: translateY(30px); transition: opacity 0.7s, transform 0.7s; }
.site-section.visible { opacity: 1; transform: translateY(0); }
.section-header { text-align: center; margin-bottom: 40px; }
.section-header h2 { font-size: 2.2em; font-weight: 800; color: var(--text-heading); margin-bottom: 10px; }
.section-header p { color: var(--text-muted); font-size: 1.1em; max-width: 600px; margin: 0 auto; }
.section-divider { width: 80px; height: 4px; background: linear-gradient(90deg, var(--primary), var(--accent)); border-radius: 2px; margin: 12px auto; }

/* Edit controls on sections */
.edit-section-controls { display: none; margin-bottom: 15px; text-align: center; }
.edit-mode .edit-section-controls { display: flex; justify-content: center; gap: 8px; }
.edit-section-controls button { padding: 6px 14px; border-radius: 6px; border: none; cursor: pointer; font-family: inherit; font-size: 0.8em; }
.btn-edit-item { background: var(--accent); color: #fff; }
.btn-delete-item { background: #e53935; color: #fff; }
.btn-add-item { background: #43a047; color: #fff; }

/* Editable highlight */
.edit-mode [contenteditable="true"] { outline: 2px dashed var(--accent) !important; outline-offset: 3px; background: rgba(255,111,0,0.08); border-radius: 4px; cursor: text; min-height: 1em; }
.edit-mode .editable-img { position: relative; cursor: pointer; }
.edit-mode .editable-img::after { content: '📷 انقر لتغيير'; position: absolute; bottom: 5px; right: 5px; background: var(--accent); color: #fff; padding: 3px 8px; border-radius: 4px; font-size: 0.7em; }

/* ========== HERO / SLIDER ========== */
.hero-section { padding: 0; max-width: none; position: relative; overflow: hidden; min-height: 85vh; display: flex; align-items: center; justify-content: center; }
.hero-section.visible { opacity: 1; transform: none; }
.slider-container { width: 100%; min-height: 85vh; position: relative; }
.slide { position: absolute; top: 0; left: 0; width: 100%; height: 100%; display: flex; align-items: center; justify-content: center; opacity: 0; transition: opacity 1s ease; padding: 40px 20px; }
.slide.active { opacity: 1; z-index: 2; }
.slide-bg { position: absolute; top: 0; left: 0; width: 100%; height: 100%; z-index: 0; }
.slide-content { position: relative; z-index: 3; text-align: center; max-width: 800px; }
.slide-content h1 { font-size: 3.2em; font-weight: 900; color: #fff; margin-bottom: 15px; text-shadow: 0 4px 20px rgba(0,0,0,0.5); line-height: 1.3; }
.slide-content p { font-size: 1.3em; color: rgba(255,255,255,0.9); margin-bottom: 25px; text-shadow: 0 2px 10px rgba(0,0,0,0.4); line-height: 1.6; }
.slide-content .btn-hero { display: inline-block; padding: 14px 35px; background: linear-gradient(135deg, var(--primary), var(--primary-dark)); color: #fff; border: none; border-radius: 30px; font-size: 1.1em; font-weight: 700; cursor: pointer; transition: var(--transition); font-family: inherit; text-decoration: none; }
.slide-content .btn-hero:hover { transform: translateY(-3px); box-shadow: 0 8px 25px rgba(0,151,167,0.5); }
.slider-dots { position: absolute; bottom: 30px; left: 50%; transform: translateX(-50%); z-index: 10; display: flex; gap: 10px; }
.slider-dot { width: 14px; height: 14px; border-radius: 50%; background: rgba(255,255,255,0.4); cursor: pointer; transition: var(--transition); border: 2px solid transparent; }
.slider-dot.active { background: var(--primary-light); border-color: #fff; transform: scale(1.2); }
.slider-nav { position: absolute; top: 50%; z-index: 10; width: 48px; height: 48px; border-radius: 50%; background: rgba(0,0,0,0.4); color: #fff; border: none; font-size: 1.5em; cursor: pointer; transition: var(--transition); backdrop-filter: blur(5px); transform: translateY(-50%); }
.slider-nav:hover { background: var(--primary); }
.slider-nav.prev { right: 20px; }
.slider-nav.next { left: 20px; }

@media(max-width:768px) {
  .slide-content h1 { font-size: 2em; }
  .slide-content p { font-size: 1em; }
  .hero-section { min-height: 70vh; }
  .slider-container { min-height: 70vh; }
}

/* ========== CARDS GRID ========== */
.cards-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 24px; }
.card { background: var(--gradient-card); border-radius: var(--radius); padding: 28px; transition: var(--transition); border: 1px solid var(--border-subtle); position: relative; overflow: hidden; backdrop-filter: blur(10px); }
.card::before { content: ''; position: absolute; top: 0; right: 0; width: 100%; height: 3px; background: linear-gradient(90deg, var(--primary), var(--accent)); transform: scaleX(0); transition: transform 0.4s; transform-origin: right; }
.card:hover { transform: translateY(-8px); box-shadow: var(--shadow), var(--glow); border-color: var(--border-subtle); background: var(--bg-card-hover); }
.card:hover::before { transform: scaleX(1); }
.card-icon { font-size: 3em; margin-bottom: 12px; display: block; }
.card h3 { color: var(--text-heading); font-size: 1.25em; margin-bottom: 8px; font-weight: 700; }
.card p { color: var(--text-muted); font-size: 0.95em; line-height: 1.7; }
.card-badge { position: absolute; top: 15px; left: 15px; background: var(--accent); color: #fff; padding: 3px 10px; border-radius: 20px; font-size: 0.75em; font-weight: 700; }
.card-btn { display: inline-block; margin-top: 15px; padding: 8px 20px; background: linear-gradient(135deg, var(--primary), var(--primary-dark)); color: #fff; border: none; border-radius: 20px; cursor: pointer; transition: var(--transition); font-family: inherit; font-size: 0.9em; }
.card-btn:hover { transform: scale(1.05); box-shadow: 0 4px 15px rgba(0,151,167,0.4); }

/* ========== CREATURE CARDS ========== */
.creature-tabs { display: flex; gap: 8px; justify-content: center; margin-bottom: 30px; flex-wrap: wrap; }
.ctab { padding: 10px 22px; background: var(--bg-card); color: var(--text); border: 1px solid rgba(77,208,225,0.2); border-radius: 25px; cursor: pointer; transition: var(--transition); font-family: inherit; font-size: 0.95em; }
.ctab.active, .ctab:hover { background: var(--primary); color: #fff; border-color: var(--primary); }
.creature-card { text-align: center; cursor: pointer; }
.creature-card .creature-emoji { font-size: 4em; display: block; margin-bottom: 8px; transition: transform 0.3s; }
.creature-card:hover .creature-emoji { transform: scale(1.2) rotate(-5deg); }
.creature-card .creature-name { color: var(--text-heading); font-weight: 700; }
.creature-card .creature-status { font-size: 0.8em; margin-top: 4px; padding: 2px 10px; border-radius: 10px; display: inline-block; }
.status-stable { background: rgba(76,175,80,0.2); color: #81c784; }
.status-threatened { background: rgba(255,152,0,0.2); color: #ffb74d; }
.status-endangered { background: rgba(244,67,54,0.2); color: #ef5350; }
.status-unknown { background: rgba(158,158,158,0.2); color: #bdbdbd; }

/* ========== VIDEO CARDS ========== */
.video-card { cursor: pointer; overflow: hidden; }
.video-thumb { width: 100%; height: 180px; border-radius: var(--radius-sm); display: flex; align-items: center; justify-content: center; font-size: 4em; background: linear-gradient(135deg, rgba(0,77,120,0.8), rgba(0,150,136,0.6)); margin-bottom: 12px; position: relative; }
.video-thumb::after { content: '▶'; position: absolute; font-size: 0.5em; background: rgba(255,255,255,0.9); color: var(--primary-dark); width: 50px; height: 50px; border-radius: 50%; display: flex; align-items: center; justify-content: center; opacity: 0; transition: var(--transition); }
.video-card:hover .video-thumb::after { opacity: 1; }
.video-card h3 { color: var(--text-heading); margin-bottom: 5px; }

/* ========== STATS ========== */
.stats-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 20px; }
.stat-card { background: var(--gradient-card); border-radius: var(--radius); padding: 30px; text-align: center; border: 1px solid var(--border-subtle); backdrop-filter: blur(10px); transition: var(--transition); }
.stat-card:hover { transform: translateY(-4px); box-shadow: var(--glow); }
.stat-icon { font-size: 2.5em; margin-bottom: 10px; }
.stat-number { font-size: 2.8em; font-weight: 900; color: var(--primary-light); margin-bottom: 5px; }
.stat-label { color: var(--text-muted); font-size: 1em; }

/* ========== MODAL ========== */
.modal { position: fixed; top: 0; left: 0; width: 100%; height: 100%; z-index: 1000; display: flex; align-items: center; justify-content: center; padding: 20px; }
.modal-overlay { position: absolute; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0,0,0,0.7); backdrop-filter: blur(5px); }
.modal-content { position: relative; background: var(--glass); backdrop-filter: blur(20px); border-radius: var(--radius); padding: 30px; max-width: 600px; width: 100%; max-height: 85vh; overflow-y: auto; color: var(--text); border: 1px solid rgba(77,208,225,0.2); animation: modalIn 0.3s ease; }
.modal-video { max-width: 850px; }
@keyframes modalIn { from { opacity: 0; transform: scale(0.9) translateY(20px); } to { opacity: 1; transform: scale(1) translateY(0); } }
.modal-close { position: absolute; top: 12px; left: 12px; width: 36px; height: 36px; border-radius: 50%; background: rgba(244,67,54,0.8); color: #fff; border: none; font-size: 1.1em; cursor: pointer; transition: var(--transition); z-index: 10; }
.modal-close:hover { background: #e53935; transform: scale(1.1); }
.modal-content h3 { color: var(--text-heading); font-size: 1.6em; margin-bottom: 15px; }
.modal-content .modal-emoji { font-size: 5em; text-align: center; display: block; margin-bottom: 15px; }
.modal-content .modal-info { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 15px 0; }
.modal-content .info-item { background: var(--glass-light); padding: 10px; border-radius: var(--radius-sm); }
.modal-content .info-item label { color: var(--text-muted); font-size: 0.85em; display: block; }
.modal-content .info-item span { color: var(--text-heading); font-weight: 700; }
.modal-content iframe { width: 100%; height: 400px; border: none; border-radius: var(--radius-sm); }
#importTextarea { width: 100%; min-height: 200px; background: rgba(0,0,0,0.3); color: var(--text); border: 1px solid var(--primary); border-radius: var(--radius-sm); padding: 12px; font-family: monospace; font-size: 0.85em; margin: 15px 0; resize: vertical; }

/* ========== BUTTONS ========== */
.btn-primary { display: inline-block; padding: 12px 28px; background: linear-gradient(135deg, var(--primary), var(--primary-dark)); color: #fff; border: none; border-radius: 25px; font-size: 1em; font-weight: 700; cursor: pointer; transition: var(--transition); font-family: inherit; }
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 6px 20px rgba(0,151,167,0.4); }
.btn-outline { display: inline-block; padding: 10px 24px; background: transparent; color: var(--primary-light); border: 2px solid var(--primary); border-radius: 25px; font-size: 0.95em; cursor: pointer; transition: var(--transition); font-family: inherit; }
.btn-outline:hover { background: rgba(0,151,167,0.15); }

/* ========== BLOG / ARTICLES ========== */
.article-card .article-date { color: var(--text-muted); font-size: 0.8em; margin-bottom: 8px; }
.article-card .article-tag { background: rgba(0,151,167,0.2); color: var(--primary-light); padding: 2px 10px; border-radius: 10px; font-size: 0.75em; display: inline-block; margin-top: 10px; }

/* ========== EBOOKS ========== */
.ebook-card .ebook-cover { font-size: 4em; margin-bottom: 10px; display: block; }
.ebook-card .ebook-cover-img { width: 100%; height: 200px; object-fit: cover; border-radius: var(--radius-sm); margin-bottom: 12px; }
.ebook-card .ebook-author { color: var(--text-muted); font-size: 0.85em; }
.ebook-card .ebook-pages { color: var(--text-muted); font-size: 0.8em; margin-top: 5px; }

/* ========== PROJECTS ========== */
.project-card .project-progress { width: 100%; height: 8px; background: rgba(255,255,255,0.1); border-radius: 4px; margin-top: 12px; overflow: hidden; }
.project-card .project-progress-fill { height: 100%; background: linear-gradient(90deg, var(--primary), var(--primary-light)); border-radius: 4px; transition: width 1s ease; }
.project-card .project-percent { color: var(--primary-light); font-weight: 700; font-size: 0.9em; margin-top: 5px; text-align: left; }

/* ========== SCROLL TOP ========== */
#scrollTopBtn { position: fixed; bottom: 25px; right: 25px; z-index: 450; width: 50px; height: 50px; border-radius: 50%; background: var(--primary); color: #fff; border: none; font-size: 1.3em; cursor: pointer; transition: var(--transition); box-shadow: 0 4px 15px rgba(0,151,167,0.4); }
#scrollTopBtn:hover { transform: scale(1.1); }
.edit-mode #scrollTopBtn { bottom: 75px; }

/* ========== FOOTER ========== */
#footer { background: rgba(12,18,34,0.95); border-top: 1px solid var(--border-subtle); padding: 50px 20px; text-align: center; color: var(--text-muted); backdrop-filter: blur(10px); }
.footer-brand { font-size: 1.5em; font-weight: 800; color: var(--primary-light); margin-bottom: 10px; }
.footer-links { display: flex; justify-content: center; gap: 20px; margin: 15px 0; flex-wrap: wrap; }
.footer-links a { color: var(--text-muted); text-decoration: none; transition: var(--transition); }
.footer-links a:hover { color: var(--primary-light); }
.footer-copy { font-size: 0.85em; margin-top: 10px; }

/* ========== ADMIN EDIT FORMS ========== */
.inline-edit-form { background: rgba(255,111,0,0.1); border: 1px dashed var(--accent); border-radius: var(--radius-sm); padding: 15px; margin: 10px 0; }
.inline-edit-form input, .inline-edit-form textarea, .inline-edit-form select { width: 100%; padding: 8px 12px; margin: 4px 0; border-radius: 6px; border: 1px solid rgba(77,208,225,0.3); background: rgba(0,0,0,0.3); color: var(--text); font-family: inherit; font-size: 0.9em; }
.inline-edit-form textarea { min-height: 60px; resize: vertical; }
.inline-edit-form label { color: var(--accent-light); font-size: 0.85em; display: block; margin-top: 6px; }

/* ========== ANIMATIONS ========== */
@keyframes fadeUp { from { opacity: 0; transform: translateY(30px); } to { opacity: 1; transform: translateY(0); } }
.card { animation: fadeUp 0.5s ease backwards; }
.cards-grid .card:nth-child(1) { animation-delay: 0.05s; }
.cards-grid .card:nth-child(2) { animation-delay: 0.1s; }
.cards-grid .card:nth-child(3) { animation-delay: 0.15s; }
.cards-grid .card:nth-child(4) { animation-delay: 0.2s; }
.cards-grid .card:nth-child(5) { animation-delay: 0.25s; }
.cards-grid .card:nth-child(6) { animation-delay: 0.3s; }

/* ========== LOGIN MODAL ========== */
.login-modal-content { max-width: 420px; text-align: center; }
.login-header { margin-bottom: 20px; }
.login-icon { font-size: 4em; margin-bottom: 10px; animation: pulse 2s ease-in-out infinite; }
@keyframes pulse { 0%,100% { transform: scale(1); } 50% { transform: scale(1.1); } }
.login-header h3 { color: var(--text-heading); font-size: 1.5em; margin-bottom: 8px; }
.login-header p { color: var(--text-muted); font-size: 0.9em; }
.login-form { text-align: right; }
.login-form label { color: var(--text-muted); font-size: 0.9em; display: block; margin: 12px 0 5px; }
.login-form input { width: 100%; padding: 12px 15px; border-radius: var(--radius-sm); border: 2px solid rgba(77,208,225,0.2); background: rgba(0,0,0,0.3); color: var(--text); font-family: inherit; font-size: 1em; transition: var(--transition); }
.login-form input:focus { outline: none; border-color: var(--primary-light); background: rgba(0,0,0,0.5); }
.btn-login { width: 100%; padding: 14px; margin-top: 20px; border: none; border-radius: 25px; background: linear-gradient(135deg, var(--primary), var(--primary-dark)); color: #fff; font-size: 1.1em; font-weight: 700; cursor: pointer; font-family: inherit; transition: var(--transition); letter-spacing: 0.5px; }
.btn-login:hover { transform: translateY(-2px); box-shadow: 0 8px 25px rgba(0,151,167,0.5); }
.login-error { background: rgba(244,67,54,0.15); border: 1px solid rgba(244,67,54,0.3); color: #ef5350; padding: 10px; border-radius: var(--radius-sm); margin-bottom: 15px; font-size: 0.9em; animation: shake 0.4s ease; }
@keyframes shake { 0%,100% { transform: translateX(0); } 25% { transform: translateX(-8px); } 75% { transform: translateX(8px); } }
.admin-badge { display: inline-flex; align-items: center; gap: 5px; background: linear-gradient(135deg, var(--accent), #e65100); color: #fff; padding: 4px 12px; border-radius: 15px; font-size: 0.75em; font-weight: 700; margin-right: 10px; }

/* ========== ADMIN EDIT MODAL ========== */
.admin-edit-modal-content { max-width: 650px; max-height: 85vh; overflow-y: auto; }
.admin-edit-modal-content h3 { text-align: center; margin-bottom: 20px; }
.admin-field-group { margin-bottom: 14px; }
.admin-field-group label { display: block; color: var(--accent-light); font-size: 0.85em; margin-bottom: 4px; font-weight: 600; }
.admin-field-group input, .admin-field-group textarea, .admin-field-group select { width: 100%; padding: 10px 14px; border-radius: 8px; border: 1px solid rgba(77,208,225,0.3); background: rgba(0,0,0,0.3); color: var(--text); font-family: inherit; font-size: 0.95em; transition: var(--transition); }
.admin-field-group input:focus, .admin-field-group textarea:focus, .admin-field-group select:focus { outline: none; border-color: var(--primary-light); }
.admin-field-group textarea { min-height: 80px; resize: vertical; }
.admin-field-group select { cursor: pointer; }
.admin-field-group .img-preview { width: 100%; max-height: 200px; object-fit: cover; border-radius: 8px; margin-top: 8px; border: 2px solid rgba(77,208,225,0.2); }
.admin-field-group .img-upload-area { border: 2px dashed rgba(77,208,225,0.3); border-radius: 8px; padding: 20px; text-align: center; cursor: pointer; transition: var(--transition); margin-top: 5px; }
.admin-field-group .img-upload-area:hover { border-color: var(--primary-light); background: rgba(77,208,225,0.05); }
.admin-field-group .img-upload-area input[type="file"] { display: none; }

/* ========== CARD IMAGE ========== */
.card-img { width: 100%; height: 160px; object-fit: cover; border-radius: var(--radius-sm); margin-bottom: 12px; }
.card-img-placeholder { width: 100%; height: 160px; border-radius: var(--radius-sm); margin-bottom: 12px; display: flex; align-items: center; justify-content: center; font-size: 4em; background: linear-gradient(135deg, rgba(0,77,120,0.4), rgba(0,150,136,0.3)); }

/* ========== CUSTOM SECTION STYLE ========== */
.custom-section-content { background: var(--bg-card); border-radius: var(--radius); padding: 30px; color: var(--text); line-height: 1.8; font-size: 1.05em; }

/* ========== RESPONSIVE ========== */
@media(max-width:600px) {
  .section-header h2 { font-size: 1.6em; }
  .cards-grid { grid-template-columns: 1fr; gap: 16px; }
  .cards-grid[style*="repeat(4"] { grid-template-columns: repeat(2, 1fr) !important; }
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .modal-content { padding: 20px; }
  .modal-content iframe { height: 250px; }
  .site-section { padding: 40px 15px; }
  #topControls { top: auto; bottom: 70px; left: 10px; }
}

/* ========== ARTICLE EDITOR ========== */
.article-editor-content { max-width: 800px; max-height: 90vh; }
.article-view-content { max-width: 800px; }
.ae-form { text-align: right; }
.ae-row { display: flex; gap: 12px; align-items: flex-start; }
.ae-field { margin-bottom: 14px; }
.ae-field label { display: block; color: var(--accent-light); font-size: 0.85em; margin-bottom: 4px; font-weight: 600; }
.ae-field input, .ae-field select, .ae-field textarea { width: 100%; padding: 10px 14px; border-radius: 8px; border: 1px solid rgba(77,208,225,0.3); background: rgba(0,0,0,0.3); color: var(--text); font-family: inherit; font-size: 0.95em; }
.ae-field input:focus, .ae-field select:focus, .ae-field textarea:focus { outline: none; border-color: var(--primary-light); }
.ae-icon-selected { width: 50px; height: 50px; font-size: 1.8em; display: flex; align-items: center; justify-content: center; background: var(--glass-light); border-radius: 10px; cursor: pointer; border: 2px solid rgba(77,208,225,0.3); transition: var(--transition); }
.ae-icon-selected:hover { border-color: var(--primary-light); }
.ae-icon-picker { display: grid; grid-template-columns: repeat(8, 1fr); gap: 4px; background: var(--glass); border: 1px solid rgba(77,208,225,0.2); border-radius: 10px; padding: 8px; position: absolute; z-index: 10; max-height: 200px; overflow-y: auto; }
.ae-icon-picker span { font-size: 1.4em; cursor: pointer; padding: 6px; border-radius: 6px; text-align: center; transition: var(--transition); }
.ae-icon-picker span:hover { background: rgba(77,208,225,0.2); }
.ae-cover-area { display: flex; flex-direction: column; gap: 8px; }
.ae-cover-preview { width: 100%; max-height: 200px; object-fit: cover; border-radius: 8px; border: 2px solid rgba(77,208,225,0.2); }
.ae-toolbar { display: flex; gap: 4px; flex-wrap: wrap; padding: 8px; background: rgba(0,0,0,0.2); border-radius: 8px 8px 0 0; border: 1px solid rgba(77,208,225,0.2); border-bottom: none; }
.ae-toolbar button { width: 34px; height: 34px; border: 1px solid rgba(77,208,225,0.2); background: var(--glass-light); color: var(--text); border-radius: 6px; cursor: pointer; font-size: 0.85em; transition: var(--transition); display: flex; align-items: center; justify-content: center; }
.ae-toolbar button:hover { background: rgba(77,208,225,0.2); }
.ae-content-editor { min-height: 250px; max-height: 400px; overflow-y: auto; padding: 15px; background: rgba(0,0,0,0.3); border: 1px solid rgba(77,208,225,0.2); border-radius: 0 0 8px 8px; color: var(--text); font-family: inherit; font-size: 1em; line-height: 1.8; direction: rtl; }
.ae-content-editor:focus { outline: none; border-color: var(--primary-light); }
.ae-content-editor:empty::before { content: attr(placeholder); color: var(--text-muted); opacity: 0.6; }
.ae-content-editor img { max-width: 100%; border-radius: 8px; margin: 10px 0; }
.ae-attachment-info { background: rgba(77,208,225,0.1); border: 1px solid rgba(77,208,225,0.2); border-radius: 8px; padding: 10px; margin-top: 5px; color: var(--primary-light); font-size: 0.9em; display: flex; align-items: center; gap: 8px; }
.ae-actions { display: flex; gap: 10px; justify-content: center; margin-top: 20px; flex-wrap: wrap; }
.ae-publish-btn { background: linear-gradient(135deg, #43a047, #2e7d32) !important; }
.ae-publish-btn:hover { box-shadow: 0 6px 20px rgba(67,160,71,0.4) !important; }
/* Article view */
.article-view-body-content { color: var(--text); line-height: 1.9; font-size: 1.05em; }
.article-view-body-content img { max-width: 100%; border-radius: 8px; margin: 12px 0; }
.article-view-body-content h3 { color: var(--text-heading); margin: 15px 0 8px; }
.article-view-cover { width: 100%; max-height: 300px; object-fit: cover; border-radius: var(--radius-sm); margin-bottom: 15px; }
.article-view-meta { display: flex; gap: 12px; flex-wrap: wrap; margin-bottom: 15px; }
.article-view-meta span { background: var(--glass-light); padding: 4px 12px; border-radius: 15px; font-size: 0.85em; color: var(--text-muted); }

/* ========== GAME PLAY MODAL ========== */
.game-play-content { max-width: 95vw; max-height: 92vh; width: 1100px; padding: 15px; }
.game-play-content iframe { border-radius: 10px; }

/* ========== PARTICIPANT BADGE ========== */
.participant-badge { display: inline-flex; align-items: center; gap: 5px; background: linear-gradient(135deg, #43a047, #2e7d32); color: #fff; padding: 4px 12px; border-radius: 15px; font-size: 0.75em; font-weight: 700; margin-right: 10px; }

/* Scrollbar */
#ui-layer::-webkit-scrollbar { width: 8px; }
#ui-layer::-webkit-scrollbar-track { background: transparent; }
#ui-layer::-webkit-scrollbar-thumb { background: var(--primary); border-radius: 4px; }
#ui-layer::-webkit-scrollbar-thumb:hover { background: var(--primary-light); }

/* ========== FULL ADMIN DASHBOARD ========== */
#adminDashboard { position: fixed; top: 0; left: 0; width: 100%; height: 100%; z-index: 2000; background: var(--bg-dark); }
.dash-layout { display: flex; height: 100%; direction: rtl; }
.dash-sidebar { width: 260px; background: rgba(12,18,34,0.98); border-left: 1px solid var(--border-subtle); display: flex; flex-direction: column; padding: 20px 0; backdrop-filter: blur(15px); overflow-y: auto; flex-shrink: 0; }
.dash-brand { font-size: 1.3em; font-weight: 800; color: var(--primary-light); padding: 0 20px 15px; text-align: center; }
.dash-user-info { display: flex; align-items: center; gap: 10px; padding: 12px 20px; margin-bottom: 15px; background: rgba(77,208,225,0.08); }
.dash-avatar { font-size: 1.5em; }
.dash-nav { flex: 1; display: flex; flex-direction: column; gap: 2px; padding: 0 10px; }
.dash-nav-item { display: flex; align-items: center; gap: 10px; padding: 12px 16px; border-radius: 10px; color: var(--text-muted); cursor: pointer; transition: var(--transition); font-size: 0.95em; text-decoration: none; }
.dash-nav-item:hover { background: rgba(77,208,225,0.1); color: var(--text); }
.dash-nav-item.active { background: linear-gradient(135deg, var(--primary), var(--primary-dark)); color: #fff; font-weight: 700; }
.dash-nav-item span { font-size: 1.2em; width: 24px; text-align: center; }
.dash-nav-item.sub { padding-right: 40px; font-size: 0.88em; }
.dash-nav-group { margin: 2px 0; }
.dash-nav-group-title { display: flex; align-items: center; gap: 10px; padding: 12px 16px; border-radius: 10px; color: var(--text-muted); cursor: pointer; transition: var(--transition); font-size: 0.95em; font-weight: 600; }
.dash-nav-group-title:hover { background: rgba(77,208,225,0.1); color: var(--text); }
.dash-nav-group-title span:first-child { font-size: 1.2em; width: 24px; text-align: center; }
.dash-arrow { margin-right: auto; font-size: 0.7em; transition: transform 0.3s; }
.dash-nav-group.open .dash-arrow { transform: rotate(-90deg); }
.dash-nav-sub { max-height: 0; overflow: hidden; transition: max-height 0.3s ease; }
.dash-nav-group.open .dash-nav-sub { max-height: 500px; }
.dash-sidebar-footer { padding: 15px 20px; }
.dash-btn-back { width: 100%; padding: 10px; border-radius: 10px; border: 1px solid var(--primary); background: transparent; color: var(--primary-light); cursor: pointer; font-family: inherit; font-size: 0.9em; transition: var(--transition); }
.dash-btn-back:hover { background: rgba(77,208,225,0.15); }
.dash-main { flex: 1; display: flex; flex-direction: column; overflow: hidden; }
.dash-header { display: flex; align-items: center; justify-content: space-between; padding: 15px 25px; background: var(--glass); border-bottom: 1px solid rgba(77,208,225,0.1); flex-shrink: 0; text-align: right; margin-bottom: 0; }
.dash-header h2 { font-size: 1.3em; color: var(--text-heading); margin: 0; }
.dash-header p { display: none; }
.dash-header-title { display: flex; align-items: center; gap: 12px; }
.dash-header-actions { display: flex; align-items: center; gap: 10px; }
.dash-search { padding: 8px 14px; border-radius: 8px; border: 1px solid rgba(77,208,225,0.2); background: rgba(0,0,0,0.3); color: var(--text); font-family: inherit; font-size: 0.85em; width: 200px; }
.dash-search:focus { outline: none; border-color: var(--primary-light); }
.dash-btn-sm { padding: 8px 14px; border-radius: 8px; border: 1px solid rgba(77,208,225,0.2); background: var(--glass-light); color: var(--text); cursor: pointer; font-family: inherit; font-size: 0.85em; transition: var(--transition); }
.dash-btn-sm:hover { background: rgba(77,208,225,0.15); }
.dash-content { flex: 1; overflow-y: auto; padding: 25px; }
.dash-menu-toggle { display: none; background: none; border: none; color: var(--text); font-size: 1.5em; cursor: pointer; }
/* Sidebar overlay */
.dash-sidebar-overlay { display: none; position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0,0,0,0.5); backdrop-filter: blur(3px); z-index: 2000; opacity: 0; transition: opacity 0.3s ease; }
.dash-sidebar-overlay.visible { display: block; opacity: 1; }

@media(max-width:768px) {
  .dash-sidebar { position: fixed; right: 0; top: 0; height: 100%; width: 80%; max-width: 280px; z-index: 2001; transition: transform 0.3s cubic-bezier(0.4,0,0.2,1); transform: translateX(100%); box-shadow: -5px 0 30px rgba(0,0,0,0.4); }
  .dash-sidebar.open { transform: translateX(0); }
  .dash-menu-toggle { display: block; }
  .dash-search { width: 120px; }
  .dash-header { padding: 12px 15px; }
  .dash-header h2 { font-size: 1.1em; }
  .dash-content { padding: 15px; }
  .dash-kpi-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .dash-kpi { padding: 14px 10px; }
  .dash-kpi .kpi-val { font-size: 1.4em; }
  .dash-kpi .kpi-label { font-size: 0.72em; }
  .dash-btn-sm { padding: 6px 10px; font-size: 0.8em; }
  .dash-report-row { flex-direction: column; align-items: flex-start; }
}
.admin-dash-content { max-width: 1100px; max-height: 92vh; padding: 20px; }
.dash-tabs { display: flex; gap: 8px; justify-content: center; margin-bottom: 20px; flex-wrap: wrap; }
.dash-tab { padding: 10px 20px; background: var(--bg-card); color: var(--text); border: 1px solid rgba(77,208,225,0.2); border-radius: 25px; cursor: pointer; transition: var(--transition); font-family: inherit; font-size: 0.9em; }
.dash-tab.active, .dash-tab:hover { background: var(--primary); color: #fff; border-color: var(--primary); }
.dash-kpi-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 14px; margin-bottom: 25px; }
.dash-kpi { background: var(--gradient-card); border-radius: 14px; padding: 18px; text-align: center; border: 1px solid var(--border-subtle); transition: var(--transition); backdrop-filter: blur(10px); }
.dash-kpi:hover { transform: translateY(-3px); box-shadow: var(--glow); }
.dash-kpi .kpi-icon { font-size: 1.8em; margin-bottom: 6px; }
.dash-kpi .kpi-val { font-size: 1.8em; font-weight: 900; color: var(--primary-light); }
.dash-kpi .kpi-label { color: var(--text-muted); font-size: 0.8em; margin-top: 2px; }
.dash-chart-area { background: var(--bg-card); border-radius: 14px; padding: 20px; margin-bottom: 20px; border: 1px solid rgba(77,208,225,0.1); }
.dash-chart-area h4 { color: var(--text-heading); margin-bottom: 12px; }
.dash-chart-canvas { width: 100%; height: 220px; }
.dash-reports-list { max-height: 400px; overflow-y: auto; }
.dash-report-row { background: var(--glass-light); border-radius: 10px; padding: 14px; margin-bottom: 8px; display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 8px; cursor: pointer; transition: var(--transition); border: 1px solid transparent; }
.dash-report-row:hover { border-color: var(--primary); background: rgba(77,208,225,0.08); }
.dash-report-date { color: var(--primary-light); font-weight: 700; font-size: 0.95em; }
.dash-report-stats { display: flex; gap: 12px; flex-wrap: wrap; }
.dash-report-stats span { color: var(--text-muted); font-size: 0.85em; }
.dash-report-actions { display: flex; gap: 6px; }
.dash-report-actions button { padding: 5px 12px; border-radius: 6px; border: none; cursor: pointer; font-family: inherit; font-size: 0.8em; color: #fff; transition: var(--transition); }
.dash-btn-view { background: var(--primary); }
.dash-btn-edit { background: var(--accent); }
.dash-btn-delete { background: #e53935; }
.dash-empty { text-align: center; padding: 40px; color: var(--text-muted); }
.dash-empty .empty-icon { font-size: 4em; margin-bottom: 10px; }

/* ========== REPORT FORM ========== */
.report-form-content { max-width: 800px; max-height: 90vh; }
.report-view-content { max-width: 800px; max-height: 90vh; }
.rf-section { background: var(--glass-light); border-radius: 12px; padding: 18px; margin-bottom: 16px; border: 1px solid rgba(77,208,225,0.1); }
.rf-section h4 { color: var(--primary-light); margin-bottom: 12px; font-size: 1em; display: flex; align-items: center; gap: 6px; }
.rf-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.rf-row-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 12px; }
.rf-row-4 { display: grid; grid-template-columns: 1fr 1fr 1fr 1fr; gap: 12px; }
.rf-field { margin-bottom: 10px; }
.rf-field label { display: block; color: var(--accent-light); font-size: 0.82em; margin-bottom: 3px; font-weight: 600; }
.rf-field input, .rf-field select, .rf-field textarea { width: 100%; padding: 9px 12px; border-radius: 8px; border: 1px solid rgba(77,208,225,0.25); background: rgba(0,0,0,0.25); color: var(--text); font-family: inherit; font-size: 0.9em; transition: var(--transition); }
.rf-field input:focus, .rf-field select:focus, .rf-field textarea:focus { outline: none; border-color: var(--primary-light); }
.rf-field textarea { min-height: 60px; resize: vertical; }
.rf-stars { display: flex; gap: 6px; }
.rf-star { font-size: 1.8em; cursor: pointer; transition: transform 0.2s; opacity: 0.3; }
.rf-star.active { opacity: 1; }
.rf-star:hover { transform: scale(1.2); }
.rf-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.rf-chip { padding: 5px 12px; border-radius: 15px; font-size: 0.82em; cursor: pointer; border: 1px solid rgba(77,208,225,0.3); background: var(--glass-light); color: var(--text); transition: var(--transition); font-family: inherit; }
.rf-chip.selected { background: var(--primary); color: #fff; border-color: var(--primary); }
.rf-toggle { display: flex; align-items: center; gap: 10px; }
.rf-toggle-btn { width: 48px; height: 26px; border-radius: 13px; border: none; background: rgba(255,255,255,0.15); cursor: pointer; position: relative; transition: var(--transition); }
.rf-toggle-btn.on { background: var(--primary); }
.rf-toggle-btn::after { content: ''; position: absolute; top: 3px; right: 3px; width: 20px; height: 20px; border-radius: 50%; background: #fff; transition: var(--transition); }
.rf-toggle-btn.on::after { right: auto; left: 3px; }

/* Report view */
.rv-section { background: var(--glass-light); border-radius: 12px; padding: 16px; margin-bottom: 12px; border-right: 3px solid var(--primary); }
.rv-section h4 { color: var(--primary-light); margin-bottom: 8px; }
.rv-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.rv-item { display: flex; justify-content: space-between; padding: 6px 0; border-bottom: 1px solid rgba(77,208,225,0.08); }
.rv-item label { color: var(--text-muted); font-size: 0.85em; }
.rv-item span { color: var(--text-heading); font-weight: 600; }
.rv-summary { background: linear-gradient(135deg, rgba(0,77,120,0.3), rgba(0,150,136,0.2)); border-radius: 12px; padding: 18px; margin-bottom: 16px; border: 1px solid rgba(77,208,225,0.2); }
.rv-summary h4 { color: var(--accent-light); margin-bottom: 8px; }
.rv-summary p { color: var(--text); line-height: 1.8; }

@media(max-width:600px) {
  .rf-row, .rf-row-3, .rf-row-4 { grid-template-columns: 1fr; }
  .rv-grid { grid-template-columns: 1fr; }
  .dash-kpi-grid { grid-template-columns: repeat(2, 1fr); }
}