@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&family=Tajawal:wght@300;400;500;700;800;900&display=swap');

:root {
  /* Color Palette */
  --color-primary: #0f0c29;
  --color-primary-light: #302b63;
  --color-primary-lighter: #24243e;
  --color-accent: #00d4ff;
  --color-accent-hover: #00b8e6;
  --color-secondary: #7c3aed;
  --color-cta: #f59e0b;
  --color-cta-hover: #d97706;
  
  /* Neutral colors */
  --color-text: #f3f4f6;
  --color-text-muted: #9ca3af;
  --color-bg: #030014;
  --color-bg-card: rgba(255, 255, 255, 0.05);
  --color-bg-glass: rgba(15, 12, 41, 0.7);
  --color-border: rgba(255, 255, 255, 0.1);
  --color-border-focus: rgba(0, 212, 255, 0.5);

  /* Typography */
  --font-arabic: 'Tajawal', sans-serif;
  --font-english: 'Inter', sans-serif;
  
  /* Shadows & Effects */
  --shadow-glass: 0 8px 32px 0 rgba(0, 0, 0, 0.37);
  --shadow-glow: 0 0 15px rgba(0, 212, 255, 0.5);
  --backdrop-blur: blur(12px);
  
  /* Transitions */
  --transition-fast: 0.2s ease;
  --transition-medium: 0.3s ease-in-out;
  --transition-slow: 0.5s cubic-bezier(0.4, 0, 0.2, 1);
  
  /* Borders */
  --radius-sm: 4px;
  --radius-md: 8px;
  --radius-lg: 16px;
  --radius-xl: 24px;
  --radius-round: 50%;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  font-size: 16px;
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-arabic);
  background-color: var(--color-bg);
  color: var(--color-text);
  line-height: 1.6;
  overflow-x: hidden;
  direction: rtl; /* Default Arabic RTL */
}

body[dir="ltr"] {
  font-family: var(--font-english);
}

/* Typography base */
h1, h2, h3, h4, h5, h6 {
  font-weight: 700;
  line-height: 1.3;
  margin-bottom: 1rem;
  color: #fff;
}

h1 { font-size: 3rem; }
h2 { font-size: 2.25rem; }
h3 { font-size: 1.75rem; }
h4 { font-size: 1.25rem; }

p {
  margin-bottom: 1rem;
  color: var(--color-text-muted);
}

a {
  color: var(--color-accent);
  text-decoration: none;
  transition: color var(--transition-fast);
}

a:hover {
  color: var(--color-accent-hover);
}

ul {
  list-style: none;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

/* Layout Core */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
}

.section {
  padding: 80px 0;
}

/* Base UI Components */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.75rem 1.5rem;
  border-radius: var(--radius-md);
  font-weight: 600;
  font-size: 1rem;
  cursor: pointer;
  border: none;
  transition: all var(--transition-medium);
  font-family: inherit;
  gap: 0.5rem;
  text-align: center;
}

.btn-primary {
  background: linear-gradient(135deg, var(--color-accent) 0%, #0077ff 100%);
  color: #fff;
  box-shadow: 0 4px 15px rgba(0, 212, 255, 0.3);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(0, 212, 255, 0.5);
}

.btn-secondary {
  background: var(--color-bg-card);
  color: #fff;
  border: 1px solid var(--color-border);
  backdrop-filter: var(--backdrop-blur);
}

.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.1);
  transform: translateY(-2px);
  border-color: rgba(255, 255, 255, 0.2);
}

.btn-cta {
  background: linear-gradient(135deg, var(--color-cta) 0%, #d97706 100%);
  color: #fff;
}

.btn-cta:hover {
  background: linear-gradient(135deg, #d97706 0%, #b45309 100%);
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(245, 158, 11, 0.4);
}

.glass-card {
  background: var(--color-bg-card);
  backdrop-filter: var(--backdrop-blur);
  -webkit-backdrop-filter: var(--backdrop-blur);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: 2rem;
  box-shadow: var(--shadow-glass);
  transition: transform var(--transition-medium), border-color var(--transition-medium), box-shadow var(--transition-medium);
}

.glass-card:hover {
  transform: translateY(-5px);
  border-color: var(--color-accent);
  box-shadow: var(--shadow-glow);
}

/* Header & Nav */
.header {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  z-index: 1000;
  background: var(--color-bg-glass);
  backdrop-filter: var(--backdrop-blur);
  border-bottom: 1px solid var(--color-border);
  transition: all var(--transition-medium);
  padding: 15px 0;
}

.header.scrolled {
  padding: 10px 0;
  background: rgba(3, 0, 20, 0.9);
  box-shadow: 0 4px 30px rgba(0, 0, 0, 0.5);
}

.nav-container {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.logo {
  font-size: 1.5rem;
  font-weight: 800;
  color: #fff;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.logo span {
  color: var(--color-accent);
}

.logo img {
  height: 48px;
  border-radius: var(--radius-sm);
}

.nav-links {
  display: flex;
  gap: 2rem;
  align-items: center;
}

.nav-links a {
  color: var(--color-text);
  font-weight: 500;
  position: relative;
  padding: 0.5rem 0;
}

.nav-links a:hover,
.nav-links a.active {
  color: var(--color-accent);
}

.nav-links a::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 0;
  height: 2px;
  background-color: var(--color-accent);
  transition: width var(--transition-medium);
}

.nav-links a:hover::after,
.nav-links a.active::after {
  width: 100%;
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.cart-icon {
  position: relative;
  color: #fff;
  font-size: 1.25rem;
  cursor: pointer;
  transition: color var(--transition-fast);
}

.cart-icon:hover {
  color: var(--color-accent);
}

.cart-count {
  position: absolute;
  top: -8px;
  right: -8px;
  background-color: var(--color-cta);
  color: #fff;
  font-size: 0.75rem;
  font-weight: 700;
  width: 18px;
  height: 18px;
  border-radius: var(--radius-round);
  display: flex;
  align-items: center;
  justify-content: center;
}

.mobile-menu-btn {
  display: none;
  color: #fff;
  font-size: 1.5rem;
  cursor: pointer;
  background: none;
  border: none;
}

/* Animations Core */
.fade-in {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.8s ease-out, transform 0.8s ease-out;
}

.fade-in.appear {
  opacity: 1;
  transform: translateY(0);
}

/* Utilities */
.text-center { text-align: center; }
.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }
.mb-4 { margin-bottom: 2rem; }
.mb-5 { margin-bottom: 3rem; }
.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mt-4 { margin-top: 2rem; }
.mt-5 { margin-top: 3rem; }

/* Section Title */
.section-title {
  text-align: center;
  margin-bottom: 3rem;
  position: relative;
}

.section-title h2 {
  font-size: 2.5rem;
  display: inline-block;
  margin-bottom: 1rem;
}

.section-title p {
  max-width: 600px;
  margin: 0 auto;
  font-size: 1.125rem;
}

/* Footer Core */
.footer {
  background: #050314;
  padding: 60px 0 20px;
  border-top: 1px solid var(--color-border);
}

.footer-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 2rem;
  margin-bottom: 3rem;
}

.footer-col h3 {
  font-size: 1.25rem;
  margin-bottom: 1.5rem;
  color: #fff;
}

.footer-links li {
  margin-bottom: 0.75rem;
}

.footer-links a {
  color: var(--color-text-muted);
}

.footer-links a:hover {
  color: var(--color-accent);
  padding-right: 5px; /* RTL aware */
}

.social-links {
  display: flex;
  gap: 1rem;
  margin-top: 1.5rem;
}

.social-links a {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: var(--radius-round);
  background: var(--color-bg-card);
  color: #fff;
  transition: all var(--transition-medium);
}

.social-links a:hover {
  background: var(--color-accent);
  transform: translateY(-3px);
  box-shadow: 0 4px 15px rgba(0, 212, 255, 0.4);
}

.footer-bottom {
  text-align: center;
  padding-top: 20px;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

/* Responsive */
@media (max-width: 992px) {
  .nav-links, .nav-actions .btn-cta {
    display: none; /* Mobile menu style to be handled via JS */
  }
  
  .mobile-menu-btn {
    display: block;
  }
  
  .nav-active .nav-links {
    display: flex;
    flex-direction: column;
    position: absolute;
    top: 100%;
    left: 0;
    width: 100%;
    background: var(--color-bg-glass);
    backdrop-filter: var(--backdrop-blur);
    padding: 2rem;
    box-shadow: 0 10px 30px rgba(0,0,0,0.5);
    border-top: 1px solid var(--color-border);
  }
  
  h1 { font-size: 2.25rem; }
  h2 { font-size: 1.8rem; }
}

@media (max-width: 768px) {
  .section { padding: 60px 0; }
  .footer-bottom {
    flex-direction: column;
    gap: 1rem;
  }
}
