/* ================================
   BASE.CSS - Reset + Variables + Typography + RTL
   ================================ */

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

html {
    scroll-behavior: smooth;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    font-family: 'Cairo', system-ui, -apple-system, sans-serif;
    font-size: 16px;
    line-height: 1.6;
    color: var(--color-text-primary);
    background-color: var(--color-bg-primary);
    direction: rtl;
    transition: background-color 0.3s ease, color 0.3s ease;
}

/* CSS Variables - Light Mode */
:root {
    /* Colors */
    --color-bg-primary: #FFFFFF;
    --color-bg-secondary: #F6F8FB;
    --color-text-primary: #0B1220;
    --color-text-secondary: #475569;
    --color-navy: #0B1F3A;
    --color-navy-dark: #07162A;
    --color-gold: #C9A227;
    --color-gold-hover: #B8921F;
    --color-border: #E5E7EB;
    --color-success: #16A34A;
    --color-warning: #F59E0B;
    --color-error: #DC2626;
    
    /* Spacing */
    --space-xs: 4px;
    --space-sm: 8px;
    --space-md: 16px;
    --space-lg: 24px;
    --space-xl: 32px;
    --space-2xl: 40px;
    --space-3xl: 48px;
    --space-4xl: 64px;
    
    /* Border Radius */
    --radius-sm: 10px;
    --radius-md: 16px;
    --radius-lg: 22px;
    
    /* Shadows */
    --shadow-card: 0 10px 30px rgba(2, 8, 23, 0.08);
    --shadow-hover: 0 18px 50px rgba(2, 8, 23, 0.12);
    --shadow-modal: 0 25px 70px rgba(2, 8, 23, 0.2);
    
    /* Layout */
    --container-max-width: 1200px;
    --gutter: 24px;
    
    /* Transitions */
    --transition-base: 180ms ease;
    --transition-slow: 500ms cubic-bezier(0.22, 1, 0.36, 1);
    
    /* Z-index */
    --z-navbar: 1000;
    --z-modal: 2000;
    --z-toast: 3000;
    --z-whatsapp: 1500;
}

/* Dark Mode Variables */
body.dark-mode {
    --color-bg-primary: #070A10;
    --color-bg-secondary: #0C1220;
    --color-text-primary: #E5E7EB;
    --color-text-secondary: #94A3B8;
    --color-border: #1F2937;
    --shadow-card: 0 10px 30px rgba(0, 0, 0, 0.3);
    --shadow-hover: 0 18px 50px rgba(0, 0, 0, 0.4);
    --shadow-modal: 0 25px 70px rgba(0, 0, 0, 0.6);
}

/* Typography System */
h1, h2, h3, h4, h5, h6 {
    font-weight: 700;
    line-height: 1.3;
    color: var(--color-text-primary);
    margin-bottom: var(--space-md);
}

h1 {
    font-size: clamp(32px, 5vw, 44px);
}

h2 {
    font-size: clamp(26px, 4vw, 34px);
}

h3 {
    font-size: clamp(20px, 3vw, 26px);
}

h4 {
    font-size: 20px;
}

p {
    margin-bottom: var(--space-md);
    color: var(--color-text-secondary);
}

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

ul, ol {
    list-style: none;
}

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

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

input, textarea, select {
    font-family: inherit;
    font-size: inherit;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-sm);
    padding: var(--space-md);
    width: 100%;
    background-color: var(--color-bg-primary);
    color: var(--color-text-primary);
    transition: var(--transition-base);
}

input:focus, textarea:focus, select:focus {
    outline: none;
    border-color: var(--color-navy);
    box-shadow: 0 0 0 3px rgba(11, 31, 58, 0.1);
}

/* Utility Classes */
.text-center {
    text-align: center;
}

.text-right {
    text-align: right;
}

.text-left {
    text-align: left;
}

.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border-width: 0;
}

/* Focus Visible for Accessibility */
*:focus-visible {
    outline: 2px solid var(--color-gold);
    outline-offset: 2px;
}

/* Selection */
::selection {
    background-color: var(--color-gold);
    color: var(--color-navy-dark);
}

/* Scrollbar Styling */
::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}

::-webkit-scrollbar-track {
    background: var(--color-bg-secondary);
}

::-webkit-scrollbar-thumb {
    background: var(--color-border);
    border-radius: 5px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--color-navy);
}

/* Smooth Transitions for Dark Mode */
* {
    transition: background-color 0.3s ease, color 0.3s ease, border-color 0.3s ease;
}

