/* ========================================
   FALAFEL KAM HABBA - Design System
   Modern 2026 UI with Arabic RTL
   ======================================== */

/* --- CSS Custom Properties --- */
:root {
  --red: #C41E3A;
  --red-light: #E8344F;
  --red-dark: #9A1830;
  --gold: #FFD700;
  --gold-light: #FFE44D;
  --gold-dark: #CCB000;
  --bg-dark: #0D0A08;
  --bg-card: #1A1614;
  --bg-card-hover: #231F1C;
  --bg-surface: #141110;
  --bg-warm: #FFF8F0;
  --bg-warm-alt: #FFF3E6;
  --text-primary: #FAFAF9;
  --text-secondary: #A8A29E;
  --text-muted: #78716C;
  --text-dark: #1C1917;
  --text-dark-secondary: #57534E;
  --border: rgba(255,255,255,0.06);
  --border-light: rgba(0,0,0,0.08);
  --glass: rgba(26,22,20,0.8);
  --glass-light: rgba(255,255,255,0.05);
  --shadow-sm: 0 1px 2px rgba(0,0,0,0.3);
  --shadow-md: 0 4px 16px rgba(0,0,0,0.3);
  --shadow-lg: 0 8px 32px rgba(0,0,0,0.4);
  --shadow-xl: 0 16px 64px rgba(0,0,0,0.5);
  --shadow-glow-red: 0 0 40px rgba(196,30,58,0.3);
  --shadow-glow-gold: 0 0 40px rgba(255,215,0,0.2);
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 24px;
  --radius-full: 9999px;
  --font-ar: 'Cairo', 'Tajawal', system-ui, sans-serif;
  --font-en: 'Inter', system-ui, sans-serif;
  --transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-spring: 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
  --ease-out: cubic-bezier(0, 0, 0.2, 1);
  --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* --- Reset & Base --- */
*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
  scroll-padding-top: 80px;
}

body {
  font-family: var(--font-ar);
  background: var(--bg-dark);
  color: var(--text-primary);
  line-height: 1.7;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

a {
  text-decoration: none;
  color: inherit;
  transition: var(--transition);
}

button {
  cursor: pointer;
  border: none;
  background: none;
  font-family: inherit;
  font-size: inherit;
  color: inherit;
}

input, textarea, select {
  font-family: inherit;
  font-size: inherit;
}

ul, ol { list-style: none; }

::selection {
  background: var(--red);
  color: white;
}

::-webkit-scrollbar {
  width: 6px;
}
::-webkit-scrollbar-track {
  background: var(--bg-dark);
}
::-webkit-scrollbar-thumb {
  background: var(--red-dark);
  border-radius: 3px;
}
::-webkit-scrollbar-thumb:hover {
  background: var(--red);
}

/* --- Layout --- */
.container {
  width: 100%;
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 24px;
}

/* --- Typography --- */
.text-accent {
  color: var(--red);
}
.text-gold {
  color: var(--gold);
}

.section-header {
  text-align: center;
  margin-bottom: 48px;
}
.section-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 16px;
  background: rgba(196,30,58,0.1);
  border: 1px solid rgba(196,30,58,0.2);
  border-radius: var(--radius-full);
  color: var(--red-light);
  font-size: 0.85rem;
  font-weight: 600;
  margin-bottom: 16px;
}
.section-title {
  font-size: clamp(1.8rem, 4vw, 2.8rem);
  font-weight: 800;
  line-height: 1.2;
  margin-bottom: 12px;
}
.section-desc {
  font-size: 1.05rem;
  color: var(--text-secondary);
  max-width: 500px;
  margin: 0 auto;
}

/* --- Buttons --- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 28px;
  border-radius: var(--radius-full);
  font-weight: 600;
  font-size: 0.95rem;
  transition: var(--transition);
  position: relative;
  overflow: hidden;
  white-space: nowrap;
}
.btn::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(255,255,255,0.15), transparent);
  opacity: 0;
  transition: var(--transition);
}
.btn:hover::before { opacity: 1; }

.btn-primary {
  background: linear-gradient(135deg, var(--red), var(--red-dark));
  color: white;
  box-shadow: 0 4px 16px rgba(196,30,58,0.3);
}
.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 24px rgba(196,30,58,0.4);
}

.btn-ghost {
  background: transparent;
  color: var(--text-primary);
  border: 1px solid var(--border);
}
.btn-ghost:hover {
  border-color: var(--red);
  color: var(--red-light);
}

.btn-gold {
  background: linear-gradient(135deg, var(--gold), var(--gold-dark));
  color: var(--bg-dark);
}

.btn-sm {
  padding: 8px 18px;
  font-size: 0.85rem;
}
.btn-lg {
  padding: 14px 36px;
  font-size: 1.05rem;
}
.btn-block {
  width: 100%;
}
.btn-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: var(--radius-md);
  transition: var(--transition);
  color: var(--text-secondary);
}
.btn-icon:hover {
  background: var(--glass-light);
  color: var(--text-primary);
}

/* --- Form Elements --- */
.form-input {
  width: 100%;
  padding: 12px 16px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-size: 0.95rem;
  transition: var(--transition);
  outline: none;
}
.form-input:focus {
  border-color: var(--red);
  box-shadow: 0 0 0 3px rgba(196,30,58,0.15);
}
.form-input::placeholder {
  color: var(--text-muted);
}
.form-group {
  margin-bottom: 16px;
}
.form-group label {
  display: block;
  margin-bottom: 6px;
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--text-secondary);
}

/* --- Toast --- */
.toast-container {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 10000;
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
}
.toast {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 20px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  color: var(--text-primary);
  font-size: 0.9rem;
  font-weight: 500;
  pointer-events: auto;
  animation: toastIn 0.4s var(--ease-spring) forwards;
  backdrop-filter: blur(20px);
}
.toast.toast-out {
  animation: toastOut 0.3s var(--ease-out) forwards;
}
.toast-icon {
  font-size: 1.2rem;
}
.toast-success { border-color: rgba(34,197,94,0.3); }
.toast-error { border-color: rgba(239,68,68,0.3); }

@keyframes toastIn {
  from { opacity: 0; transform: translateY(20px) scale(0.95); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}
@keyframes toastOut {
  from { opacity: 1; transform: translateY(0) scale(1); }
  to { opacity: 0; transform: translateY(-10px) scale(0.95); }
}

/* --- Modal Base --- */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.7);
  backdrop-filter: blur(8px);
  z-index: 5000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  opacity: 0;
  visibility: hidden;
  transition: var(--transition);
}
.modal-overlay.active {
  opacity: 1;
  visibility: visible;
}
.modal-content {
  background: var(--bg-card);
  border-radius: var(--radius-xl);
  max-width: 520px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  position: relative;
  transform: translateY(20px) scale(0.97);
  transition: var(--transition-spring);
  border: 1px solid var(--border);
}
.modal-overlay.active .modal-content {
  transform: translateY(0) scale(1);
}
.modal-close {
  position: absolute;
  top: 16px;
  left: 16px;
  z-index: 10;
  width: 36px;
  height: 36px;
  border-radius: var(--radius-full);
  background: rgba(0,0,0,0.5);
  backdrop-filter: blur(10px);
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  transition: var(--transition);
}
.modal-close:hover {
  background: var(--red);
}

/* --- Responsive --- */
@media (max-width: 768px) {
  .container {
    padding: 0 16px;
  }
  .section-header {
    margin-bottom: 32px;
  }
}
