/* General Styles */
:root {
    --primary-color: #2c3e50;
    --secondary-color: #e74c3c;
    --light-color: #ecf0f1;
    --dark-color: #2c3e50;
    --success-color: #27ae60;
    --text-color: #333;
    --text-light: #7f8c8d;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    color: var(--text-color);
    line-height: 1.6;
    margin: 0;
    padding: 0;
    transition: all 0.3s ease;
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
    font-weight: 700;
    margin-bottom: 1rem;
    color: var(--dark-color);
}

p {
    margin-bottom: 1.25rem;
}

a {
    color: var(--primary-color);
    text-decoration: none;
    transition: color 0.3s ease;
}

a:hover {
    color: var(--secondary-color);
    text-decoration: none;
}

/* Navigation */
.navbar {
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    padding: 0.75rem 0;
    transition: all 0.3s ease;
}

/* Amélioration du menu burger */
.navbar-toggler {
    border: none;
    padding: 0.5rem;
    margin-left: auto;
}

.navbar-toggler:focus {
    box-shadow: none;
    outline: none;
}

.navbar-toggler-icon {
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 30'%3e%3cpath stroke='rgba%280, 0, 0, 0.55%29' stroke-linecap='round' stroke-miterlimit='10' stroke-width='2' d='M4 7h22M4 15h22M4 23h22'/%3e%3c/svg%3e");
    width: 1.5em;
    height: 1.5em;
}

/* Menu déroulant mobile */
.navbar-collapse {
    padding: 1rem 0;
}

/* Éléments du menu */
.nav-link {
    padding: 0.75rem 1rem !important;
    font-weight: 500;
    transition: all 0.3s ease;
}

/* Style actif du menu */
.nav-link.active {
    color: var(--secondary-color) !important;
    font-weight: 600;
}

.navbar-brand {
    font-weight: 700;
    font-size: 1.5rem;
    color: var(--primary-color) !important;
}

.nav-link {
    font-weight: 600;
    padding: 0.5rem 1rem !important;
    position: relative;
}

.nav-link:after {
    content: '';
    position: absolute;
    width: 0;
    height: 2px;
    bottom: 0;
    left: 50%;
    background-color: var(--secondary-color);
    transition: all 0.3s ease;
    transform: translateX(-50%);
}

.nav-link:hover:after,
.nav-link.active:after {
    width: 70%;
}

/* Hero Section */
.hero {
    padding: 5rem 0;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
    text-align: center;
}

.hero h1 {
    font-size: 3rem;
    margin-bottom: 1rem;
    color: white;
}

/* Cards */
.card {
    border: none;
    border-radius: 10px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    margin-bottom: 2rem;
    height: 100%;
}

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

.card-body {
    padding: 2rem;
}

/* Buttons */
.btn {
    padding: 0.6rem 1.5rem;
    border-radius: 50px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    transition: all 0.3s ease;
}

.btn-primary {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
}

.btn-primary:hover {
    background-color: #1a252f;
    border-color: #1a252f;
    transform: translateY(-2px);
}

/* Forms */
.form-control {
    padding: 0.75rem 1rem;
    border: 1px solid #ddd;
    border-radius: 5px;
    margin-bottom: 1rem;
    font-size: 1rem;
    transition: all 0.3s ease;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
}

.form-control:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 0.2rem rgba(44, 62, 80, 0.25);
    outline: none;
}

/* Amélioration de l'expérience mobile pour les champs de formulaire */
@media (max-width: 576px) {
    .form-control {
        padding: 0.85rem 1rem;
        font-size: 1rem;
    }
    
    /* Désactive le zoom automatique sur les champs de formulaire sur iOS */
    @supports (-webkit-overflow-scrolling: touch) {
        input, 
        select, 
        textarea {
            font-size: 16px !important;
        }
    }
    
    /* Amélioration des boutons sur mobile */
    .btn {
        padding: 0.75rem 1.5rem;
        font-size: 1rem;
        display: inline-block;
        width: 100%;
        max-width: 300px;
        margin: 0.5rem auto;
    }
    
    /* Ajustement des champs de formulaire pour les petits écrans */
    .form-row > [class*="col-"] {
        padding-right: 8px;
        padding-left: 8px;
    }
    
    .form-row {
        margin-right: -8px;
        margin-left: -8px;
    }
}

/* Amélioration de la sélection de fichier */
.custom-file-input:focus ~ .custom-file-label {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 0.2rem rgba(44, 62, 80, 0.25);
}

/* Style pour les cases à cocher et boutons radio */
.form-check-input {
    width: 1.2em;
    height: 1.2em;
    margin-top: 0.2em;
}

.form-check-label {
    margin-left: 0.5em;
    vertical-align: middle;
}

/* Language Switcher */
.language-switcher {
    background-color: var(--primary-color);
    padding: 0.6rem 0;
    position: relative;
    z-index: 1000;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.language-switcher .container {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    padding: 0 1rem;
}

.lang-btn {
    color: rgba(255, 255, 255, 0.9);
    text-decoration: none;
    padding: 0.5rem 1.2rem;
    border-radius: 30px;
    margin: 0 0.3rem;
    font-weight: 500;
    font-size: 0.9rem;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    background-color: rgba(255, 255, 255, 0.1);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 50px;
    text-align: center;
}

.lang-btn:hover {
    color: white;
    background-color: rgba(255, 255, 255, 0.2);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.lang-btn.active {
    color: white;
    background: linear-gradient(135deg, var(--secondary-color), #d62c1a);
    font-weight: 600;
    border-color: rgba(255, 255, 255, 0.3);
    box-shadow: 0 4px 15px rgba(231, 76, 60, 0.3);
    position: relative;
    overflow: hidden;
}

.lang-btn.active::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(45deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transform: translateX(-100%);
    transition: 0.6s;
}

.lang-btn.active:hover::after {
    transform: translateX(100%);
}

/* Barre de séparation personnalisée */
.language-switcher .divider {
    color: rgba(255, 255, 255, 0.3);
    font-weight: 300;
    margin: 0 0.1rem;
    font-size: 1.2rem;
    position: relative;
    top: -1px;
}

/* Footer */
footer {
    background-color: var(--primary-color); /* Même couleur que la barre de langue */
    color: #ffffff;
    padding: 3rem 0 1.5rem;
    margin-top: 3rem;
}

footer p, footer a, footer div {
    color: #ffffff;
}

footer a {
    color: #ffffff;
    text-decoration: none;
    transition: color 0.3s ease;
}

footer a:hover {
    color: var(--secondary-color); /* Blanc cassé au survol */
    text-decoration: underline;
}

/* Amélioration de la lisibilité des liens de contact */
footer a[href^="tel:"], 
footer a[href^="mailto:"] {
    font-weight: 500;
    padding: 0.25rem 0.5rem;
    border-radius: 3px;
    display: inline-block;
}

footer a[href^="tel"]:hover, 
footer a[href^="mailto:"]:hover {
    background-color: rgba(255, 255, 255, 0.1);
    text-decoration: none;
}

/* Responsive Design */
@media (max-width: 1200px) {
    /* Styles pour les tablettes en mode paysage et petits ordinateurs portables */
    .hero h1 {
        font-size: 2.5rem;
    }
    
    .hero p.lead {
        font-size: 1.2rem;
    }
}

@media (max-width: 768px) {
    /* Styles pour les tablettes en mode portrait */
    .hero {
        padding: 3rem 0;
    }
    
    .hero h1 {
        font-size: 2rem;
    }
    
    .navbar-brand {
        font-size: 1.1rem;
    }
    
    .card {
        margin-bottom: 1.5rem;
    }
    
    /* Ajustement de la taille de police pour les petits écrans */
    body {
        font-size: 0.95rem;
    }
    
    h1 { font-size: 2rem; }
    h2 { font-size: 1.75rem; }
    h3 { font-size: 1.5rem; }
    h4 { font-size: 1.25rem; }
}

@media (max-width: 576px) {
    /* Styles pour les téléphones mobiles */
    .hero {
        padding: 2rem 0;
    }
    
    .hero h1 {
        font-size: 1.75rem;
    }
    
    .hero p.lead {
        font-size: 1.1rem;
    }
    
    .hero .h5 {
        font-size: 1rem;
    }
    
    .navbar-brand {
        font-size: 1rem;
    }
    
    /* Ajustement des marges et paddings pour les petits écrans */
    .container, .container-fluid {
        padding-left: 1rem;
        padding-right: 1rem;
    }
    
    /* Ajustement des boutons pour les doigts */
    .btn, .lang-btn {
        padding: 0.5rem 1rem;
        font-size: 0.9rem;
    }
    
    /* Amélioration de l'espacement des sections */
    section {
        padding: 2rem 0;
    }
    
    /* Ajustement des images */
    img {
        max-width: 100%;
        height: auto;
    }
    
    /* Ajustement du footer pour les petits écrans */
    footer {
        padding: 1.5rem 0;
        text-align: center;
    }
    
    footer p {
        margin-bottom: 0.5rem;
    }
    
    /* Amélioration de la lisibilité des liens de contact */
    footer a[href^="tel:"], 
    footer a[href^="mailto:"] {
        display: inline-block;
        padding: 0.5rem 1rem;
        margin: 0.25rem 0;
    }
}

/* Correction pour les appareils avec une hauteur d'écran limitée */
@media (max-height: 600px) and (orientation: landscape) {
    .hero {
        padding: 1.5rem 0;
    }
    
    .hero h1 {
        font-size: 1.8rem;
        margin-bottom: 0.5rem;
    }
    
    .hero p {
        margin-bottom: 0.5rem;
    }
}

/* Correction pour les appareils très larges */
@media (min-width: 1600px) {
    .container {
        max-width: 1400px;
    }
}

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

[dir="rtl"] .text-end {
    text-align: left !important;
}

[dir="rtl"] .ms-auto {
    margin-right: auto !important;
    margin-left: 0 !important;
}

/* Amélioration de la lisibilité sur mobile */
body {
    -webkit-text-size-adjust: 100%;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}

/* Taille de police minimale pour une meilleure lisibilité */
html {
    font-size: 100%;
}

/* Espacement amélioré pour le contenu */
.container {
    padding-left: 1rem;
    padding-right: 1rem;
}

/* Responsive Images */
.img-fluid {
    max-width: 100%;
    height: auto;
    display: block;
    margin: 0 auto;
}

/* Amélioration de la lisibilité des liens */
a {
    word-wrap: break-word;
}

/* Ajustement des marges pour les titres */
h1, h2, h3, h4, h5, h6 {
    margin-top: 1.5em;
    margin-bottom: 0.75em;
}

/* Espacement des paragraphes */
p {
    margin-bottom: 1.25em;
    line-height: 1.7;
}

/* Amélioration de la lisibilité sur fond coloré */
.bg-primary, 
.bg-dark,
.bg-secondary {
    color: white;
}

.bg-primary a,
.bg-dark a,
.bg-secondary a {
    color: rgba(255, 255, 255, 0.9);
    text-decoration: underline;
}

.bg-primary a:hover,
.bg-dark a:hover,
.bg-secondary a:hover {
    color: white;
    text-decoration: none;
}

/* Correction des problèmes de débordement sur mobile */
.row {
    margin-right: -0.75rem;
    margin-left: -0.75rem;
}

[class*="col-"] {
    padding-right: 0.75rem;
    padding-left: 0.75rem;
}

/* Amélioration de la visibilité des éléments interactifs */
button, 
input, 
select, 
textarea, 
a.btn {
    -webkit-tap-highlight-color: rgba(0, 0, 0, 0.1);
}

/* Correction pour les appareils iOS */
@supports (-webkit-touch-callout: none) {
    body {
        /* La règle de remplissage empêche la barre d'outils d'iOS de masquer le contenu */
        padding-bottom: env(safe-area-inset-bottom);
    }
    
    /* Correction pour le mode paysage sur iOS */
    @media (orientation: landscape) {
        .navbar-collapse {
            max-height: 60vh;
            overflow-y: auto;
        }
    }
}

/* Animations */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

.fade-in {
    animation: fadeIn 0.6s ease-out forwards;
}

/* Utility Classes */
.section-padding {
    padding: 5rem 0;
}

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

.bg-light {
    background-color: var(--light-color) !important;
}

/* Map Container */
#map {
    border-radius: 10px;
    overflow: hidden;
}

/* Success Message */
.alert-success {
    background-color: #d4edda;
    color: #155724;
    padding: 1rem;
    border-radius: 5px;
    margin-bottom: 1rem;
    display: none;
}
