/* --- Variables & Configuration --- */
:root {
    /* Palette Bleu et Vert */
    --primary: #0A7CFF;
    --secondary: #00B894;
    --dark: #1a1a2e;
    --light-text: #636E72;
    --bg-light: #F9FBFD;
    
    /* Gradients */
    --gradient-primary: linear-gradient(135deg, #0A7CFF 0%, #00C6FF 100%);
    --gradient-secondary: linear-gradient(135deg, #00B894 0%, #55EFC4 100%);
    --gradient-mixed: linear-gradient(135deg, #00B894 0%, #0A7CFF 100%);
    
    /* Contact Colors */
    --whatsapp-color: #25D366;
    --sms-color: #34495e;
    --call-color: #0A7CFF;

    /* Fonts */
    --font-heading: 'Poppins', sans-serif;
    --font-body: 'Inter', sans-serif;
}

body {
    font-family: var(--font-body);
    color: var(--dark);
    background-color: var(--bg-light);
    overflow-x: hidden;
}

h1, h2, h3, h4, h5, h6, .navbar-brand, .btn {
    font-family: var(--font-heading);
}

/* --- Utilities --- */
.text-gradient {
    background: var(--gradient-mixed);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    font-weight: 700;
}

.text-primary { color: var(--primary) !important; }
.bg-light-gradient { background: linear-gradient(180deg, #F9FBFD 0%, #E6F0FF 100%); }

/* --- Navbar --- */
.navbar {
    padding: 15px 0;
    transition: all 0.4s ease;
    background: transparent;
}

.navbar.scrolled {
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(15px);
    box-shadow: 0 10px 30px rgba(0,0,0,0.05);
    padding: 10px 0;
}

.brand-icon {
    display: inline-flex;
    justify-content: center;
    align-items: center;
    width: 35px;
    height: 35px;
    background: var(--gradient-primary);
    color: white;
    border-radius: 10px;
    font-size: 0.9rem;
}

.nav-link {
    font-weight: 500;
    color: var(--dark);
    margin: 0 10px;
    position: relative;
}

.nav-link:hover, .nav-link.active {
    color: var(--primary);
}

/* Language Dropdown Styles */
.dropdown-menu {
    border-radius: 15px;
    padding: 10px;
}

.dropdown-item {
    border-radius: 8px;
    padding: 8px 15px;
    font-weight: 500;
    transition: all 0.2s;
}

.dropdown-item:hover, .dropdown-item:focus {
    background-color: rgba(10, 124, 255, 0.1);
    color: var(--primary);
}

.animate-slide-down {
    animation: slideDown 0.3s ease forwards;
    transform-origin: top center;
}

@keyframes slideDown {
    0% { opacity: 0; transform: translateY(-10px); }
    100% { opacity: 1; transform: translateY(0); }
}

/* --- Buttons --- */
.btn-gradient {
    background: var(--gradient-mixed);
    color: white;
    border: none;
    box-shadow: 0 10px 20px rgba(10, 124, 255, 0.2);
    transition: all 0.3s ease;
}

.btn-gradient:hover {
    transform: translateY(-3px);
    box-shadow: 0 15px 30px rgba(10, 124, 255, 0.3);
    color: white;
}

.btn-white {
    background: white;
    color: var(--dark);
    border: 1px solid rgba(0,0,0,0.05);
    box-shadow: 0 5px 15px rgba(0,0,0,0.05);
    transition: all 0.3s;
}

.btn-white:hover {
    transform: translateY(-3px);
    background: #f8f9fa;
}

/* Contact Modal Buttons */
.btn-whatsapp {
    background-color: var(--whatsapp-color);
    color: white;
    font-weight: 600;
    border: none;
    box-shadow: 0 5px 15px rgba(37, 211, 102, 0.3);
    transition: all 0.3s;
}
.btn-whatsapp:hover { transform: translateY(-3px); color: white; background-color: #1ebc57; }

.btn-sms {
    background-color: var(--sms-color);
    color: white;
    font-weight: 600;
    border: none;
    box-shadow: 0 5px 15px rgba(52, 73, 94, 0.3);
    transition: all 0.3s;
}
.btn-sms:hover { transform: translateY(-3px); color: white; background-color: #2c3e50; }

.btn-call {
    background-color: white;
    color: var(--call-color);
    border: 2px solid var(--call-color);
    font-weight: 600;
    transition: all 0.3s;
}
.btn-call:hover { transform: translateY(-3px); background-color: var(--call-color); color: white; }

/* --- Hero Section --- */
.hero-section {
    padding-top: 120px;
    padding-bottom: 80px;
    min-height: 100vh;
    overflow: hidden;
}

.icon-box-sm {
    width: 25px;           
    height: 25px;          
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;       
    flex-shrink: 0;        
}

/* Organic Blobs */
.blob {
    position: absolute;
    border-radius: 40% 60% 70% 30% / 40% 50% 60% 50%;
    filter: blur(60px);
    z-index: 0;
    opacity: 0.15;
    animation: blob-bounce 10s infinite alternate;
}

.blob-1 {
    top: -10%;
    right: -10%;
    width: 600px;
    height: 600px;
    background: var(--primary);
}

.blob-2 {
    bottom: 0%;
    left: -10%;
    width: 500px;
    height: 500px;
    background: var(--secondary);
    animation-delay: -5s;
}

@keyframes blob-bounce {
    0% { transform: translate(0, 0) rotate(0deg); }
    100% { transform: translate(-30px, 40px) rotate(20deg); }
}

.hero-img {
    border-radius: 40px 10px 40px 10px;
    box-shadow: 20px 20px 0px rgba(10, 124, 255, 0.1);
    width: 100%;
    object-fit: cover;
}

.hero-image-wrapper {
    position: relative;
    padding: 20px;
}

/* Floating Cards */
.floating-card {
    position: absolute;
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(10px);
    border-radius: 15px;
    box-shadow: 0 15px 35px rgba(0,0,0,0.1);
    border: 1px solid rgba(255,255,255,0.5);
    animation: float 4s ease-in-out infinite;
    z-index: 3;
    max-width: 240px;
}

.card-top { top: 40px; left: -20px; }
.card-bottom { bottom: 40px; right: -20px; animation-delay: 2s; }

@keyframes float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-15px); }
}

.bg-soft-primary { background-color: rgba(10, 124, 255, 0.1); }

/* --- Services --- */
.section-padding { padding: 100px 0; }

.glass-card {
    background: white;
    border-radius: 20px;
    border: 1px solid rgba(0,0,0,0.03);
    box-shadow: 0 10px 30px rgba(0,0,0,0.05);
    transition: all 0.4s cubic-bezier(0.165, 0.84, 0.44, 1);
    position: relative;
    overflow: hidden;
}

.glass-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 20px 40px rgba(10, 124, 255, 0.15);
}

.icon-box {
    width: 70px;
    height: 70px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 18px;
    font-size: 1.8rem;
    color: white;
    transition: transform 0.3s;
}

.gradient-blue { background: var(--gradient-primary); box-shadow: 0 8px 20px rgba(10, 124, 255, 0.3); }
.gradient-green { background: var(--gradient-secondary); box-shadow: 0 8px 20px rgba(0, 184, 148, 0.3); }

.glass-card:hover .icon-box { transform: scale(1.1) rotate(5deg); }

.btn-link-custom {
    text-decoration: none;
    font-weight: 600;
    color: var(--primary);
    display: inline-flex;
    align-items: center;
}
.btn-link-custom.color-secondary { color: var(--secondary); }
.btn-link-custom i { transition: transform 0.2s; margin-left: 5px; }
.btn-link-custom:hover i { transform: translateX(5px); }

/* --- Appointment Section --- */
.bg-gradient-sidebar {
    background: var(--gradient-mixed);
    position: relative;
    overflow: hidden;
}
.bg-gradient-sidebar::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background: url('https://www.transparenttextures.com/patterns/cubes.png');
    opacity: 0.1;
}

/* === START: FIX SELECT DROPDOWN STYLE === */
/* تحسين شكل حقول الإدخال */
.form-control, .form-select {
    background-color: #f8f9fa !important; /* لون خلفية فاتح مثل الحقول */
    border: none; /* إزالة الحدود */
    padding: 1rem 1rem; /* تكبير المساحة الداخلية */
    border-radius: 0.5rem; /* تدوير الزوايا */
    color: var(--dark);
    font-weight: 500;
    box-shadow: none;
}

/* تحسين شكل القائمة المنسدلة تحديداً */
.form-select {
    cursor: pointer;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3e%3cpath fill='%230A7CFF' stroke='%230A7CFF' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='m2 5 6 6 6-6'/%3e%3c/svg%3e");
    background-size: 16px 12px;
}

.form-control:focus, .form-select:focus {
    box-shadow: 0 0 0 3px rgba(10, 124, 255, 0.15);
    background-color: white !important;
}
/* === END: FIX SELECT DROPDOWN STYLE === */


/* --- Footer & Map --- */
.whatsapp-float {
    position: fixed;
    bottom: 30px;
    right: 30px;
    background: #25D366;
    color: white;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 30px;
    box-shadow: 0 10px 25px rgba(37, 211, 102, 0.4);
    z-index: 1000;
    transition: all 0.3s;
}
.whatsapp-float:hover {
    transform: scale(1.1);
    color: white;
}

/* --- Animations --- */
.fade-in-up { opacity: 0; transform: translateY(30px); transition: 0.8s ease-out; }
.fade-in-left { opacity: 0; transform: translateX(-30px); transition: 0.8s ease-out; }
.fade-in-right { opacity: 0; transform: translateX(30px); transition: 0.8s ease-out; }
.visible { opacity: 1; transform: translate(0); }

@media (max-width: 991px) {
    .hero-section { text-align: center; padding-top: 100px; }
    .hero-image-wrapper { margin-top: 40px; }
    .floating-card { position: relative; inset: auto; margin: 10px auto; max-width: 300px; }
    .trust-stats { justify-content: center; margin-top: 30px !important; }
}

#langDropdown {
    font-size: 0.95rem;
    cursor: pointer;
    padding: 5px 10px;
    border-radius: 20px;
    transition: background 0.3s;
}

#langDropdown:hover {
    background-color: rgba(10, 124, 255, 0.1);
    color: var(--primary) !important;
}

@media (max-width: 576px) {
    .dropdown-menu-end {
        right: -50px !important; 
    }
}

/* === START: RTL SUPPORT FOR ARABIC === */
/* تعديلات بسيطة للغة العربية */
body[dir="rtl"] {
    text-align: right;
}
body[dir="rtl"] .ms-auto { margin-right: auto !important; margin-left: 0 !important; }
body[dir="rtl"] .me-2, body[dir="rtl"] .me-3 { margin-left: 0.5rem !important; margin-right: 0 !important; }
body[dir="rtl"] .ms-2, body[dir="rtl"] .ms-3 { margin-right: 0.5rem !important; margin-left: 0 !important; }
body[dir="rtl"] .form-select { background-position: left 0.75rem center; padding-right: 1rem; padding-left: 2.25rem; }
body[dir="rtl"] .fade-in-left { transform: translateX(30px); }
body[dir="rtl"] .fade-in-right { transform: translateX(-30px); }
body[dir="rtl"] .visible { transform: translate(0); }
/* === END: RTL SUPPORT === */


/* --- Custom Elegant Dropdown (محسنة لتدعم العربية) --- */
.custom-select-box {
    position: relative;
    font-family: inherit;
    width: 100%;
}

/* العنصر الظاهر (الزر) */
.select-selected {
    background-color: #f1f4f8;
    border-radius: 12px;
    color: var(--dark);
    font-weight: 500;
    cursor: pointer;
    user-select: none;
    transition: all 0.3s;
    position: relative;
    
    /* الوضع الافتراضي (للغات اللاتينية LTR) */
    text-align: left;
    padding: 15px 45px 15px 20px; /* مساحة كبيرة يمين للسهم، وصغيرة يسار */
}

/* السهم المخصص */
.select-selected:after {
    position: absolute;
    content: "";
    top: 50%;
    width: 0;
    height: 0;
    border: 6px solid transparent;
    border-color: var(--primary) transparent transparent transparent;
    transform: translateY(20%);
    transition: transform 0.3s;
    
    /* مكان السهم في LTR */
    right: 20px; 
    left: auto;
}

/* عند فتح القائمة */
.select-selected.select-arrow-active:after {
    transform: translateY(-50%) rotate(180deg);
}

/* === تنسيق خاص للغة العربية (RTL) لمنع التداخل === */
body[dir="rtl"] .select-selected {
    text-align: right; /* النص يمين */
    padding: 15px 20px 15px 45px; /* نعكس الحشوة: مساحة كبيرة يسار للسهم */
}

body[dir="rtl"] .select-selected:after {
    right: auto; /* نلغي التموضع اليميني */
    left: 20px;  /* نضع السهم في اليسار */
}

/* القائمة المنسدلة نفسها */
.select-items {
    position: absolute;
    background-color: #fff;
    top: 110%;
    left: 0;
    right: 0;
    z-index: 99;
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
    overflow: hidden;
    max-height: 200px;
    overflow-y: auto;
    
    /* تأثير الظهور */
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
    transition: all 0.3s cubic-bezier(0.165, 0.84, 0.44, 1);
    border: 1px solid rgba(0,0,0,0.05);
}

/* محاذاة عناصر القائمة حسب اللغة */
.select-items div {
    color: var(--dark);
    padding: 12px 20px;
    cursor: pointer;
    border-bottom: 1px solid #f1f4f8;
    transition: background 0.2s;
    text-align: left; /* افتراضي */
}

/* محاذاة عناصر القائمة لليمين في العربية */
body[dir="rtl"] .select-items div {
    text-align: right;
}

.select-hide {
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
}

.select-items div:hover {
    background-color: rgba(10, 124, 255, 0.1);
    color: var(--primary);
}


/* --- تحسين قائمة الموبايل (نسخة الزجاج الشفاف الأنيق) --- */
@media (max-width: 991px) {
    .navbar-collapse {
        /* خلفية زجاجية حقيقية (ليست بيضاء بالكامل) */
        background: rgba(255, 255, 255, 0.20); 
        
        /* ضبابية قوية جداً تخفي تفاصيل الهيرو وتبرز النص */
        backdrop-filter: blur(25px);
        -webkit-backdrop-filter: blur(25px);
        
        /* حدود وتظليل ناعم */
        border-top: 1px solid rgba(255, 255, 255, 0.5);
        box-shadow: 0 20px 40px rgba(0, 0, 0, 0.05);
        
        /* إزالة الهوامش الكبيرة لجعلها متراصة */
        margin-top: 0;
        padding: 10px 0;
    }

    /* تنسيق الروابط لتبدو كقائمة متصلة */
    .navbar-nav .nav-item {
        margin: 0;
        padding: 0 20px; /* حشوة جانبية فقط */
    }

    .navbar-nav .nav-link {
        padding: 15px 0; /* مسافة رأسية مريحة ولكن ليست متباعدة */
        border-bottom: 1px solid rgba(0, 0, 0, 0.03); /* خط فاصل خفيف جداً */
        font-weight: 600;
        color: var(--dark);
        text-align: left; /* محاذاة لليسار لتبدو أرتب */
    }

    /* دعم العربية (محاذاة لليمين) */
    body[dir="rtl"] .navbar-nav .nav-link {
        text-align: right;
    }

    /* تأثير عند التمرير */
    .navbar-nav .nav-link:hover, 
    .navbar-nav .nav-link.active {
        color: var(--primary);
        padding-left: 10px; /* حركة بسيطة لليسار عند اللمس */
        background: transparent; /* بدون خلفية، فقط حركة */
    }

    body[dir="rtl"] .navbar-nav .nav-link:hover, 
    body[dir="rtl"] .navbar-nav .nav-link.active {
        padding-left: 0;
        padding-right: 10px; /* حركة لليمين في العربية */
    }

    /* الزر الأخير (Prendre RDV) */
    .nav-item:last-child {
        margin-top: 15px;
        text-align: center;
        border-bottom: none;
    }
}