/* =====================================================
   Ahmed Yahia Store — Download Hub Final Styles
   ===================================================== */

@import url('https://fonts.googleapis.com/css2?family=Roboto:wght@300;400;500;700;900&display=swap');

/* =====================================================
   1. VARIABLES & THEMES (Cyberpunk/Assassins Fusion)
   ===================================================== */
:root, document[data-theme="dark"] {
  --bg-base: #050512;
  --bg-surface: rgba(15, 15, 35, 0.7);
  --bg-surface-solid: #0f0f23;
  --bg-card: linear-gradient(145deg, #12122c, #0a0a18);
  
  --primary: #0171f9;
  --primary-glow: rgba(1, 113, 249, 0.4);
  --accent: #ee626b;
  --accent-glow: rgba(238, 98, 107, 0.4);
  --neon-cyan: #00f3ff;
  
  --text-main: #ffffff;
  --text-muted: #94a3b8;
  --border-color: rgba(255, 255, 255, 0.08);
  --glass-bg: rgba(255, 255, 255, 0.03);
  --glass-border: rgba(255, 255, 255, 0.05);
  
  --shadow-neon: 0 0 20px var(--primary-glow), 0 0 40px rgba(1, 113, 249, 0.2);
  --transition: all 0.4s cubic-bezier(0.25, 1, 0.5, 1);
}

[data-theme="light"] {
  --bg-base: #f1f5f9;
  --bg-surface: rgba(255, 255, 255, 0.8);
  --bg-surface-solid: #ffffff;
  --bg-card: linear-gradient(145deg, #ffffff, #f8fafc);
  
  --primary: #0171f9;
  --primary-glow: rgba(1, 113, 249, 0.2);
  --accent: #ee626b;
  --accent-glow: rgba(238, 98, 107, 0.2);
  
  --text-main: #0f172a;
  --text-muted: #64748b;
  --border-color: rgba(15, 23, 42, 0.08);
  --glass-bg: rgba(15, 23, 42, 0.02);
  --glass-border: rgba(15, 23, 42, 0.05);
  --shadow-neon: 0 10px 30px rgba(1, 113, 249, 0.15);
}

/* =====================================================
   2. RESET & UTILITIES
   ===================================================== */
* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }

body {
  font-family: "Roboto", sans-serif;
  background-color: var(--bg-base);
  color: var(--text-main);
  overflow-x: hidden;
  transition: background-color 0.5s ease, color 0.5s ease;
}

body::before {
  content: '';
  position: fixed;
  inset: 0;
  background:
    radial-gradient(ellipse at 15% 20%, var(--primary-glow) 0%, transparent 50%),
    radial-gradient(ellipse at 85% 70%, var(--accent-glow) 0%, transparent 50%),
    radial-gradient(ellipse at 50% 50%, rgba(99, 0, 255, 0.05) 0%, transparent 60%);
  pointer-events: none;
  z-index: -2;
  animation: bgShift 12s ease-in-out infinite alternate;
}

@keyframes bgShift {
  0% { transform: scale(1) translate(0, 0); }
  100% { transform: scale(1.08) translate(1% , 1%); }
}

.hidden { display: none !important; }

/* إخفاء عناصر قارئ الشاشة للـ Accessibility بدون ما تظهر في الواجهة */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

/* =====================================================
   3. SYSTEM COMPONENTS
   ===================================================== */
.preloader { position: fixed; inset: 0; background: #03030c; display: flex; align-items: center; justify-content: center; z-index: 9999; transition: opacity 0.5s ease, visibility 0.5s ease; }
.preloader.hidden { opacity: 0; visibility: hidden; }
.preloader-inner { text-align: center; }
.preloader-logo { font-size: 70px; text-shadow: 0 0 20px var(--primary); animation: preloaderBounce 0.8s ease-in-out infinite alternate; }
@keyframes preloaderBounce { from { transform: translateY(0) scale(1); } to { transform: translateY(-20px) scale(1.05); } }
.preloader-bar { width: 220px; height: 5px; background: rgba(255, 255, 255, 0.05); border-radius: 10px; margin: 20px 0 10px; overflow: hidden; }
.preloader-fill { height: 100%; width: 0; background: linear-gradient(90deg, var(--primary), var(--accent)); animation: preloaderLoad 1.2s cubic-bezier(0.4, 0, 0.2, 1) forwards; }
@keyframes preloaderLoad { to { width: 100%; } }

.scroll-progress { position: fixed; top: 0; left: 0; height: 4px; background: linear-gradient(90deg, var(--primary), var(--accent), var(--neon-cyan)); z-index: 9999; transition: width 0.1s linear; }

.stars-container { position: fixed; inset: 0; pointer-events: none; z-index: -1; }
.star { position: absolute; background: #fff; border-radius: 50%; animation: starTwinkle var(--duration) ease-in-out infinite; opacity: 0; }
@keyframes starTwinkle { 0%, 100% { opacity: 0; transform: scale(0.3); } 50% { opacity: 0.7; transform: scale(1.2); } }

.toast-container { position: fixed; bottom: 24px; right: 24px; display: flex; flex-direction: column; gap: 12px; z-index: 9999; }
.toast { display: flex; align-items: center; gap: 14px; padding: 16px 24px; border-radius: 16px; background: var(--bg-surface-solid); border: 1px solid var(--border-color); color: var(--text-main); box-shadow: 0 20px 40px rgba(0,0,0,0.3); transform: translateX(120%); transition: var(--transition); opacity: 0; }
.toast.show { transform: translateX(0); opacity: 1; }
.toast.hide { transform: translateX(120%); opacity: 0; }
.toast-success { border-left: 4px solid #00c864; }
.toast-warning { border-left: 4px solid #f5a623; }
.toast-error { border-left: 4px solid var(--accent); }
.toast-info { border-left: 4px solid var(--primary); }
.toast-close { background: none; border: none; color: var(--text-muted); cursor: pointer; margin-left: auto; }

/* =====================================================
   4. NAVIGATION HEADER
   ===================================================== */
.header { display: flex; justify-content: space-between; align-items: center; padding: 16px 6%; position: sticky; top: 0; z-index: 1000; background: var(--glass-bg); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px); border-bottom: 1px solid var(--glass-border); transition: var(--transition); }
.header.scrolled { background: var(--bg-surface-solid); padding: 12px 6%; box-shadow: 0 10px 30px rgba(0,0,0,0.2); }
.logo { height: 45px; transition: var(--transition); }
.header-links { display: flex; align-items: center; gap: 24px; }
.header-links a { color: var(--text-main); text-decoration: none; font-size: 15px; font-weight: 500; opacity: 0.8; transition: var(--transition); position: relative; padding: 6px 0; }
.header-links a:hover, .header-links a.active { opacity: 1; color: var(--primary); }
.header-links a::after { content: ''; position: absolute; bottom: 0; left: 0; width: 0; height: 2px; background: var(--primary); transition: var(--transition); }
.header-links a:hover::after, .header-links a.active::after { width: 100%; }

.header-actions { display: flex; align-items: center; gap: 16px; margin-left: 16px; }
.icon-btn { background: var(--glass-bg); border: 1px solid var(--glass-border); color: var(--text-main); border-radius: 50%; width: 42px; height: 42px; display: flex; align-items: center; justify-content: center; cursor: pointer; position: relative; transition: var(--transition); }
.icon-btn:hover { background: var(--primary); color: #fff; border-color: var(--primary); transform: translateY(-3px); box-shadow: 0 5px 15px var(--primary-glow); }
.badge { position: absolute; top: -4px; right: -4px; background: var(--accent); color: #fff; font-size: 10px; font-weight: 700; width: 20px; height: 20px; border-radius: 50%; display: flex; align-items: center; justify-content: center; border: 2px solid var(--bg-surface-solid); }
.menu-btn { display: none; background: none; border: 1px solid var(--border-color); color: var(--text-main); font-size: 24px; cursor: pointer; padding: 4px 10px; border-radius: 8px; }

/* =====================================================
   5. HERO / LANDING SECTION
   ===================================================== */
.landing-page { display: flex; justify-content: space-between; align-items: center; padding: 80px 8% 120px; gap: 60px; position: relative; }
.landing-page-left-section { flex: 1; max-width: 650px; }
.welcome-badge { background: rgba(1, 113, 249, 0.1); color: var(--primary); padding: 6px 16px; border-radius: 30px; font-size: 13px; font-weight: 600; text-transform: uppercase; letter-spacing: 1px; display: inline-block; margin-bottom: 24px; border: 1px solid rgba(1, 113, 249, 0.2); }
.landing-page-left-section h1 { font-size: 4rem; font-weight: 900; line-height: 1.1; margin-bottom: 20px; letter-spacing: -1px; }
.landing-page-left-section p { color: var(--text-muted); font-size: 16px; line-height: 1.8; margin-bottom: 36px; }

/* Search Box Styling Fixes */
.landing-page-search {
  display: flex;
  align-items: center;
  background: var(--bg-surface-solid);
  border: 1px solid var(--border-color);
  padding: 6px;
  border-radius: 50px;
  margin-bottom: 48px;
  box-shadow: 0 10px 30px rgba(0,0,0,0.1);
  position: relative;
  max-width: 480px;
}

.landing-page-search input {
  flex: 1;
  background: none;
  border: none;
  outline: none;
  padding: 10px 20px;
  color: var(--text-main);
  font-size: 15px;
}

.landing-page-search .search-btn {
  padding: 10px 24px;
  border-radius: 50px;
  margin-left: 10px;
  flex-shrink: 0;
}

.search-suggestions { position: absolute; top: calc(100% + 12px); left: 0; right: 0; background: var(--bg-surface-solid); border: 1px solid var(--border-color); border-radius: 16px; overflow: hidden; box-shadow: 0 15px 35px rgba(0,0,0,0.3); z-index: 10; opacity: 0; visibility: hidden; transition: var(--transition); }
.search-suggestions.active { opacity: 1; visibility: visible; }
.suggestion-item { padding: 12px 20px; cursor: pointer; color: var(--text-main); font-size: 14px; transition: var(--transition); }
.suggestion-item:hover, .suggestion-item.focused { background: rgba(1, 113, 249, 0.1); color: var(--primary); }
.suggestion-item mark { background: none; color: var(--accent); font-weight: 700; }

.hero-stats { display: flex; align-items: center; gap: 30px; }
.stat { display: flex; flex-direction: column; }
.stat-number { font-size: 32px; font-weight: 900; color: var(--text-main); }
.stat-label { font-size: 13px; color: var(--text-muted); text-transform: uppercase; }
.stat-divider { width: 1px; height: 40px; background: var(--border-color); }

/* =====================================================
   HERO IMAGE SLIDER
   ===================================================== */
.landing-page-image-container { flex: 1; position: relative; display: flex; justify-content: center; }
.image-glow { position: absolute; width: 80%; height: 80%; background: var(--primary); filter: blur(80px); opacity: 0.3; z-index: -1; animation: floatOrb 6s ease-in-out infinite alternate; }
@keyframes floatOrb { 0% { transform: translateY(-10px); opacity: 0.2; } 100% { transform: translateY(10px); opacity: 0.4; } }

.hero-slider {
  position: relative;
  width: 100%;
  max-width: 420px;
  aspect-ratio: 3 / 4;
  border-radius: 32px;
  border: 1px solid var(--border-color);
  box-shadow: 0 30px 60px rgba(0,0,0,0.3);
  overflow: hidden;
  background: var(--bg-surface-solid);
}

.slider-img {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  transition: opacity 1s ease-in-out, transform 4s ease-out;
  transform: scale(1.1); 
}

.slider-img.active {
  opacity: 1;
  transform: scale(1);
}

/* =====================================================
   6. GLOBAL STRUCTURAL SECTIONS
   ===================================================== */
section { padding: 60px 8%; }
.section-header { margin-bottom: 40px; }
.section-badge { color: var(--accent); text-transform: uppercase; font-size: 12px; font-weight: 700; letter-spacing: 2px; display: block; margin-bottom: 8px; }
h2 { font-size: 2.2rem; font-weight: 800; }

.btn { background: linear-gradient(135deg, var(--accent), #df4d56); color: #fff; border: none; padding: 12px 28px; font-size: 14px; font-weight: 600; border-radius: 30px; cursor: pointer; box-shadow: 0 5px 15px var(--accent-glow); transition: var(--transition); }
.btn:hover { transform: translateY(-3px); box-shadow: 0 10px 25px var(--accent-glow); }

/* =====================================================
   7. CATEGORIES DISPLAY GRID
   ===================================================== */
.categories-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 20px; }
.category-card { background: var(--bg-card); border: 1px solid var(--border-color); padding: 24px 16px; border-radius: 20px; text-align: center; cursor: pointer; transition: var(--transition); }
.category-card:hover { transform: translateY(-8px); border-color: var(--primary); box-shadow: var(--shadow-neon); }
.category-icon { font-size: 32px; display: block; margin-bottom: 12px; transition: var(--transition); }
.category-card:hover .category-icon { transform: scale(1.2); }
.category-card span:last-child { font-weight: 600; font-size: 15px; }

/* =====================================================
   8. TRENDING & GAME CARDS
   ===================================================== */
.trending-header { display: flex; justify-content: space-between; align-items: flex-end; margin-bottom: 40px; }
.view-all-link { color: var(--primary); text-decoration: none; font-weight: 600; font-size: 15px; transition: var(--transition); }
.view-all-link:hover { color: var(--text-main); transform: translateX(5px); }

.trending-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 24px; }
.card { background: var(--bg-card); border-radius: 24px; border: 1px solid var(--border-color); overflow: hidden; transition: var(--transition); transform-style: preserve-3d; }
.card-thumb-wrapper { position: relative; height: 220px; overflow: hidden; }
.card .thumb { width: 100%; height: 100%; object-fit: cover; transition: var(--transition); }
.card:hover .thumb { transform: scale(1.08); }
.card-badge { position: absolute; top: 16px; left: 16px; background: rgba(0, 0, 0, 0.6); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); padding: 4px 12px; border-radius: 20px; font-size: 12px; font-weight: 600; border: 1px solid rgba(255, 255, 255, 0.1); }
.card-badge.hot { color: #ff9f43; border-color: rgba(255,159,67,0.3); }
.card-badge.free { color: #10ac84; border-color: rgba(16,172,132,0.3); }
.card-badge.new { color: #00d2d3; border-color: rgba(0,210,211,0.3); }

.card-body { padding: 20px 20px 10px; }
.card-category { color: var(--primary); font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.5px; display: block; margin-bottom: 6px; }
.card-body h3 { font-size: 18px; font-weight: 700; margin-bottom: 4px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.card-size { font-size: 13px; font-weight: 500; color: var(--text-muted); margin-top: 4px; }

.card-info { display: flex; justify-content: space-between; align-items: center; padding: 12px 20px 20px; border-top: 1px solid var(--border-color); margin-top: 10px; }

/* Interactive Download Button */
.btn-download {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(1, 113, 249, 0.1);
  border: 1px solid rgba(1, 113, 249, 0.3);
  padding: 8px 16px;
  border-radius: 12px;
  text-decoration: none;
  color: var(--primary-light);
  font-size: 14px;
  font-weight: 600;
  transition: var(--transition);
  position: relative;
  overflow: hidden;
}

.btn-download:hover {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
  transform: translateY(-3px);
  box-shadow: 0 5px 15px var(--primary-glow), 0 0 30px rgba(0, 243, 255, 0.3);
}

.btn-download:hover::after {
  content: '';
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: conic-gradient(from 0deg, transparent 0deg, rgba(255, 255, 255, 0.2) 60deg, transparent 120deg);
  animation: rotateGlow 2s linear infinite;
}

@keyframes rotateGlow { from { transform: rotate(0deg); } to { transform: rotate(360deg); } }

.download-icon { font-size: 16px; }

.card-like { background: none; border: none; font-size: 20px; cursor: pointer; transition: var(--transition); }
.card-like:hover { transform: scale(1.2); }

/* =====================================================
   9. PROMO BANNER GRAPHICS
   ===================================================== */
.promo-banner { background: linear-gradient(135deg, #4b0082, #0000ff); border-radius: 32px; margin: 40px 8%; padding: 60px; display: flex; justify-content: space-between; align-items: center; position: relative; overflow: hidden; box-shadow: 0 20px 50px rgba(0,0,0,0.3); }
.promo-banner::before { content: ''; position: absolute; inset: 0; background: repeating-linear-gradient(45deg, transparent, transparent 40px, rgba(255,255,255,0.02) 40px, rgba(255,255,255,0.02) 80px); }
.promo-content { position: relative; z-index: 2; max-width: 500px; }
.promo-badge { background: rgba(255, 255, 255, 0.15); padding: 4px 12px; border-radius: 20px; font-size: 12px; font-weight: 700; text-transform: uppercase; }
.promo-banner h2 { font-size: 2.5rem; margin: 16px 0 8px; }
.promo-btn { background: #fff; color: #000; margin-top: 24px; }
.promo-btn:hover { background: var(--neon-cyan); color: #000; box-shadow: 0 5px 20px rgba(0, 243, 255, 0.4); }
.promo-decoration { font-size: 80px; display: flex; gap: 20px; opacity: 0.15; pointer-events: none; }

/* =====================================================
   10. FEATURES DISPLAY GRID
   ===================================================== */
.features-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 24px; }
.feature-card { background: var(--bg-card); border: 1px solid var(--border-color); padding: 40px 24px; border-radius: 24px; transition: var(--transition); }
.feature-card:hover { transform: translateY(-6px); border-color: var(--accent); }
.feature-icon { font-size: 40px; display: block; margin-bottom: 20px; }
.feature-card h3 { font-size: 18px; margin-bottom: 10px; }
.feature-card p { color: var(--text-muted); font-size: 14px; line-height: 1.6; }

.reveal { opacity: 0; transform: translateY(30px); transition: opacity 0.8s ease, transform 0.8s ease; }
.reveal.revealed { opacity: 1; transform: translateY(0); }

/* =====================================================
   11. BACK TO TOP COMPONENT
   ===================================================== */
.back-to-top { position: fixed; bottom: 24px; left: 24px; background: var(--primary); color: #fff; border: none; width: 46px; height: 46px; border-radius: 50%; cursor: pointer; display: flex; align-items: center; justify-content: center; font-size: 20px; box-shadow: 0 5px 15px var(--primary-glow); opacity: 0; visibility: hidden; transition: var(--transition); z-index: 999; }
.back-to-top.visible { opacity: 1; visibility: visible; }
.back-to-top:hover { transform: translateY(-5px); }

/* =====================================================
   12. ARCHITECTURE FOOTER
   ===================================================== */
.footer { background: var(--bg-surface-solid); border-top: 1px solid var(--border-color); padding: 80px 8% 40px; }
.footer-content { display: grid; grid-template-columns: 2fr repeat(2, 1fr) 2fr; gap: 40px; margin-bottom: 60px; }
.footer-brand .logo { margin-bottom: 20px; }
.footer-brand p { color: var(--text-muted); font-size: 14px; }
.footer-nav h4, .footer-newsletter h4 { font-size: 16px; font-weight: 700; margin-bottom: 24px; text-transform: uppercase; letter-spacing: 0.5px; }
.footer-nav { display: flex; flex-direction: column; gap: 12px; }
.footer-nav a { color: var(--text-muted); text-decoration: none; font-size: 14px; transition: var(--transition); }
.footer-nav a:hover { color: var(--primary); padding-left: 4px; }
.footer-newsletter p { color: var(--text-muted); font-size: 14px; margin-bottom: 16px; }

.newsletter-form { display: flex; background: var(--bg-base); border: 1px solid var(--border-color); padding: 4px; border-radius: 30px; }
.newsletter-form input { flex: 1; background: none; border: none; outline: none; padding: 0 16px; color: var(--text-main); font-size: 14px; }
.newsletter-form .btn { padding: 10px 22px; font-size: 13px; }

/* =====================================================
   13. MEDIA RESPONSIVE QUERIES
   ===================================================== */
@media (max-width: 1024px) {
  .footer-content { grid-template-columns: repeat(2, 1fr); gap: 40px; }
  .landing-page-left-section h1 { font-size: 3rem; }
}
@media (max-width: 768px) {
  .header-links { position: fixed; top: 77px; right: -100%; width: 280px; height: calc(100vh - 77px); background: var(--bg-surface-solid); flex-direction: column; align-items: flex-start; padding: 40px; gap: 30px; transition: var(--transition); border-left: 1px solid var(--border-color); box-shadow: -10px 0 30px rgba(0,0,0,0.2); }
  .header-links.open { right: 0; }
  .header-actions { flex-direction: column; width: 100%; align-items: flex-start; margin: 0; gap: 20px; }
  .header-actions .btn { width: 100%; text-align: center; }
  .menu-btn { display: block; }
  .landing-page { flex-direction: column; text-align: center; padding-top: 40px; }
  .landing-page-search { margin: 0 auto 40px; }
  .hero-stats { justify-content: center; }
  .landing-page-image-container { display: flex; justify-content: center; width: 100%; }
  .hero-slider { max-width: 320px; }
  .promo-banner { flex-direction: column; text-align: center; gap: 40px; padding: 40px; }
  .footer-content { grid-template-columns: 1fr; text-align: center; }
  .footer-nav { align-items: center; }
  .newsletter-form { max-width: 360px; margin: 0 auto; }
}
@media (max-width: 480px) {
  .landing-page-left-section h1 { font-size: 2.2rem; }
  .hero-stats { flex-direction: column; gap: 16px; }
  .stat-divider { display: none; }
}