@import url('https://fonts.googleapis.com/css2?family=Cairo:wght@300;400;600;700;800&display=swap');

:root {
    --primary-purple: #6366f1;
    --primary-red: #f43f5e;
    --text-navy: #1e1b4b;
    --text-muted: #64748b;
    --bg-white: #ffffff;
    --bg-soft: #f8fafc;
    --border: #e2e8f0;
    --card-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.05);
    --border-radius-lg: 12px;
    --border-radius-md: 8px;
    --transition: all 0.3s ease;
}

:root[data-theme="dark"] {
    --bg-white: #0f172a;
    --text-navy: #f8fafc;
    --text-muted: #94a3b8;
    --bg-soft: #1e293b;
    --border: #334155;
}

/* ─── Global Reset ─────────────────────────────────────────── */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Cairo', sans-serif;
}

body {
    direction: rtl;
    background-color: var(--bg-white);
    color: var(--text-navy);
    line-height: 1.6;
    overflow-x: hidden;
    transition: var(--transition);
}

.container {
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 2rem;
}
@media (max-width: 1024px) { .container { padding: 0 1.5rem; } }
@media (max-width: 600px) { .container { padding: 0 1rem; } }

/* Smooth, synchronized theme transitions */
.theme-transitioning,
.theme-transitioning *,
.theme-transitioning *::before,
.theme-transitioning *::after {
    transition: background-color 0.4s cubic-bezier(0.4, 0, 0.2, 1),
                color 0.4s cubic-bezier(0.4, 0, 0.2, 1),
                border-color 0.4s cubic-bezier(0.4, 0, 0.2, 1),
                box-shadow 0.4s cubic-bezier(0.4, 0, 0.2, 1) !important;
}

/* View Transitions for beautiful theme switching */
::view-transition-old(root),
::view-transition-new(root) {
  animation: none;
  mix-blend-mode: normal;
}
::view-transition-old(root) {
  z-index: 2;
}
::view-transition-new(root) {
  z-index: 1;
}
[data-theme="dark"]::view-transition-old(root) {
  z-index: 1;
}
[data-theme="dark"]::view-transition-new(root) {
  z-index: 2;
}

/* Prevent CSS transitions from conflicting with the View Transition snapshot */
html.is-transitioning,
html.is-transitioning *,
html.is-transitioning *::before,
html.is-transitioning *::after {
  transition: none !important;
}

/* Allow the toggle switch to animate independently during the View Transition */
#theme-toggle .switch__background {
  view-transition-name: theme-switch-bg;
}
#theme-toggle .switch__icon {
  view-transition-name: theme-switch-icon;
}
