/* Modern CSS Reset and Variables */
:root {
  /* ألوان الوضع النهاري */
  --primary: #6C63FF;
  --primary-dark: #554fd8;
  --primary-light: #8a85ff;
  --secondary: #FF6584;
  --accent: #36D1DC;
  --dark: #1a1d2e;
  --darker: #131520;
  --light: #ffffff;
  --gray: #8f9bb3;
  --gray-light: #f7f9fc;
  --gradient-primary: linear-gradient(135deg, var(--primary), var(--accent));
  --gradient-secondary: linear-gradient(135deg, var(--secondary), #FF9A8B);
  --gradient-dark: linear-gradient(135deg, var(--dark), #2d3047);
  --shadow-sm: 0 2px 10px rgba(0, 0, 0, 0.08);
  --shadow-md: 0 8px 30px rgba(0, 0, 0, 0.12);
  --shadow-lg: 0 20px 60px rgba(0, 0, 0, 0.15);
  --border-radius: 12px;
  --border-radius-lg: 20px;
  --border-radius-xl: 30px;
  --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  
  /* ألوان الوضع الليلي */
  --bg-primary: #ffffff;
  --bg-secondary: #f7f9fc;
  --text-primary: #1a1d2e;
  --text-secondary: #8f9bb3;
  --card-bg: #ffffff;
  --card-shadow: 0 8px 30px rgba(0, 0, 0, 0.12);
}

/* متغيرات الوضع الليلي */
.dark-theme {
  --bg-primary: #0f1117;
  --bg-secondary: #1a1d2e;
  --text-primary: #ffffff;
  --text-secondary: #8f9bb3;
  --card-bg: #1e2130;
  --card-shadow: 0 8px 30px rgba(0, 0, 0, 0.3);
  --shadow-sm: 0 2px 10px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 8px 30px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 20px 60px rgba(0, 0, 0, 0.5);
}

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

html {
  scroll-behavior: smooth;
}

body {
  font-family: 'Tajawal', sans-serif;
  line-height: 1.6;
  color: var(--text-primary);
  background: var(--bg-primary);
  overflow-x: hidden;
  transition: background-color 0.3s ease, color 0.3s ease;
}

body[dir="rtl"] {
  font-family: 'Tajawal', sans-serif;
}

/* Minimal Navigation */
.minimal-nav {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  background: rgba(var(--bg-primary), 0.95);
  backdrop-filter: blur(20px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  z-index: 1000;
  transition: var(--transition);
}

.nav-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 70px;
}

.nav-brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand-icon {
  width: 40px;
  height: 40px;
  background: var(--gradient-primary);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 1.2rem;
}

.brand-text {
  display: flex;
  flex-direction: column;
}

.brand-name {
  font-size: 1.5rem;
  font-weight: 800;
  background: var(--gradient-primary);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.nav-menu {
  display: flex;
  gap: 32px;
}

.nav-link {
  text-decoration: none;
  color: var(--text-primary);
  font-weight: 500;
  transition: var(--transition);
  position: relative;
  padding: 8px 0;
}

.nav-link::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 0;
  height: 2px;
  background: var(--gradient-primary);
  transition: var(--transition);
}

.nav-link:hover::after,
.nav-link.active::after {
  width: 100%;
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: 16px;
}

/* زر تبديل الوضع الليلي */
.theme-switcher .theme-btn {
  background: transparent;
  border: 1px solid var(--gray-light);
  border-radius: 8px;
  padding: 8px 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: var(--transition);
  color: var(--text-primary);
  font-size: 0.9rem;
  width: 40px;
  height: 40px;
}

.theme-btn:hover {
  background: var(--primary-light);
  color: white;
  transform: scale(1.05);
}

.lang-btn {
  background: transparent;
  border: 1px solid var(--gray-light);
  border-radius: 8px;
  padding: 8px 16px;
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  transition: var(--transition);
  color: var(--text-primary);
}

.btn-login {
  background: transparent;
  color: var(--text-primary);
  text-decoration: none;
  padding: 10px 20px;
  border-radius: 8px;
  transition: var(--transition);
  display: flex;
  align-items: center;
  gap: 8px;
  border: 1px solid var(--gray-light);
}

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

.mobile-menu-btn {
  display: none;
  flex-direction: column;
  gap: 4px;
  background: none;
  border: none;
  cursor: pointer;
}

.mobile-menu-btn span {
  width: 20px;
  height: 2px;
  background: var(--text-primary);
  transition: var(--transition);
}

/* Minimal Hero Section - تم التعديل */
.minimal-hero {
  min-height: 100vh;
  position: relative;
  background: var(--darker);
  color: white;
  display: flex;
  align-items: center;
  overflow: hidden;
  padding-top: 70px;
}

.hero-background {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
}

.hero-particles {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
}

.particle {
  position: absolute;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 50%;
  animation: float-particle linear infinite;
}

@keyframes float-particle {
  0% {
    transform: translateY(100vh) rotate(0deg);
    opacity: 0;
  }
  10% {
    opacity: 1;
  }
  90% {
    opacity: 1;
  }
  100% {
    transform: translateY(-100px) rotate(360deg);
    opacity: 0;
  }
}

.hero-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 60px;
  align-items: center;
  position: relative;
  z-index: 2;
  height: calc(100vh - 70px);
}

.hero-content {
  display: flex;
  flex-direction: column;
  justify-content: center;
  height: 100%;
}

.hero-text-content {
  max-width: 500px;
}

.hero-title {
  font-size: 3.5rem;
  font-weight: 800;
  line-height: 1.1;
  margin-bottom: 24px;
}

.gradient-text {
  background: linear-gradient(135deg, #6C63FF, #36D1DC);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.hero-description {
  font-size: 1.2rem;
  color: rgba(255, 255, 255, 0.8);
  margin-bottom: 40px;
  line-height: 1.6;
}

.hero-stats {
  display: flex;
  gap: 32px;
  margin-bottom: 40px;
}

.stat-card {
  text-align: center;
}

.stat-number {
  font-size: 2.5rem;
  font-weight: 800;
  background: var(--gradient-primary);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  line-height: 1;
}

.stat-label {
  font-size: 0.9rem;
  color: rgba(255, 255, 255, 0.7);
  margin-top: 8px;
}

.hero-actions {
  display: flex;
  gap: 16px;
  margin-top: 40px;
}

.btn-primary {
  background: var(--gradient-primary);
  color: white;
  text-decoration: none;
  padding: 16px 32px;
  border-radius: 12px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: var(--transition);
  box-shadow: var(--shadow-md);
}

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

.btn-secondary {
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: white;
  text-decoration: none;
  padding: 16px 32px;
  border-radius: 12px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: var(--transition);
}

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

/* تأثير النبض للزر الرئيسي */
.pulse-animation {
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0% {
    box-shadow: 0 0 0 0 rgba(108, 99, 255, 0.7);
  }
  70% {
    box-shadow: 0 0 0 10px rgba(108, 99, 255, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(108, 99, 255, 0);
  }
}

/* Hero Visual - البطاقات ثلاثية الأبعاد مع حركة خفيفة */
.hero-visual {
  position: relative;
  height: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
}

.floating-games-container {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px;
  width: 100%;
  max-width: 500px;
}

.game-card-3d {
  perspective: 1000px;
  height: 180px;
  transition: transform 0.6s ease;
  animation: subtle-float 6s ease-in-out infinite;
}

.game-card-3d:nth-child(odd) {
  animation-delay: 0s;
}

.game-card-3d:nth-child(even) {
  animation-delay: 1.5s;
}

@keyframes subtle-float {
  0%, 100% {
    transform: translateY(0) rotateY(0);
  }
  25% {
    transform: translateY(-5px) rotateY(2deg);
  }
  50% {
    transform: translateY(0) rotateY(0);
  }
  75% {
    transform: translateY(5px) rotateY(-2deg);
  }
}

.card-inner {
  position: relative;
  width: 100%;
  height: 100%;
  text-align: center;
  transition: transform 0.6s;
  transform-style: preserve-3d;
}

.game-card-3d:hover .card-inner {
  transform: rotateY(180deg);
}

.card-front, .card-back {
  position: absolute;
  width: 100%;
  height: 100%;
  backface-visibility: hidden;
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

.card-front {
  background: rgba(255, 255, 255, 0.15);
  backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.2);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 16px;
}

.card-back {
  background: rgba(108, 99, 255, 0.9);
  transform: rotateY(180deg);
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  padding: 20px;
}

.game-image {
  width: 100%;
  height: 100px;
  border-radius: 12px;
  overflow: hidden;
  margin-bottom: 12px;
  position: relative;
}

.floating-image {
  animation: image-float 4s ease-in-out infinite;
}

@keyframes image-float {
  0%, 100% {
    transform: translateY(0) scale(1);
  }
  50% {
    transform: translateY(-5px) scale(1.02);
  }
}

.game-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s ease;
}

.game-card-3d:hover .game-image img {
  transform: scale(1.1);
}

.game-info h4 {
  font-size: 0.9rem;
  margin-bottom: 8px;
  color: white;
  font-weight: 600;
}

.players {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  font-size: 0.8rem;
  color: rgba(255, 255, 255, 0.8);
}

.game-description p {
  color: white;
  font-size: 0.9rem;
  margin-bottom: 16px;
  text-align: center;
}

.play-btn {
  background: white;
  color: var(--primary);
  text-decoration: none;
  padding: 8px 16px;
  border-radius: 8px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: var(--transition);
}

.play-btn:hover {
  background: var(--primary-light);
  color: white;
}

.scroll-indicator {
  position: absolute;
  bottom: 30px;
  left: 50%;
  transform: translateX(-50%);
}

.scroll-arrow {
  width: 20px;
  height: 20px;
  border-right: 2px solid rgba(255, 255, 255, 0.5);
  border-bottom: 2px solid rgba(255, 255, 255, 0.5);
  transform: rotate(45deg);
  animation: bounce 2s infinite;
}

@keyframes bounce {
  0%, 20%, 50%, 80%, 100% { transform: rotate(45deg) translateY(0); }
  40% { transform: rotate(45deg) translateY(-10px); }
  60% { transform: rotate(45deg) translateY(-5px); }
}

/* Minimal Games Section */
.minimal-games {
  padding: 100px 0;
  background: var(--bg-secondary);
}

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

.section-header {
  text-align: center;
  margin-bottom: 60px;
}

.section-title {
  font-size: 2.5rem;
  font-weight: 800;
  margin-bottom: 16px;
  background: var(--gradient-primary);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.section-subtitle {
  font-size: 1.1rem;
  color: var(--text-secondary);
  max-width: 600px;
  margin: 0 auto;
}

.games-grid-minimal {
  display: flex;
  flex-direction: column;
  gap: 20px;
  max-width: 800px;
  margin: 0 auto;
}

.game-item-minimal {
  background: var(--card-bg);
  border-radius: var(--border-radius-lg);
  padding: 24px;
  display: flex;
  align-items: center;
  gap: 20px;
  box-shadow: var(--card-shadow);
  transition: var(--transition);
  border: 1px solid transparent;
}

.game-item-minimal:hover {
  transform: translateY(-5px);
  box-shadow: var(--shadow-lg);
  border-color: var(--primary-light);
}

.game-icon {
  font-size: 2.5rem;
  width: 80px;
  height: 80px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--gradient-primary);
  border-radius: 50%;
  flex-shrink: 0;
}

.floating-icon {
  animation: icon-float 3s ease-in-out infinite;
}

@keyframes icon-float {
  0%, 100% {
    transform: translateY(0) rotate(0);
  }
  33% {
    transform: translateY(-3px) rotate(3deg);
  }
  66% {
    transform: translateY(3px) rotate(-3deg);
  }
}

.game-details {
  flex: 1;
}

.game-details h3 {
  font-size: 1.3rem;
  font-weight: 700;
  margin-bottom: 8px;
  color: var(--text-primary);
}

.game-details p {
  color: var(--text-secondary);
  margin-bottom: 12px;
  line-height: 1.5;
}

.game-meta {
  display: flex;
  gap: 16px;
}

.players-count, .game-time {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.9rem;
  color: var(--text-secondary);
}

.game-action {
  flex-shrink: 0;
}

.play-now-btn {
  background: var(--gradient-primary);
  color: white;
  text-decoration: none;
  padding: 12px 20px;
  border-radius: 8px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: var(--transition);
}

.play-now-btn:hover {
  transform: scale(1.05);
  box-shadow: var(--shadow-md);
}

.no-games {
  text-align: center;
  padding: 60px 20px;
  color: var(--text-secondary);
}

.no-games i {
  font-size: 3rem;
  margin-bottom: 16px;
  color: var(--gray);
}

/* Minimal Footer */
.minimal-footer {
  background: var(--dark);
  color: white;
  padding: 60px 0 30px;
}

.footer-content {
  display: grid;
  grid-template-columns: 1fr 2fr;
  gap: 60px;
  margin-bottom: 40px;
}

.footer-brand {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.brand-logo {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 1.5rem;
  font-weight: 700;
}

.brand-logo i {
  color: var(--primary);
}

.footer-description {
  color: rgba(255, 255, 255, 0.7);
  line-height: 1.6;
}

.footer-links {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 40px;
}

.footer-column h4 {
  font-size: 1.1rem;
  font-weight: 700;
  margin-bottom: 20px;
  color: white;
}

.footer-column ul {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.footer-column a {
  color: rgba(255, 255, 255, 0.7);
  text-decoration: none;
  transition: var(--transition);
}

.footer-column a:hover {
  color: white;
  transform: translateX(5px);
}

.footer-bottom {
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  padding-top: 30px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.footer-copyright {
  color: rgba(255, 255, 255, 0.5);
}

.footer-social {
  display: flex;
  gap: 12px;
}

.social-link {
  width: 40px;
  height: 40px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  text-decoration: none;
  transition: var(--transition);
}

.social-link:hover {
  background: var(--primary);
  transform: translateY(-2px);
}

/* Responsive Design - تم التعديل للحركة والتخطيط */
@media (max-width: 1024px) {
  .hero-container {
    grid-template-columns: 1fr;
    gap: 40px;
    text-align: center;
    height: auto;
    padding-top: 40px;
    padding-bottom: 40px;
  }
  
  .hero-text-content {
    max-width: 100%;
    margin: 0 auto;
  }
  
  .hero-stats {
    justify-content: center;
  }
  
  .floating-games-container {
    grid-template-columns: repeat(3, 1fr);
    max-width: 600px;
  }
  
  .footer-content {
    grid-template-columns: 1fr;
    gap: 40px;
  }
}

@media (max-width: 768px) {
  .nav-menu {
    display: none;
  }
  
  .mobile-menu-btn {
    display: flex;
  }
  
  .hero-title {
    font-size: 2.5rem;
  }
  
  .hero-description {
    font-size: 1rem;
    margin-bottom: 30px;
  }
  
  .hero-stats {
    flex-direction: column;
    gap: 20px;
    margin-bottom: 30px;
  }
  
  .stat-number {
    font-size: 2rem;
  }
  
  .hero-actions {
    flex-direction: column;
    gap: 12px;
  }
  
  .btn-primary, .btn-secondary {
    width: 100%;
    justify-content: center;
    padding: 14px 20px;
  }
  
  /* تعديل التخطيط لعرض صورتين بجانب بعض في الموبايل */
  .floating-games-container {
    grid-template-columns: repeat(2, 1fr);
    max-width: 100%;
    gap: 15px;
  }
  
  .game-card-3d {
    height: 160px;
    animation: mobile-float 4s ease-in-out infinite;
  }
  
  @keyframes mobile-float {
    0%, 100% {
      transform: translateY(0);
    }
    50% {
      transform: translateY(-3px);
    }
  }
  
  .game-image {
    height: 90px;
  }
  
  .game-item-minimal {
    flex-direction: column;
    text-align: center;
    gap: 15px;
  }
  
  .game-meta {
    justify-content: center;
  }
  
  .footer-links {
    grid-template-columns: 1fr;
    gap: 30px;
  }
  
  .footer-bottom {
    flex-direction: column;
    gap: 20px;
    text-align: center;
  }
  
  /* إصلاح القائمة المتنقلة */
  .nav-menu.active {
    display: flex !important;
    flex-direction: column;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--bg-primary);
    box-shadow: var(--shadow-lg);
    padding: 20px;
    border-radius: 0 0 var(--border-radius-lg) var(--border-radius-lg);
  }
  
  .mobile-menu-btn.active span:nth-child(1) {
    transform: rotate(45deg) translate(5px, 5px);
  }
  
  .mobile-menu-btn.active span:nth-child(2) {
    opacity: 0;
  }
  
  .mobile-menu-btn.active span:nth-child(3) {
    transform: rotate(-45deg) translate(7px, -6px);
  }
  
  /* إخفاء بعض الأزرار في شريط التنقل للموبايل */
  .nav-actions .btn-login {
    display: none;
  }
  
  .lang-btn span {
    display: none;
  }
  
  .lang-btn {
    padding: 8px;
  }
}

@media (max-width: 480px) {
  .container {
    padding: 0 15px;
  }
  
  .hero-title {
    font-size: 2rem;
  }
  
  .section-title {
    font-size: 2rem;
  }
  
  .floating-games-container {
    grid-template-columns: 1fr;
    max-width: 300px;
  }
  
  .game-card-3d {
    height: 150px;
  }
  
  .game-icon {
    width: 60px;
    height: 60px;
    font-size: 2rem;
  }
  
  .game-details h3 {
    font-size: 1.1rem;
  }
  
  .game-meta {
    flex-direction: column;
    gap: 8px;
  }
}

/* تحسينات للوضع الأفقي في الموبايل */
@media (max-width: 768px) and (orientation: landscape) {
  .minimal-hero {
    min-height: auto;
    padding: 100px 0 50px;
  }
  
  .hero-container {
    grid-template-columns: 1fr;
    gap: 30px;
  }
  
  .hero-content {
    text-align: center;
  }
  
  .hero-stats {
    flex-direction: row;
    justify-content: center;
    gap: 20px;
  }
  
  .hero-actions {
    flex-direction: row;
    justify-content: center;
  }
  
  .btn-primary, .btn-secondary {
    width: auto;
  }
  
  .floating-games-container {
    grid-template-columns: repeat(3, 1fr);
    max-width: 100%;
  }
}

/* تحسينات للقائمة المتنقلة عندما تكون مفتوحة */
body.menu-open {
  overflow: hidden;
}