/* Bootstrap 5 and Custom Styles for Rafik Fit Pro - No Build Tools Required */

/* Avenir Next World Font Definition */
@font-face {
    font-family: 'Avenir Next World';
    src: url('../fonts/AvenirNextWorld-Demi.eot');
    src: url('../fonts/AvenirNextWorld-Demi.eot?#iefix') format('embedded-opentype'),
         url('../fonts/AvenirNextWorld-Demi.woff2') format('woff2'),
         url('../fonts/AvenirNextWorld-Demi.woff') format('woff'),
         url('../fonts/AvenirNextWorld-Demi.ttf') format('truetype');
    font-weight: 600;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'Avenir Next World';
    src: url('../fonts/AvenirNextWorld-Demi.eot');
    src: url('../fonts/AvenirNextWorld-Demi.eot?#iefix') format('embedded-opentype'),
         url('../fonts/AvenirNextWorld-Demi.woff2') format('woff2'),
         url('../fonts/AvenirNextWorld-Demi.woff') format('woff'),
         url('../fonts/AvenirNextWorld-Demi.ttf') format('truetype');
    font-weight: 400;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'Avenir Next World';
    src: url('../fonts/AvenirNextWorld-Demi.eot');
    src: url('../fonts/AvenirNextWorld-Demi.eot?#iefix') format('embedded-opentype'),
         url('../fonts/AvenirNextWorld-Demi.woff2') format('woff2'),
         url('../fonts/AvenirNextWorld-Demi.woff') format('woff'),
         url('../fonts/AvenirNextWorld-Demi.ttf') format('truetype');
    font-weight: 500;
    font-style: normal;
    font-display: swap;
}

/* Root Variables for Consistent Theming */
:root {
    --primary-color: #dc2626;
    --primary-hover: #b91c1c;
    --secondary-color: #6c757d;
    --secondary-hover: #5a6268;
    --light-bg: #f8f9fa;
    --dark-bg: #212529;
    --border-color: #dee2e6;
    --shadow-sm: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);
    --shadow-md: 0 0.5rem 1rem rgba(0, 0, 0, 0.15);
    --shadow-lg: 0 1rem 3rem rgba(0, 0, 0, 0.175);
    --transition: all 0.2s ease-in-out;
    --font-primary: 'Avenir Next World', -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Helvetica Neue', Arial, sans-serif;
}

/* Base Styles */
html {
    font-family: var(--font-primary);
    scroll-behavior: smooth;
}

html[dir="rtl"] {
    font-family: var(--font-primary), 'Cairo', ui-sans-serif, system-ui, sans-serif;
}

body {
    background-color: var(--light-bg);
    line-height: 1.6;
    padding-top: 0; /* No padding needed - header will be relative initially */
    margin: 0; /* Ensure no default margins */
}

/* RTL Support */
[dir="rtl"] {
    direction: rtl;
    text-align: right;
}

[dir="ltr"] {
    direction: ltr;
    text-align: left;
}

/* Custom Font Classes */
.font-arabic {
    font-family: var(--font-primary), 'Cairo', ui-sans-serif, system-ui, sans-serif;
}

.font-french {
    font-family: var(--font-primary);
}

.font-primary {
    font-family: var(--font-primary);
}

/* Avenir Next World Specific Weights */
.font-weight-normal {
    font-weight: 400;
}

.font-weight-medium {
    font-weight: 500;
}

.font-weight-semibold {
    font-weight: 600;
}

/* Custom Button Styles */
.btn-primary {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
    font-family: var(--font-primary);
    font-weight: 600;
    padding: 0.5rem 1rem;
    border-radius: 0.5rem;
    transition: var(--transition);
    box-shadow: var(--shadow-sm);
    letter-spacing: -0.01em;
}

.btn-primary:hover,
.btn-primary:focus {
    background-color: var(--primary-hover);
    border-color: var(--primary-hover);
    box-shadow: var(--shadow-md);
    transform: translateY(-1px);
}

.btn-secondary {
    background-color: var(--secondary-color);
    border-color: var(--secondary-color);
    color: white;
    font-family: var(--font-primary);
    font-weight: 600;
    padding: 0.5rem 1rem;
    border-radius: 0.5rem;
    transition: var(--transition);
    box-shadow: var(--shadow-sm);
    letter-spacing: -0.01em;
}

.btn-secondary:hover,
.btn-secondary:focus {
    background-color: var(--secondary-hover);
    border-color: var(--secondary-hover);
    box-shadow: var(--shadow-md);
    transform: translateY(-1px);
}

/* Custom Card Styles */
.custom-card {
    background: white;
    border-radius: 0.5rem;
    box-shadow: var(--shadow-md);
    border: 1px solid var(--border-color);
    overflow: hidden;
    transition: var(--transition);
}

.custom-card:hover {
    box-shadow: var(--shadow-lg);
    transform: translateY(-2px);
}

.custom-card-header {
    background-color: var(--light-bg);
    padding: 1.5rem;
    border-bottom: 1px solid var(--border-color);
}

.custom-card-body {
    padding: 1.5rem;
}

/* Language Toggle Styles */
.language-toggle {
    display: flex;
    align-items: center;
    background: white;
    border: 1px solid var(--border-color);
    border-radius: 0.5rem;
    padding: 0.5rem 0.75rem;
    transition: var(--transition);
}

.language-toggle:hover {
    border-color: var(--primary-color);
}

.language-toggle select {
    border: none;
    background: transparent;
    font-size: 0.875rem;
    cursor: pointer;
    outline: none;
}

/* Form Styles */
.form-input {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid var(--border-color);
    border-radius: 0.375rem;
    font-size: 1rem;
    transition: var(--transition);
}

.form-input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 0.2rem rgba(220, 38, 38, 0.25);
}

.form-label {
    display: block;
    font-size: 0.875rem;
    font-weight: 500;
    color: #374151;
    margin-bottom: 0.5rem;
}

/* Workout Plan Cards */
.workout-card {
    background: white;
    border-radius: 0.5rem;
    box-shadow: var(--shadow-lg);
    border: 1px solid var(--border-color);
    overflow: hidden;
    transition: var(--transition);
}

.workout-card:hover {
    box-shadow: var(--shadow-lg);
    transform: scale(1.02);
}

/* Progress Tracking */
.progress-bar-custom {
    width: 100%;
    background-color: #e9ecef;
    border-radius: 0.375rem;
    height: 0.625rem;
    overflow: hidden;
}

.progress-bar-fill {
    background-color: var(--primary-color);
    height: 100%;
    border-radius: 0.375rem;
    transition: width 0.3s ease-in-out;
}

/* Typography Utilities */
.heading-xl {
    font-family: var(--font-primary);
    font-size: 2.25rem;
    font-weight: 600;
    color: #111827;
    line-height: 1.2;
    letter-spacing: -0.025em;
}

.heading-lg {
    font-family: var(--font-primary);
    font-size: 1.875rem;
    font-weight: 600;
    color: #1f2937;
    line-height: 1.25;
    letter-spacing: -0.02em;
}

.heading-md {
    font-family: var(--font-primary);
    font-size: 1.5rem;
    font-weight: 500;
    color: #374151;
    line-height: 1.375;
    letter-spacing: -0.01em;
}

/* Navigation Styles */
.nav-link {
    display: block;
    padding: 0.5rem 1rem;
    color: #374151;
    text-decoration: none;
    font-weight: 500;
    border-radius: 0.375rem;
    transition: var(--transition);
}

.nav-link:hover {
    background-color: #fef2f2;
    color: var(--primary-color);
}

.nav-link.active {
    background-color: #fee2e2;
    color: var(--primary-hover);
    font-weight: 600;
}

/* Hero Section Animations */
.hero-fade-in {
    animation: fadeInUp 1s ease-out;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.animate-fadeInUp {
    animation: fadeInUp 0.6s ease-out;
}

/* Feature Cards */
.feature-card {
    background: white;
    padding: 1.5rem;
    border-radius: 0.5rem;
    box-shadow: var(--shadow-lg);
    border: 1px solid #f3f4f6;
    transition: var(--transition);
}

.feature-card:hover {
    box-shadow: var(--shadow-lg);
    border-color: #fecaca;
}

/* Pricing Cards */
.pricing-card {
    background: white;
    padding: 1.5rem;
    border-radius: 0.5rem;
    box-shadow: var(--shadow-lg);
    border: 2px solid var(--border-color);
    transition: var(--transition);
    position: relative;
}

.pricing-card:hover {
    border-color: var(--primary-color);
}

.pricing-card.featured {
    border-color: var(--primary-color);
    position: relative;
}

.pricing-card.featured::before {
    content: '';
    position: absolute;
    top: -2px;
    left: -2px;
    right: -2px;
    bottom: -2px;
    background: linear-gradient(45deg, var(--primary-color), var(--primary-hover));
    border-radius: 0.5rem;
    z-index: -1;
}

/* Loading Spinner */
.spinner {
    display: inline-block;
    width: 1rem;
    height: 1rem;
    border: 2px solid #f3f4f6;
    border-top: 2px solid var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Toast Notifications */
.toast {
    position: fixed;
    top: 1rem;
    right: 1rem;
    background: white;
    border: 1px solid var(--border-color);
    border-radius: 0.5rem;
    box-shadow: var(--shadow-lg);
    padding: 1rem;
    max-width: 24rem;
    z-index: 1050;
    transform: translateX(100%);
    transition: transform 0.3s ease-in-out;
}

.toast.show {
    transform: translateX(0);
}

.toast.success {
    border-color: #10b981;
    color: #065f46;
}

.toast.error {
    border-color: #ef4444;
    color: #991b1b;
}

/* Mobile Responsive Utilities */
@media (max-width: 768px) {
    body {
        padding-top: 0; /* Remove extra padding to eliminate gap */
    }

    /* Apple Mobile Menu Improvements */
    .apple-mobile-menu {
        top: 70px; /* Match updated header height */
        padding: 0;
        max-height: calc(100vh - 140px); /* Account for updated header height */
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
    }

    .apple-mobile-link {
        padding: 16px 20px;
        font-size: 1rem;
        min-height: 52px;
    }

    .apple-mobile-link:hover {
        padding-left: 32px;
    }

    .apple-mobile-menu .apple-btn {
        margin: 6px 12px;
        padding: 12px 20px;
        min-height: 48px;
        font-size: 0.95rem;
    }

    .apple-mobile-menu .btn-link {
        padding: 14px 20px;
        margin: 6px 12px;
        font-size: 0.95rem;
        min-height: 44px;
    }

    .mobile-menu {
        position: fixed;
        inset: 0;
        background-color: rgba(0, 0, 0, 0.5);
        z-index: 1040;
    }

    .mobile-menu-content {
        background: white;
        width: 16rem;
        height: 100%;
        box-shadow: var(--shadow-lg);
    }

    .heading-xl {
        font-size: 1.875rem;
    }

    .heading-lg {
        font-size: 1.5rem;
    }
}

/* Extra Small Mobile Devices */
@media (max-width: 480px) {
    body {
        padding-top: 0; /* Remove extra padding to eliminate gap */
    }

    .apple-mobile-menu {
        top: 70px; /* Match updated header height */
        border-radius: 24px 24px 0 0;
        max-height: calc(100vh - 140px); /* Account for updated header height */
    }

    .apple-mobile-link {
        padding: 18px 20px;
        font-size: 0.95rem;
        min-height: 52px;
    }

    .apple-mobile-link:hover {
        padding-left: 28px;
    }

    .apple-mobile-menu .apple-btn {
        margin: 4px 8px;
        padding: 10px 16px;
        min-height: 44px;
        font-size: 0.9rem;
    }

    .apple-mobile-menu .btn-link {
        padding: 12px 16px;
        margin: 4px 8px;
        font-size: 0.9rem;
        min-height: 40px;
    }
}

/* RTL Specific Utilities */
[dir="rtl"] .space-x-reverse > :not([hidden]) ~ :not([hidden]) {
    margin-right: 0.5rem;
    margin-left: 0;
}

[dir="rtl"] .space-x-2 > :not([hidden]) ~ :not([hidden]) {
    margin-right: 0.5rem;
    margin-left: 0;
}

[dir="rtl"] .space-x-4 > :not([hidden]) ~ :not([hidden]) {
    margin-right: 1rem;
    margin-left: 0;
}

[dir="rtl"] .space-x-8 > :not([hidden]) ~ :not([hidden]) {
    margin-right: 2rem;
    margin-left: 0;
}

/* RTL Support for Mobile Menu */
[dir="rtl"] .apple-mobile-link:hover {
    transform: translateX(-12px);
    padding-right: 36px;
    padding-left: 24px;
}

[dir="rtl"] .apple-mobile-link:hover {
    padding-right: 36px;
    padding-left: 24px;
}

[dir="rtl"] .apple-mobile-link.active:hover {
    transform: translateX(-8px);
    padding-right: 32px;
    padding-left: 24px;
}

[dir="rtl"] .apple-mobile-menu .btn-link:hover {
    transform: translateX(-8px);
}

[dir="rtl"] .apple-mobile-toggle:hover {
    transform: translateY(-1px) rotate(0deg);
}

/* RTL Mobile Menu Animations */
[dir="rtl"] @keyframes slideDown {
    from {
        transform: translateY(-100%);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

/* Apple-Inspired Header Styles */
.apple-header {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(25px);
    -webkit-backdrop-filter: blur(25px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.03), 0 1px 2px rgba(0, 0, 0, 0.05);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative; /* Changed from fixed to relative */
    width: 100%;
    z-index: 1030;
    padding: 0.75rem 0; /* Increased vertical padding for better spacing */
    min-height: 70px; /* Increased minimum height */
    display: flex;
    align-items: center;
    /* Add sticky behavior when scrolled */
    top: 0;
}

.apple-header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent 0%, rgba(255, 255, 255, 0.4) 20%, rgba(255, 255, 255, 0.8) 50%, rgba(255, 255, 255, 0.4) 80%, transparent 100%);
    pointer-events: none;
}

/* Ensure header container takes full height */
.apple-header .container-xxl {
    height: 100%;
    display: flex;
    align-items: center;
}

/* Header placeholder for sticky behavior */
.header-placeholder {
    height: 70px; /* Same as updated header min-height */
    display: none;
}

.apple-header.scrolled ~ .header-placeholder {
    display: block;
}

.apple-header.scrolled {
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(35px);
    -webkit-backdrop-filter: blur(35px);
    box-shadow: 0 6px 25px rgba(0, 0, 0, 0.1), 0 3px 12px rgba(0, 0, 0, 0.06);
    min-height: 70px; /* Ensure consistent height when scrolled */
    position: sticky; /* Make it sticky when scrolled */
    top: 0;
}

/* Apple-Inspired Logo */
.apple-logo {
    background: linear-gradient(135deg, rgba(220, 38, 38, 0.9) 0%, rgba(185, 28, 28, 0.9) 100%);
    box-shadow: 0 4px 20px rgba(220, 38, 38, 0.25);
    border-radius: 16px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.apple-logo::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: linear-gradient(45deg, transparent 0%, rgba(255, 255, 255, 0.3) 50%, transparent 100%);
    transform: rotate(45deg);
    transition: all 0.6s ease;
    opacity: 0;
}

.apple-logo:hover::before {
    opacity: 1;
    animation: shimmer 1.5s ease-in-out;
}

.apple-logo:hover {
    transform: translateY(-2px) scale(1.05);
    box-shadow: 0 8px 30px rgba(220, 38, 38, 0.4);
}

/* Apple-Inspired Navigation */
.apple-nav {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 25px;
    padding: 10px 20px;
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    z-index: 1031;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
}

.apple-nav:hover {
    background: rgba(255, 255, 255, 0.25);
    border-color: rgba(255, 255, 255, 0.4);
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
}

.apple-nav-link {
    color: #1f2937;
    text-decoration: none;
    font-weight: 600;
    font-size: 0.95rem;
    padding: 10px 18px;
    border-radius: 22px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
    letter-spacing: -0.01em;
    margin: 0 2px;
}

.apple-nav-link::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(220, 38, 38, 0.15), transparent);
    transition: left 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.apple-nav-link:hover::before {
    left: 100%;
}

.apple-nav-link:hover {
    background: rgba(220, 38, 38, 0.12);
    color: var(--primary-color);
    transform: translateY(-2px) scale(1.02);
    box-shadow: 0 6px 20px rgba(220, 38, 38, 0.15);
}

.apple-nav-link.active {
    background: linear-gradient(135deg, var(--primary-color) 0%, #b91c1c 100%);
    color: white;
    box-shadow: 0 6px 20px rgba(220, 38, 38, 0.3);
    transform: translateY(-1px);
}

/* Apple-Inspired Buttons */
.apple-btn {
    border-radius: 20px;
    font-family: var(--font-primary);
    font-weight: 600;
    padding: 10px 24px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    letter-spacing: -0.01em;
}

.apple-btn::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    transition: all 0.4s ease;
}

.apple-btn:hover::before {
    width: 120%;
    height: 120%;
}

.apple-btn-primary {
    background: linear-gradient(135deg, var(--primary-color) 0%, #b91c1c 100%);
    color: white;
    border-color: var(--primary-color);
    box-shadow: 0 4px 15px rgba(220, 38, 38, 0.3);
}

.apple-btn-primary:hover {
    background: linear-gradient(135deg, #b91c1c 0%, var(--primary-color) 100%);
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(220, 38, 38, 0.4);
}

.apple-btn-secondary {
    background: rgba(255, 255, 255, 0.7);
    color: #374151;
    border-color: rgba(255, 255, 255, 0.3);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
}

.apple-btn-secondary:hover {
    background: rgba(255, 255, 255, 1);
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
}

/* Apple-Inspired Language Toggle */
.apple-language-toggle {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 20px;
    padding: 8px 16px;
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.apple-language-toggle:hover {
    background: rgba(255, 255, 255, 0.2);
    border-color: rgba(255, 255, 255, 0.3);
    transform: translateY(-1px);
}

.apple-language-toggle select {
    background: transparent;
    border: none;
    color: #374151;
    font-weight: 500;
    cursor: pointer;
    outline: none;
    padding: 0;
}

/* Apple-Inspired Mobile Menu */
.apple-mobile-menu {
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(35px);
    -webkit-backdrop-filter: blur(35px);
    border-top: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 28px 28px 0 0;
    box-shadow: 0 -12px 40px rgba(0, 0, 0, 0.15);
    padding: 0;
    margin: 0;
    position: fixed;
    top: 70px; /* Match updated header height */
    left: 0;
    right: 0;
    z-index: 1040; /* Higher z-index to stay above sticky header */
    animation: slideDown 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    max-height: calc(100vh - 130px); /* Account for updated header height */
}

/* Mobile Menu Animation */
@keyframes slideDown {
    from {
        transform: translateY(-100%);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.apple-mobile-link {
    color: #374151;
    text-decoration: none;
    padding: 20px 26px;
    border-radius: 0;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    font-weight: 600;
    font-size: 1.1rem;
    display: block;
    border-bottom: 1px solid rgba(0, 0, 0, 0.08);
    position: relative;
    margin: 0;
    min-height: 60px;
    display: flex;
    align-items: center;
    letter-spacing: -0.01em;
}

.apple-mobile-link:hover {
    background: linear-gradient(135deg, rgba(220, 38, 38, 0.08) 0%, rgba(220, 38, 38, 0.05) 100%);
    color: var(--primary-color);
    transform: translateX(16px) scale(1.01);
    padding-left: 42px;
    border-bottom: 1px solid rgba(220, 38, 38, 0.15);
    box-shadow: 0 4px 15px rgba(220, 38, 38, 0.1);
}

.apple-mobile-link.active {
    background: linear-gradient(135deg, var(--primary-color) 0%, #b91c1c 100%);
    color: white;
    box-shadow: 0 6px 25px rgba(220, 38, 38, 0.3);
    border-bottom: 1px solid rgba(220, 38, 38, 0.4);
    transform: translateX(4px);
}

.apple-mobile-link.active:hover {
    background: linear-gradient(135deg, #b91c1c 0%, var(--primary-color) 100%);
    color: white;
    transform: translateX(12px) scale(1.01);
    padding-left: 38px;
}

/* Mobile Menu Button Section */
.apple-mobile-menu .pt-3 {
    border-top: 2px solid rgba(220, 38, 38, 0.2);
    margin: 0;
    padding-top: 16px !important;
}

/* Mobile Menu Buttons */
.apple-mobile-menu .apple-btn {
    margin: 10px 18px;
    border-radius: 18px;
    font-size: 1rem;
    padding: 16px 26px;
    min-height: 56px;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    font-weight: 600;
}

/* Mobile Menu Logout */
.apple-mobile-menu .btn-link {
    color: #6b7280;
    font-size: 1rem;
    padding: 16px 24px;
    margin: 8px 16px;
    border-radius: 12px;
    transition: all 0.3s ease;
    min-height: 48px;
    display: flex;
    align-items: center;
}

.apple-mobile-menu .btn-link:hover {
    background: rgba(107, 114, 128, 0.1);
    color: #dc2626;
    transform: translateX(8px);
}

/* Apple-Inspired Admin Header */
.apple-admin-header {
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(25px);
    -webkit-backdrop-filter: blur(25px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.15);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.03);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.apple-admin-toggle {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 16px;
    padding: 12px 16px;
    color: #374151;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
}

.apple-admin-toggle:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: translateY(-1px);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

/* Apple-Inspired Mobile Menu Button */
.apple-mobile-toggle {
    background: rgba(255, 255, 255, 0.15);
    border: 2px solid rgba(255, 255, 255, 0.25);
    border-radius: 18px;
    padding: 14px 18px;
    color: #374151;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    min-width: 52px;
    min-height: 52px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
    order: 999; /* Ensure it comes last in flex order */
}

/* LTR languages (English, French): Menu button on the left */
[dir="ltr"] .apple-mobile-toggle {
    margin-right: auto; /* Force to the left for LTR */
}

/* RTL languages (Arabic): Menu button on the right */
[dir="rtl"] .apple-mobile-toggle {
    margin-left: auto; /* Force to the right for RTL */
}

.apple-mobile-toggle:hover {
    background: rgba(255, 255, 255, 0.3);
    border-color: rgba(255, 255, 255, 0.4);
    transform: translateY(-2px) scale(1.05);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.12);
    color: #374151;
}

.apple-mobile-toggle.active {
    background: linear-gradient(135deg, var(--primary-color) 0%, #b91c1c 100%);
    border-color: var(--primary-color);
    color: white;
    transform: rotate(180deg) scale(1.05);
    box-shadow: 0 8px 25px rgba(220, 38, 38, 0.3);
}

.apple-mobile-toggle i {
    font-size: 1.3rem;
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Apple-Inspired Dropdown */
.apple-dropdown {
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(25px);
    -webkit-backdrop-filter: blur(25px);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 16px;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.08);
    overflow: hidden;
}

.apple-dropdown-item {
    padding: 12px 20px;
    color: #374151;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}

.apple-dropdown-item:hover {
    background: rgba(220, 38, 38, 0.1);
    color: var(--primary-color);
    transform: translateX(4px);
}

.apple-dropdown-item:last-child {
    border-bottom: none;
}

/* Header Specific Styles */
.header-shadow {
    box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06);
}

/* Shimmer Animation */
@keyframes shimmer {
    0% {
        transform: translateX(-100%) translateY(-100%) rotate(45deg);
    }
    100% {
        transform: translateX(100%) translateY(100%) rotate(45deg);
    }
}

/* Footer Styles */
.footer-dark {
    background-color: #1a202c;
    color: white;
}

/* Utility Classes for Bootstrap 5 Compatibility */
.bg-gray-50 {
    background-color: var(--light-bg) !important;
}

/* Ensure adequate spacing for main content */
main {
    min-height: calc(100vh - 200px); /* Ensure main content has minimum height */
    margin-top: 0; /* No top margin - placeholder handles spacing */
}

/* Hero sections and main content areas */
.container-fluid.py-4,
.container-xxl.py-5,
section.py-5 {
    position: relative;
    z-index: 1;
}

/* Additional spacing for specific sections */
.hero-section,
.welcome-section,
.dashboard-content {
    padding-top: 2rem;
}

/* Ensure hero section has enough top spacing */
.hero-section {
    padding-top: 3rem !important;
}

/* Additional spacing for pages without hero sections */
.dashboard-container,
.content-container {
    padding-top: 1.5rem;
}

/* Specific spacing for dashboard and other main content areas */
.container-fluid.py-4 {
    padding-top: 1rem !important;
}

/* Ensure first elements have adequate top spacing */
.container-fluid.py-4 > .row:first-child,
.container-xxl.py-5 > .row:first-child,
section.py-5 > .row:first-child {
    margin-top: 1rem;
}

/* Additional safety margin for critical elements */
.welcome-section,
.stats-section,
.hero-section {
    margin-top: 0.5rem !important;
}

/* Ensure sticky header works properly on all devices */
.apple-header.scrolled {
    position: sticky;
    top: 0;
    z-index: 1030;
    width: 100%;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08), 0 2px 8px rgba(0, 0, 0, 0.04);
}

/* Mobile responsive adjustments for sticky header */
@media (max-width: 768px) {
    .apple-header.scrolled {
        position: sticky;
        top: 0;
        z-index: 1040; /* Higher z-index for mobile */
    }
}

/*
 * NEW HEADER BEHAVIOR:
 * - Header starts as position: relative (normal flow)
 * - When scrolled down > 10px, it becomes sticky
 * - Placeholder div maintains space when header is sticky
 * - Mobile menu stays fixed at top when open
 * - All spacing is handled by CSS, no padding-top needed on body
 */

.bg-gray-900 {
    background-color: var(--dark-bg) !important;
}

.text-red-600 {
    color: var(--primary-color) !important;
}

.hover\:text-red-600:hover {
    color: var(--primary-color) !important;
}

.border-gray-200 {
    border-color: var(--border-color) !important;
}

/* Custom spacing utilities */
.space-y-1 > :not([hidden]) ~ :not([hidden]) {
    margin-top: 0.25rem;
}

.space-y-2 > :not([hidden]) ~ :not([hidden]) {
    margin-top: 0.5rem;
}

.space-x-2 > :not([hidden]) ~ :not([hidden]) {
    margin-left: 0.5rem;
}

.space-x-4 > :not([hidden]) ~ :not([hidden]) {
    margin-left: 1rem;
}

.space-x-8 > :not([hidden]) ~ :not([hidden]) {
    margin-left: 2rem;
}

/* Order utilities for navigation */
.order-1 {
    order: 1;
}

.order-2 {
    order: 2;
}

.order-3 {
    order: 3;
}

.order-4 {
    order: 4;
}

/* Enhanced Dashboard Styles */
.stats-card {
    border-radius: 15px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    border: none;
    overflow: hidden;
    position: relative;
}

.stats-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 30px rgba(0,0,0,0.15);
}

.stats-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(255,255,255,0.1) 0%, rgba(255,255,255,0.05) 100%);
    pointer-events: none;
}

.stats-icon {
    opacity: 0.8;
    transition: opacity 0.3s ease;
}

.stats-card:hover .stats-icon {
    opacity: 1;
}

/* Gradient Card Backgrounds */
.card-gradient-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.card-gradient-success {
    background: linear-gradient(135deg, #11998e 0%, #38ef7d 100%);
}

.card-gradient-warning {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
}

.card-gradient-info {
    background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
}

.card-gradient-danger {
    background: linear-gradient(135deg, #ff6b6b 0%, #ee5a24 100%);
}

.card-gradient-secondary {
    background: linear-gradient(135deg, #a8edea 0%, #fed6e3 100%);
}

/* Welcome Card */
.welcome-card {
    background: linear-gradient(135deg, var(--primary-color) 0%, #b91c1c 100%);
    border-radius: 15px;
    box-shadow: 0 8px 30px rgba(220, 38, 38, 0.3);
    border: none;
    position: relative;
    overflow: hidden;
}

.welcome-card::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255,255,255,0.1) 0%, transparent 70%);
    pointer-events: none;
}

/* Dashboard Content Cards */
.dashboard-card {
    background: white;
    border-radius: 15px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.08);
    border: 1px solid rgba(0,0,0,0.05);
    transition: all 0.3s ease;
}

.dashboard-card:hover {
    box-shadow: 0 8px 30px rgba(0,0,0,0.12);
    transform: translateY(-2px);
}

.dashboard-card .card-header {
    background: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 100%);
    border-bottom: 1px solid rgba(0,0,0,0.05);
    border-radius: 15px 15px 0 0 !important;
    padding: 1.5rem;
}

.dashboard-card .card-body {
    padding: 1.5rem;
}

/* Quick Actions */
.quick-action-btn {
    background: white;
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    padding: 1rem;
    text-decoration: none;
    color: #374151;
    font-weight: 600;
    transition: all 0.3s ease;
    display: block;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.quick-action-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.4), transparent);
    transition: left 0.5s;
}

.quick-action-btn:hover::before {
    left: 100%;
}

.quick-action-btn:hover {
    border-color: var(--primary-color);
    color: var(--primary-color);
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(220, 38, 38, 0.2);
}

/* RTL Specific Styles */
[dir="rtl"] .stats-card .d-flex {
    flex-direction: row-reverse;
}

[dir="rtl"] .stats-icon {
    text-align: left;
}

[dir="rtl"] .welcome-card::before {
    right: auto;
    left: -50%;
}

/* Arabic Font Enhancement */
.arabic-text {
    font-family: 'Cairo', 'Tajawal', sans-serif;
    font-weight: 500;
}

/* Animation Classes */
.fade-in-up {
    animation: fadeInUp 0.6s ease-out;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.stagger-animation {
    animation-delay: calc(var(--stagger-delay, 0) * 0.1s);
}

/* Responsive Adjustments */
@media (max-width: 768px) {
    .stats-card {
        margin-bottom: 1rem;
    }
    
    .welcome-card {
        text-align: center;
    }
    
    .quick-action-btn {
        margin-bottom: 0.5rem;
    }
}

/* Loading States */
.loading-shimmer {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
}

@keyframes shimmer {
    0% {
        background-position: -200% 0;
    }
    100% {
        background-position: 200% 0;
    }
}

/* Transformations Section Styles */
.transformation-card {
    background: white;
    border-radius: 15px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.08);
    border: 1px solid rgba(0,0,0,0.05);
    transition: all 0.3s ease;
    overflow: hidden;
    position: relative;
}

.transformation-card:hover {
    box-shadow: 0 8px 30px rgba(0,0,0,0.15);
    transform: translateY(-5px);
}

.transformation-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(255,255,255,0.1) 0%, rgba(255,255,255,0.05) 100%);
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.transformation-card:hover::before {
    opacity: 1;
}

.transformation-card img {
    transition: transform 0.3s ease;
}

.transformation-card:hover img {
    transform: scale(1.05);
}

.transformation-card .position-absolute {
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

/* Transformation Labels */
.transformation-label {
    font-size: 0.875rem;
    font-weight: 600;
    text-shadow: 0 1px 2px rgba(0,0,0,0.5);
    letter-spacing: 0.025em;
}

.transformation-label.before {
    background: linear-gradient(135deg, rgba(0,0,0,0.8) 0%, rgba(0,0,0,0.6) 100%);
}

.transformation-label.after {
    background: linear-gradient(135deg, rgba(34,197,94,0.8) 0%, rgba(22,163,74,0.6) 100%);
}

/* Responsive Transformations */
@media (max-width: 768px) {
    .transformation-card {
        margin-bottom: 1rem;
    }
    
    .transformation-card img {
        height: 200px !important;
    }
    
    .transformation-label {
        font-size: 0.75rem;
        padding: 0.5rem !important;
    }
}

@media (max-width: 576px) {
    .transformation-card img {
        height: 180px !important;
    }
    
    .transformation-card .row {
        gap: 0.5rem !important;
    }
}

/* Animation for transformation cards */
.transformation-card {
    animation: slideInUp 0.6s ease-out;
    animation-fill-mode: both;
}

.transformation-card:nth-child(1) {
    animation-delay: 0.1s;
}

.transformation-card:nth-child(2) {
    animation-delay: 0.2s;
}

.transformation-card:nth-child(3) {
    animation-delay: 0.3s;
}

@keyframes slideInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* RTL Support for Transformations */
[dir="rtl"] .transformation-card .row {
    direction: rtl;
}

[dir="rtl"] .transformation-card .col-6:first-child {
    order: 2;
}

[dir="rtl"] .transformation-card .col-6:last-child {
    order: 1;
}

/* Transformations Carousel Styles */
#transformationsCarousel {
    padding: 2rem 0;
}

#transformationsCarousel .carousel-inner {
    padding: 0 1rem;
}

#transformationsCarousel .carousel-item {
    padding: 0 0.5rem;
}

/* Ensure full width usage on mobile */
@media (max-width: 768px) {
    #transformationsCarousel .carousel-inner {
        padding: 0 0.5rem;
    }
    
    #transformationsCarousel .carousel-item {
        padding: 0 0.25rem;
    }
    
    #transformationsCarousel .col-lg-8 {
        padding-left: 0 !important;
        padding-right: 0 !important;
    }
}

#transformationsCarousel .carousel-indicators {
    bottom: -3rem;
    margin-bottom: 0;
}

#transformationsCarousel .carousel-indicators button {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background-color: #dc2626;
    border: 2px solid #dc2626;
    opacity: 0.5;
    transition: all 0.3s ease;
}

#transformationsCarousel .carousel-indicators button.active {
    opacity: 1;
    transform: scale(1.2);
}

#transformationsCarousel .carousel-control-prev,
#transformationsCarousel .carousel-control-next {
    width: 50px;
    height: 50px;
    background-color: rgba(220, 38, 38, 0.8);
    border-radius: 50%;
    top: 50%;
    transform: translateY(-50%);
    opacity: 0.8;
    transition: all 0.3s ease;
}

#transformationsCarousel .carousel-control-prev:hover,
#transformationsCarousel .carousel-control-next:hover {
    opacity: 1;
    background-color: rgba(220, 38, 38, 1);
    transform: translateY(-50%) scale(1.1);
}

#transformationsCarousel .carousel-control-prev {
    left: 20px;
}

#transformationsCarousel .carousel-control-next {
    right: 20px;
}

#transformationsCarousel .carousel-control-prev-icon,
#transformationsCarousel .carousel-control-next-icon {
    width: 20px;
    height: 20px;
}

/* Carousel Animation */
#transformationsCarousel .carousel-item {
    transition: transform 0.6s ease-in-out;
}

/* Mobile Responsive for Carousel */
@media (max-width: 768px) {
    #transformationsCarousel .carousel-control-prev,
    #transformationsCarousel .carousel-control-next {
        width: 40px;
        height: 40px;
    }
    
    #transformationsCarousel .carousel-control-prev {
        left: 10px;
    }
    
    #transformationsCarousel .carousel-control-next {
        right: 10px;
    }
    
    #transformationsCarousel .carousel-control-prev-icon,
    #transformationsCarousel .carousel-control-next-icon {
        width: 16px;
        height: 16px;
    }
    
    #transformationsCarousel .transformation-card img {
        height: 400px !important;
    }
    
    /* Ensure images stay side by side on tablets */
    #transformationsCarousel .transformation-card .row {
        display: flex !important;
        flex-wrap: nowrap !important;
    }
    
    #transformationsCarousel .transformation-card .col-6 {
        flex: 0 0 50% !important;
        max-width: 50% !important;
    }
    
    /* Reduce padding on tablets */
    #transformationsCarousel .transformation-card {
        padding: 0.75rem !important;
    }
}

@media (max-width: 576px) {
    #transformationsCarousel .transformation-card img {
        height: 300px !important;
    }
    
    #transformationsCarousel .carousel-indicators {
        bottom: -2rem;
    }
    
    /* Force images to stay in same row on mobile */
    #transformationsCarousel .transformation-card .row {
        display: flex !important;
        flex-wrap: nowrap !important;
    }
    
    #transformationsCarousel .transformation-card .col-6 {
        flex: 0 0 50% !important;
        max-width: 50% !important;
        padding-left: 0.25rem !important;
        padding-right: 0.25rem !important;
    }
    
    /* Reduce padding on mobile */
    #transformationsCarousel .transformation-card {
        padding: 0.5rem !important;
    }
    
    /* Adjust carousel container for mobile */
    #transformationsCarousel .col-lg-8 {
        padding-left: 0.5rem !important;
        padding-right: 0.5rem !important;
    }
    
    /* Remove any margin that might cause gaps */
    #transformationsCarousel .row {
        margin-left: 0 !important;
        margin-right: 0 !important;
    }
    
#transformationsCarousel .transformation-card img {
    width: 100% !important;
    object-fit: cover !important;
    image-rendering: -webkit-optimize-contrast !important;
    image-rendering: crisp-edges !important;
    image-rendering: optimize-quality !important;
}
}

/* Image Lightbox Styles */
.transformation-image {
    cursor: pointer !important;
    transition: all 0.3s ease !important;
}

.transformation-image:hover {
    transform: scale(1.02) !important;
    box-shadow: 0 8px 25px rgba(0,0,0,0.3) !important;
}

/* Modal Styles */
#imageModal .modal-content {
    border-radius: 15px;
    overflow: hidden;
}

#imageModal .modal-body {
    background: #000;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 60vh;
    padding: 1rem;
}

#imageModal #modalImage {
    border-radius: 10px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.5);
    max-width: 100%;
    height: auto;
    image-rendering: -webkit-optimize-contrast !important;
    image-rendering: crisp-edges !important;
    image-rendering: optimize-quality !important;
}

/* Ensure modal image is visible */
#imageModal #modalImage[src] {
    display: block !important;
}

#imageModal #modalImage:not([src]) {
    display: none !important;
}

/* Mobile Modal Adjustments */
@media (max-width: 768px) {
    #imageModal .modal-dialog {
        margin: 0.5rem;
    }
    
    #imageModal #modalImage {
        max-height: 70vh !important;
    }
}

@media (max-width: 576px) {
    #imageModal .modal-dialog {
        margin: 0.25rem;
    }
    
    #imageModal #modalImage {
        max-height: 60vh !important;
    }
}