/* ===================================
   MAIN STYLES - GLOBAL & UTILITIES
   =================================== */

/* Import Google Fonts */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&family=Poppins:wght@400;500;600;700;800&display=swap');

/* ===== GLOBAL STYLES ===== */
body.lang-ar {
    text-align: right;
    direction: ltr;
    /* Keep layout LTR as requested */
}

/* Force RTL direction on text containers to fix BIDI issues (punctuation, mixed text) */
body.lang-ar h1,
body.lang-ar h2,
body.lang-ar h3,
body.lang-ar h4,
body.lang-ar h5,
body.lang-ar h6,
body.lang-ar p,
body.lang-ar span:not([class*="icon"]),
body.lang-ar li,
body.lang-ar a,
body.lang-ar label,
body.lang-ar input,
body.lang-ar textarea,
body.lang-ar select {
    direction: rtl;
    unicode-bidi: isolate;
}

/* Fix for specific components that should remain LTR icons/arrows */
body.lang-ar .arrow-down,
body.lang-ar .nav__toggle,
body.lang-ar .flag-icon {
    direction: ltr;
}

/* Move the select dropdown arrow to the left in Arabic mode to avoid overlapping with text */
body.lang-ar .form-group select {
    background-position: left 25px center !important;
}

body {
    font-family: var(--font-primary);
    font-size: var(--font-size-base);
    font-weight: var(--font-weight-normal);
    line-height: var(--line-height-normal);
    color: var(--color-text-primary);
    background-color: var(--color-bg-primary);
    overflow-x: hidden;
}

/* ===== TYPOGRAPHY ===== */
h1,
h2,
h3,
h4,
h5,
h6 {
    font-family: var(--font-heading);
    font-weight: var(--font-weight-bold);
    color: var(--color-text-primary);
    margin-bottom: var(--space-4);
}

h1 {
    font-size: var(--font-size-5xl);
    line-height: var(--line-height-tight);
}

h2 {
    font-size: var(--font-size-4xl);
    line-height: var(--line-height-tight);
}

h3 {
    font-size: var(--font-size-3xl);
    line-height: var(--line-height-tight);
}

h4 {
    font-size: var(--font-size-2xl);
}

h5 {
    font-size: var(--font-size-xl);
}

h6 {
    font-size: var(--font-size-lg);
}

p {
    margin-bottom: var(--space-4);
    color: var(--color-text-secondary);
    line-height: var(--line-height-relaxed);
}

/* ===== LAYOUT ===== */
.container {
    width: 100%;
    max-width: var(--container-max-width);
    margin-left: auto;
    margin-right: auto;
    padding-left: var(--container-padding);
    padding-right: var(--container-padding);
}

.main {
    min-height: 100vh;
}

/* ===== SECTIONS ===== */
section {
    padding: var(--space-20) 0;
}

.section__title {
    text-align: center;
    font-size: var(--font-size-4xl);
    font-weight: var(--font-weight-bold);
    color: var(--color-text-primary);
    margin-bottom: var(--space-12);
    position: relative;
}

.section__title::after {
    content: '';
    position: absolute;
    bottom: -var(--space-4);
    left: 50%;
    transform: translateX(-50%);
    width: 80px;
    height: 4px;
    background: var(--color-primary-gradient);
    border-radius: var(--border-radius-full);
}

/* ===== BUTTONS ===== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: var(--space-4) var(--space-8);
    font-size: var(--font-size-base);
    font-weight: var(--font-weight-semibold);
    line-height: 1;
    border-radius: var(--border-radius-lg);
    transition: all var(--transition-base);
    cursor: pointer;
    text-decoration: none;
    border: none;
    white-space: nowrap;
}

.btn--primary {
    background: var(--color-primary-gradient);
    color: var(--color-white);
    box-shadow: var(--shadow-primary);
}

.btn--primary:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-xl);
}

.btn--primary:active {
    transform: translateY(0);
}

.btn--secondary {
    background: var(--color-secondary);
    color: var(--color-white);
    box-shadow: var(--shadow-secondary);
}

.btn--secondary:hover {
    background: var(--color-secondary-dark);
    transform: translateY(-2px);
    box-shadow: var(--shadow-xl);
}

.btn--outline {
    background: transparent;
    color: var(--color-primary);
    border: 2px solid var(--color-primary);
}

.btn--outline:hover {
    background: var(--color-primary);
    color: var(--color-white);
}

/* ===== CARDS ===== */
.card {
    background: var(--color-white);
    border-radius: var(--border-radius-xl);
    padding: var(--space-6);
    box-shadow: var(--shadow-md);
    transition: all var(--transition-base);
}

.card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-xl);
}

/* ===== ICONS ===== */
.icon {
    width: 48px;
    height: 48px;
    color: var(--color-primary);
}

.icon-small {
    width: 20px;
    height: 20px;
}

/* ===== UTILITIES ===== */
.text-center {
    text-align: center;
}

.text-left {
    text-align: left;
}

.text-right {
    text-align: right;
}

.text-primary {
    color: var(--color-primary);
}

.text-secondary {
    color: var(--color-secondary);
}

.bg-primary {
    background-color: var(--color-primary);
}

.bg-secondary {
    background-color: var(--color-bg-secondary);
}

.bg-tertiary {
    background-color: var(--color-bg-tertiary);
}

/* Spacing utilities */
.mt-1 {
    margin-top: var(--space-1);
}

.mt-2 {
    margin-top: var(--space-2);
}

.mt-3 {
    margin-top: var(--space-3);
}

.mt-4 {
    margin-top: var(--space-4);
}

.mt-6 {
    margin-top: var(--space-6);
}

.mt-8 {
    margin-top: var(--space-8);
}

.mb-1 {
    margin-bottom: var(--space-1);
}

.mb-2 {
    margin-bottom: var(--space-2);
}

.mb-3 {
    margin-bottom: var(--space-3);
}

.mb-4 {
    margin-bottom: var(--space-4);
}

.mb-6 {
    margin-bottom: var(--space-6);
}

.mb-8 {
    margin-bottom: var(--space-8);
}

/* ===== RESPONSIVE TYPOGRAPHY ===== */
@media (max-width: 768px) {
    h1 {
        font-size: var(--font-size-4xl);
    }

    h2 {
        font-size: var(--font-size-3xl);
    }

    h3 {
        font-size: var(--font-size-2xl);
    }

    .section__title {
        font-size: var(--font-size-3xl);
    }
}

@media (max-width: 480px) {
    h1 {
        font-size: var(--font-size-3xl);
    }

    h2 {
        font-size: var(--font-size-2xl);
    }

    h3 {
        font-size: var(--font-size-xl);
    }

    .section__title {
        font-size: var(--font-size-2xl);
    }
}

/* ===== ANIMATIONS ===== */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideInLeft {
    from {
        opacity: 0;
        transform: translateX(-30px);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(30px);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes pulse {

    0%,
    100% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.05);
    }
}

.animate-fade-in {
    animation: fadeIn 0.6s ease-out;
}

.animate-slide-in-left {
    animation: slideInLeft 0.6s ease-out;
}

.animate-slide-in-right {
    animation: slideInRight 0.6s ease-out;
}