/* ================================
   GameOasis - Premium Gaming Theme
   EN + AR (RTL) Support
   ================================ */

/* --- CSS Variables --- */
:root {
  --green-dark: #1a3c34;
  --green: #2d6a4f;
  --green-light: #40916c;
  --gold: #d4a843;
  --gold-light: #f0d68a;
  --gold-dark: #b8860b;
  --sand: #f4e4c1;
  --sand-light: #faf3e0;
  --cream: #fff8ec;
  --brown: #8b6914;
  --bg: #0d1b1e;
  --bg-card: #162b2e;
  --text: #e8e0d0;
  --text-secondary: #a8a090;
  --text-muted: #7a756a;
  --border: #2a4a3e;
  --radius: 16px;
  --radius-sm: 8px;
  --shadow: 0 4px 24px rgba(0,0,0,0.4);
  --shadow-lg: 0 8px 40px rgba(0,0,0,0.5);
  --transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  --font-en: 'Poppins', system-ui, sans-serif;
  --font-ar: 'Tajawal', system-ui, sans-serif;
}

/* --- Reset --- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }

body {
  font-family: var(--font-en);
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  overflow-x: hidden;
  line-height: 1.6;
}

[dir="rtl"] body {
  font-family: var(--font-ar);
}

a { color: var(--gold); text-decoration: none; transition: var(--transition); }
a:hover { color: var(--gold-light); }

img { max-width: 100%; }

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

/* --- Language Switcher --- */
.lang-switcher {
  display: flex;
  gap: 4px;
  background: var(--bg-card);
  border-radius: var(--radius-sm);
  padding: 3px;
  border: 1px solid var(--border);
}

.lang-btn {
  padding: 6px 12px;
  border: none;
  border-radius: 6px;
  background: transparent;
  color: var(--text-secondary);
  cursor: pointer;
  font-size: 0.8rem;
  font-weight: 600;
  transition: var(--transition);
  font-family: inherit;
}

.lang-btn.active {
  background: var(--gold);
  color: #000;
}

.lang-btn:hover:not(.active) {
  color: var(--text);
}

/* --- Header --- */
.header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  background: rgba(13, 27, 30, 0.95);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 70px;
}

.logo {
  font-size: 1.4rem;
  font-weight: 800;
  color: var(--gold) !important;
  letter-spacing: -0.5px;
}

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

.nav-link {
  color: var(--text-secondary) !important;
  font-weight: 500;
  font-size: 0.95rem;
  position: relative;
}

.nav-link.active, .nav-link:hover {
  color: var(--gold) !important;
}

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

/* --- Hero --- */
.hero {
  min-height: 100vh;
  display: flex;
  align-items: center;
  position: relative;
  overflow: hidden;
  background: linear-gradient(135deg, #0d1b1e 0%, #1a3c34 40%, #2d4a3a 100%);
}

.hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at 20% 50%, rgba(212,168,67,0.08) 0%, transparent 60%),
              radial-gradient(ellipse at 80% 50%, rgba(45,106,79,0.15) 0%, transparent 60%);
  pointer-events: none;
}

.hero-content {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 60px;
  align-items: center;
  padding: 120px 20px 80px;
  position: relative;
}

.hero-title {
  font-size: 3.2rem;
  font-weight: 800;
  line-height: 1.15;
  margin-bottom: 20px;
}

.hero-title span {
  color: var(--gold);
  font-weight: 700;
}

[dir="rtl"] .hero-title {
  font-size: 2.8rem;
}

.hero-subtitle {
  font-size: 1.1rem;
  color: var(--text-secondary);
  margin-bottom: 32px;
  max-width: 540px;
}

.hero-cta {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 40px;
}

.hero-stats {
  display: flex;
  gap: 24px;
  flex-wrap: wrap;
}

.hero-stats span {
  font-size: 0.9rem;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 6px;
}

/* --- Hero Visual --- */
.hero-visual {
  display: flex;
  align-items: center;
  justify-content: center;
}

.floating-games {
  position: relative;
  width: 320px;
  height: 320px;
}

.float-item {
  position: absolute;
  font-size: 4rem;
  animation: float 6s ease-in-out infinite;
  filter: drop-shadow(0 4px 20px rgba(212,168,67,0.2));
}

.fi-1 { top: 40px; left: 60px; animation-delay: 0s; }
.fi-2 { top: 100px; right: 40px; animation-delay: 1.5s; font-size: 3rem; }
.fi-3 { bottom: 60px; left: 80px; animation-delay: 3s; font-size: 5rem; }
.fi-4 { bottom: 100px; right: 80px; animation-delay: 4.5s; font-size: 2.5rem; }

@keyframes float {
  0%, 100% { transform: translateY(0) rotate(0deg); }
  50% { transform: translateY(-20px) rotate(5deg); }
}

/* --- Buttons --- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 28px;
  border: 2px solid transparent;
  border-radius: var(--radius-sm);
  font-weight: 600;
  font-size: 0.95rem;
  cursor: pointer;
  transition: var(--transition);
  font-family: inherit;
  white-space: nowrap;
}

.btn-primary {
  background: var(--green);
  color: white !important;
}

.btn-primary:hover {
  background: var(--green-light);
  transform: translateY(-2px);
  box-shadow: 0 4px 16px rgba(45,106,79,0.4);
}

.btn-outline {
  background: transparent;
  border-color: var(--border);
  color: var(--text) !important;
}

.btn-outline:hover {
  border-color: var(--gold);
  color: var(--gold) !important;
  transform: translateY(-2px);
}

.btn-gold {
  background: var(--gold);
  color: #000 !important;
  font-weight: 700;
}

.btn-gold:hover {
  background: var(--gold-light);
  transform: translateY(-2px);
  box-shadow: 0 4px 16px rgba(212,168,67,0.4);
}

.btn-lg {
  padding: 16px 36px;
  font-size: 1.05rem;
}

.btn-sm {
  padding: 8px 18px;
  font-size: 0.85rem;
}

.btn-block {
  width: 100%;
}

/* --- Sections --- */
.section {
  padding: 80px 0;
}

.section:nth-child(even) {
  background: rgba(22, 43, 46, 0.5);
}

.section-title {
  text-align: center;
  font-size: 2.4rem;
  font-weight: 800;
  margin-bottom: 12px;
}

.section-desc {
  text-align: center;
  color: var(--text-secondary);
  max-width: 600px;
  margin: 0 auto 48px;
}

/* --- Games Grid --- */
.games-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 24px;
}

.game-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  transition: var(--transition);
}

.game-card:hover {
  transform: translateY(-6px);
  border-color: var(--green-light);
  box-shadow: var(--shadow-lg);
}

.card-img {
  height: 180px;
  background: linear-gradient(135deg, var(--green-dark), var(--bg-card));
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  padding: 12px;
  position: relative;
  overflow: hidden;
}

.card-img::after {
  content: '🎮';
  position: absolute;
  font-size: 5rem;
  right: 20px;
  bottom: -10px;
  opacity: 0.3;
}

.card-badge {
  padding: 4px 12px;
  background: rgba(0,0,0,0.5);
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 600;
  backdrop-filter: blur(4px);
}

.card-price {
  padding: 4px 12px;
  background: var(--gold);
  color: #000;
  border-radius: 20px;
  font-size: 0.8rem;
  font-weight: 700;
}

.card-body {
  padding: 18px;
}

.card-title {
  font-size: 1.15rem;
  font-weight: 700;
  margin-bottom: 8px;
}

.card-desc {
  font-size: 0.85rem;
  color: var(--text-secondary);
  margin-bottom: 12px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.card-tags {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}

.tag {
  padding: 3px 10px;
  background: rgba(212,168,67,0.15);
  border: 1px solid rgba(212,168,67,0.3);
  border-radius: 20px;
  font-size: 0.7rem;
  color: var(--gold);
  font-weight: 500;
}

.card-actions {
  display: flex;
  gap: 8px;
}

/* --- Skeleton --- */
.game-card.skeleton .card-img { background: var(--border); }
.game-card.skeleton .card-body { padding: 18px; }
.skeleton-line {
  height: 14px;
  background: var(--border);
  border-radius: 4px;
  margin-bottom: 10px;
  animation: shimmer 1.5s infinite;
}

@keyframes shimmer {
  0% { opacity: 0.5; }
  50% { opacity: 1; }
  100% { opacity: 0.5; }
}

/* --- Pricing --- */
.pricing-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 24px;
  max-width: 1100px;
  margin: 0 auto;
}

.pricing-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 32px 24px;
  text-align: center;
  transition: var(--transition);
  position: relative;
}

.pricing-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
}

.pricing-card.popular {
  border-color: var(--gold);
  background: linear-gradient(135deg, var(--bg-card), rgba(212,168,67,0.08));
}

.popular-badge {
  position: absolute;
  top: -12px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--gold);
  color: #000;
  padding: 4px 20px;
  border-radius: 20px;
  font-size: 0.8rem;
  font-weight: 700;
  white-space: nowrap;
}

.pricing-name {
  font-size: 1.1rem;
  font-weight: 600;
  margin-bottom: 8px;
  color: var(--text-secondary);
}

.pricing-price {
  font-size: 3rem;
  font-weight: 800;
  color: var(--gold);
  margin-bottom: 20px;
}

.pricing-features {
  list-style: none;
  margin-bottom: 24px;
  text-align: left;
  padding: 0;
}

[dir="rtl"] .pricing-features {
  text-align: right;
}

.pricing-features li {
  padding: 8px 0;
  color: var(--text-secondary);
  font-size: 0.9rem;
}

/* --- Modal --- */
.modal {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 200;
  align-items: center;
  justify-content: center;
}

.modal.active {
  display: flex;
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.7);
  backdrop-filter: blur(4px);
}

.modal-content {
  position: relative;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  max-width: 600px;
  width: 90%;
  max-height: 85vh;
  overflow-y: auto;
  z-index: 1;
}

.modal-game {
  max-width: 700px;
}

.modal-close {
  position: absolute;
  top: 12px;
  right: 16px;
  background: none;
  border: none;
  color: var(--text);
  font-size: 1.8rem;
  cursor: pointer;
  z-index: 5;
  line-height: 1;
  font-family: inherit;
}

[dir="rtl"] .modal-close {
  right: auto;
  left: 16px;
}

.modal-game-header {
  padding: 28px 28px 0;
}

.modal-game-header h2 {
  font-size: 1.6rem;
  font-weight: 700;
  margin-bottom: 8px;
}

.modal-game-header p {
  color: var(--text-secondary);
  margin-bottom: 16px;
}

.game-tags {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}

.modal-game-body {
  padding: 20px 28px 28px;
}

#gameFrame {
  background: #0a0a0a;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  min-height: 350px;
  margin-bottom: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.play-placeholder {
  font-size: 1.2rem;
  color: var(--text-muted);
}

.game-iframe {
  width: 100%;
  height: 400px;
  border-radius: var(--radius-sm);
}

#playBtn { margin-bottom: 10px; }

/* --- Footer --- */
.footer {
  border-top: 1px solid var(--border);
  padding: 40px 0;
  background: rgba(13,27,30,0.8);
}

.footer-inner {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
}

.footer-logo, .footer-brand p {
  font-size: 1rem;
  font-weight: 700;
  color: var(--gold);
}

.footer-brand p {
  font-size: 0.85rem;
  color: var(--text-muted);
  font-weight: 400;
}

.footer-links {
  display: flex;
  gap: 20px;
}

.footer-links a {
  color: var(--text-secondary) !important;
  font-size: 0.9rem;
}

.footer-copy {
  color: var(--text-muted);
  font-size: 0.8rem;
}

/* --- RTL Overrides --- */
[dir="rtl"] .hero-title {
  letter-spacing: 0;
}

[dir="rtl"] .card-actions {
  flex-direction: row-reverse;
}

[dir="rtl"] .card-img::after {
  right: auto;
  left: 20px;
}

/* --- Responsive --- */
@media (max-width: 768px) {
  .hero-content {
    grid-template-columns: 1fr;
    text-align: center;
    padding-top: 100px;
  }
  
  .hero-subtitle {
    max-width: 100%;
  }
  
  .hero-cta, .hero-stats {
    justify-content: center;
  }
  
  .hero-visual { display: none; }
  
  .hero-title {
    font-size: 2.2rem;
  }
  
  .nav {
    display: none;
  }
  
  .games-grid, .pricing-grid {
    grid-template-columns: 1fr;
  }
  
  .section-title {
    font-size: 1.8rem;
  }
}
