/*
Technical Summary:
This stylesheet handles the global theming, typography, and component styling for the Orpita application.
It includes CSS variables for the color palette, extensive multi-language font support (Latin/Arabic),
and custom animations. It also defines structural layouts for the Hero section, Swiper/Games carousel,
and reusable UI components like buttons and cards, ensuring responsive behavior and RTL support.
*/

/* ====================
   CONFIGURATION
   ==================== */
:root {
  /* Base Colors */
  --violet-600: #7c3aed;
  --bg-0: #030712;
  --muted: #9ca3af;

  /* Card System Variables */
  --bg-card: rgba(30, 41, 59, 0.5); /* slate-800/50 */
  --border-card: #334155;           /* slate-700 */
  --border-hover: #7c3aed50;        /* violet-600 with opacity */
  --text-main: #ffffff;
  --text-accent: #a78bfa;           /* violet-400 */
  --btn-bg: #374151;                /* gray-700 */
  --btn-hover: #1f2937;             /* gray-800 */

  /* Dimensions & Effects */
  --radius-xl: 1rem;
  --radius-2xl: 1.25rem;
  --shadow-xl: 0 20px 25px -5px rgba(0,0,0,.4);
}

/* ====================
   TYPOGRAPHY SETUP
   ==================== */

/* --------------------
   Latin Fonts
   -------------------- */
@font-face {
  font-family: 'Orbitron';
  src: url('/assets/fonts/orbitron/Orbitron-Black.woff2') format('truetype');
  font-weight: 900;
  font-display: swap;
}

@font-face {
  font-family: 'Orbitron';
  src: url('/assets/fonts/orbitron/Orbitron-Bold.woff2') format('truetype');
  font-weight: 700;
  font-display: swap;
}

@font-face {
  font-family: 'Inter';
  src: url('/assets/fonts/inter/Inter_18pt-Regular.woff2') format('truetype');
  font-weight: 400;
  font-display: swap;
}

@font-face {
  font-family: 'Inter';
  src: url('/assets/fonts/inter/Inter_18pt-Medium.woff2') format('truetype');
  font-weight: 500;
  font-display: swap;
}

/* --------------------
   Arabic Fonts
   -------------------- */
/* Cairo - Orbitron Alternative */
@font-face {
  font-family: 'Cairo';
  src: url('/assets/fonts/cairo/Cairo-Black.woff2') format('truetype');
  font-weight: 900;
  font-display: swap;
}

@font-face {
  font-family: 'Cairo';
  src: url('/assets/fonts/cairo/Cairo-Bold.woff2') format('truetype');
  font-weight: 700;
  font-display: swap;
}

/* Vazirmatn - Inter Alternative */
@font-face {
  font-family: 'Vazirmatn';
  src: url('/assets/fonts/vazirmatn/Vazirmatn-Regular.woff2') format('truetype');
  font-weight: 400;
  font-display: swap;
}

@font-face {
  font-family: 'Vazirmatn';
  src: url('/assets/fonts/vazirmatn/Vazirmatn-SemiBold.woff2') format('truetype');
  font-weight: 500;
  font-display: swap;
}

/* ====================
   BASE STYLES
   ==================== */
html {
  scroll-behavior: smooth;
}

body {
  font-family: 'Inter', sans-serif;
  line-height: 1.6;
  color: #e6eef8;
  margin: 0;
}

/* Background Overlay */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  height: 100vh;
  width: 100vw;
  background: linear-gradient(180deg, #0F0823 0%, #030712 100%);
  z-index: -10;
  pointer-events: none;
}

/* --------------------
   Global Font Assignment
   -------------------- */
h1 {
  view-transition-name: unset;
  display: block;
}

/* Fallback priority: Orbitron -> Cairo -> Sans-serif */
h1, h2, h3, h4, h5, h6,
h1 span, h2 span, h3 span, h4 span,
.font-title {
  font-family: 'Orbitron', 'Cairo', sans-serif !important;
}

body, p, span, a, button, input, select, textarea, .font-body {
  font-family: 'Inter', 'Vazirmatn', sans-serif;
}

/* --------------------
   Language Adjustments
   -------------------- */
[lang="ar"] {
  line-height: 1.6;
}

[lang="ar"] body {
  /* Slight visual size adjustment for Arabic script */
  font-size: 1.04rem;
}

/* ====================
   ANIMATIONS
   ==================== */
@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(50px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes pulse-glow {
  0%, 100% { box-shadow: 0 0 10px 3px rgba(139, 92, 246, 0.1); }
  50% { box-shadow: 0 0 20px 7px rgba(139, 92, 246, 0.5); }
}

@keyframes gradient-shift-alt {
  0% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

@keyframes gradient-shift {
  0% { background-position: 0% 50%; }
  100% { background-position: 300% 50%; }
}

@keyframes initialSlideUp {
  from { opacity: 0; transform: translateY(50%); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes slideUpOut {
  from { transform: translateY(0); opacity: 1; }
  to { transform: translateY(-50%); opacity: 0; }
}

@keyframes slideUpIn {
  from { transform: translateY(100%); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

/* ====================
   UTILITIES & HELPERS
   ==================== */
.animate-fade-in { animation: fadeIn 1s ease-out forwards; }
.animate-pulse-glow { animation: pulse-glow 2.5s infinite ease-in-out; }

.animate-fade-in-up {
  animation: fadeInUp 0.5s ease-out forwards;
  opacity: 0;
}

.animate-gradient-text {
  background-size: 200% auto;
  background-clip: text;
  -webkit-background-clip: text;
  color: transparent;
  animation: gradient-shift-alt 5s ease infinite;
}

.gradient-text-js {
  background: linear-gradient(45deg, #a78bfa, #8b5cf6, #d8b4fe, #a78bfa);
  background-size: 400% auto;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  animation: gradient-shift 6s linear infinite;
}

.no-scrollbar::-webkit-scrollbar { display: none; }
.no-scrollbar { -ms-overflow-style: none; scrollbar-width: none; }

/* --------------------
   Theme Container
   -------------------- */
.SectionTheme {
  position: relative;
  border-radius: 2rem;
  background: #05040B66;
  overflow: hidden;
  border: 2px solid #a8b4fe22;
  width: 100%;
  max-width: 1152px;
  margin-left: auto;
  margin-right: auto;
  padding: 2rem;
}

@media (min-width: 768px) {
  .SectionTheme {
    padding: 4rem;
  }
}

/* افترضنا إن الـ ID اللي أنت بتستخدمه في الجافا سكريبت هو tsparticles */
#tsparticles {
  position: absolute; /* أو fixed لو عاوزها خلفية ثابتة للموقع كله */
  width: 100%;
  height: 100%;
  top: 0;
  left: 0;
  z-index: -1; /* عشان تكون خلف المحتوى */
  
}

/* أهم جزء عشان الـ Reflow: استهداف الـ canvas اللي المكتبة بتعمله */
#tsparticles canvas {
  display: block;
  vertical-align: bottom;
}

/* ====================
   UI COMPONENTS
   ==================== */

/* --------------------
   Buttons
   -------------------- */
.btn-primary {
  background-color: #7c3aed;
  color: #ffffff;
  font-weight: bold;
  font-size: 1.125rem;
  padding: 12px 40px;
  border-radius: 9999px;
  transition: all 0.3s ease-in-out;
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
  white-space: nowrap;
  display: inline-block;
  border: none;
  cursor: pointer;
}

.btn-primary:hover {
  background-color: #6d28d9;
  transform: scale(1.05);
}

.btn-secondary {
  background-color: rgba(255, 255, 255, 0.1); /* white/10 */
  color: #ffffff;
  border: 1px solid rgba(255, 255, 255, 0.2); /* border-white/20 */
  font-weight: bold;
  font-size: 1.125rem;
  padding: 12px 40px;
  border-radius: 9999px;
  display: inline-block;
  text-decoration: none;
  transition: all 0.3s ease-in-out;
  box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05); /* shadow-sm */
  white-space: nowrap;
  cursor: pointer;
}

.btn-secondary:hover {
  background-color: rgba(255, 255, 255, 0.2); /* hover:bg-white/20 */
  border-color: rgba(124, 58, 237, 0.5); /* hover:border-violet-500/50 */
  color: #ddd6fe; /* hover:text-violet-300 */
  transform: scale(1.05); /* hover:scale-105 */
}

/* ====================
   SECTION: HERO
   ==================== */
.hero-line-container {
  container-type: inline-size;
  display: flex;
  width: 100%;
  opacity: 0;
  animation: initialSlideUp 0.3s ease-out forwards;
  margin-bottom: 0.5rem;
}

.fit-text {
  display: flex;
  align-items: baseline;
  width: 100%;
  /* Size Logic: clamp prevents overflow/underflow, 11cqw fills container width */
  font-size: clamp(1rem, 8cqw, 8rem);
  font-weight: 800;
  line-height: 1;
}

.static-hero-text {
  white-space: pre;
  flex-shrink: 0;
}

.dynamic-text-container {
  position: relative;
  height: 1.1em;
  text-align: inherit;
  flex-grow: 1;
  display: block;
  overflow: hidden;
  flex-basis: auto;
}

.dynamic-text {
  white-space: nowrap;
  display: block;
  width: 100%;
  transform-origin: left bottom;
}

/* --------------------
   RTL Overrides
   -------------------- */
[dir="rtl"] .dynamic-text-container {
  text-align: right;
}

[dir="rtl"] .hero-line-container {
  flex-direction: row;
}

/* ====================
   SECTION: GAMES (SWIPER)
   ==================== */
#mobile-dropdown {
  z-index: 999;
}

#mobile-dropdown a {
  position: relative;
  z-index: 1000;
  pointer-events: auto;
}

.swiper-slide {
  width: 85% !important;
  max-width: 350px;
  flex-direction: column;
  display: Flex;
  transition: transform 0.8s cubic-bezier(0.34, 1.56, 0.64, 1), opacity 0.5s ease;
  will-change: transform;
  backface-visibility: hidden;
  opacity: 0.7;
  height: auto !important;
}

.swiper-wrapper {
  display: flex;
  align-items: stretch; /* Forces equal height for cards */
}

.swiper-slide-active {
  opacity: 1;
  z-index: 10;
}

.swiper-pagination {
  position: relative;
  margin-top: 20px;
  bottom: 0 !important;
}

.swiper-pagination-bullet {
  background: #8b5cf6 !important;
  width: 8px;
  height: 8px;
  opacity: 1;
  transition: all 0s ease;
}

.swiper-pagination-bullet-active {
  border-radius: 12px !important;
  opacity: 1;
}

@media (min-width: 1024px) {
  .swiper-slide {
    width: 350px !important;
  }
}