/* =============================================================================
   HOMEPAGE STYLES - VefaConnect
   ============================================================================= */

/* Hero Section Styles */
.hero {
    position: relative;
    overflow: hidden;
    min-height: 50vh; /* Assure une hauteur minimale sur mobile */
}

/* Ajustements pour la navbar fixe mobile */
@media (max-width: 767px) {
    /* Force la navbar à être fixe avec la plus haute priorité */
    .custom-navbar {
        position: fixed !important;
        top: 0 !important;
        left: 0 !important;
        width: 100vw !important;
        z-index: 1050 !important;
        background-color: var(--background-color, #ffffff) !important;
        box-shadow: 0 2px 4px rgba(0,0,0,0.1) !important;
    }
    
    /* Force le padding-top sur le body pour compenser la navbar */
    body {
        padding-top: 60px !important;
    }
    
    /* Assurer que main_page_container respecte la navbar fixe */
    .main_page_container {
        position: relative;
        z-index: 1;
        margin-top: 0;
        padding-top: 0;
    }
    
    /* Corriger la hero section pour qu'elle ne chevauche pas */
    .hero {
        position: relative;
        z-index: 1;
        margin-top: 0 !important;
        padding-top: 0 !important;
        overflow: hidden;
    }
    
    /* S'assurer que le contenu de la hero est correctement positionné */
    .hero .container {
        position: relative;
        z-index: 3;
        padding-top: 20px;
    }
    
    /* Corriger l'overlay pour qu'elle ne dépasse pas */
    .hero .overlay {
        position: absolute;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        z-index: 2;
    }
    
    /* Corriger les images hero */
    .hero picture,
    .hero img {
        position: absolute;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        object-fit: cover;
        z-index: 1;
    }
    
    /* Corriger les sections suivantes */
    .how-it-works-section,
    .location-info-section,
    .main-section {
        position: relative;
        z-index: 1;
        background-color: var(--background-color, #ffffff);
        margin-top: 0;
        padding-top: 2rem;
    }
    
    /* Corriger le titre H1 avec la variable CSS */
    :root {
        --hero-title-font-size: 1.8rem !important;
    }
    
    /* Règle de fallback pour le titre */
    .hero h1 {
        font-size: 1.8rem !important;
        line-height: 1.2 !important;
        margin-bottom: 1rem !important;
    }
}

.hero-image {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.hero-image-connected {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center 23%;
    transform: scale(1);
}

.auth-height {
    height: 25vh;
    min-height: 300px; /* Hauteur minimale pour éviter que ce soit trop petit */
}

.unauth-height {
    height: 53vh;
    min-height: 400px; /* Hauteur minimale pour mobile */
}

.overlay {
    position: absolute; 
    top: 0; 
    right: 0; 
    bottom: 0; 
    left: 0;
    z-index: 2;
    background-color: var(--hero-overlay);
}

.container.position-relative {
    position: relative;
    z-index: 2;
}

/* Amélioration de la visibilité du texte */
.hero h1 {
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.8);
    font-weight: 700;
}

.hero .lead, .hero .lead-custom {
    text-shadow: 1px 1px 3px rgba(0, 0, 0, 0.7);
    font-weight: 500;
}

/* Styles pour les boutons CTA dans le hero */
.cta-buttons {
    margin-top: 3.5rem;
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    justify-content: center;
}

.cta-buttons .btn {
    text-shadow: none;
    font-weight: 600;
    padding: 12px 30px;
    border-radius: 25px;
    min-width: 180px;
    white-space: nowrap;
}

.btn-primary.cta-primary {
    background-color: #3498db;
    border-color: #3498db;
    box-shadow: 0 4px 15px rgba(52, 152, 219, 0.3);
    transition: all 0.3s ease;
}

.btn-primary.cta-primary:hover {
    background-color: #2980b9;
    border-color: #2980b9;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(52, 152, 219, 0.4);
}

.btn-outline-light.cta-secondary {
    border: 2px solid rgba(255, 255, 255, 0.8);
    color: white;
    background-color: transparent;
    transition: all 0.3s ease;
}

.btn-outline-light.cta-secondary:hover {
    background-color: rgba(255, 255, 255, 0.2);
    border-color: white;
    color: white;
    transform: translateY(-2px);
}

/* Amélioration du formulaire de recherche pour mobile - compatible avec styles existants */
.hero .search-form {
    position: relative;
    margin: 2rem auto 0;
    max-width: 500px;
    display: flex;
    align-items: center;
    padding: 0;
}

.hero .search-form .search {
    background: rgba(255, 255, 255, 0.95);
    padding-left: 20px;
    padding-right: 50px;
    height: 50px;
    border-radius: 25px;
    font-size: 16px; /* Évite le zoom sur iOS */
}

.hero .search-form .search:focus {
    box-shadow: 0 4px 20px rgba(52, 152, 219, 0.3);
}

.hero .search-form .search-icon-link {
    position: absolute;
    right: 15px;
    top: 50%;
    transform: translateY(-50%);
    color: #3498db;
    background: none;
    border: none;
    cursor: pointer;
}

/* Styles pour la section "Comment ça marche" */
.how-it-works-section {
    background-color: #f8f9fa;
    padding: 4rem 0;
    position: relative;
}

.how-it-works-section h2 {
    color: #2c3e50;
    font-weight: 700;
    margin-bottom: 3rem;
}

/* Ligne de progression entre les étapes */
.how-it-works-section .row {
    position: relative;
}

.how-it-works-section .col-md-4 {
    position: relative;
}

.step-container {
    position: relative;
    padding: 2rem 1rem;
    background: white;
    border-radius: 15px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    height: 100%;
    display: flex;
    flex-direction: column;
    z-index: 2;
    margin-bottom: 2rem; /* Espacement pour mobile */
}

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

.step-number {
    position: absolute;
    top: -15px;
    left: 50%;
    transform: translateX(-50%);
    width: 45px;
    height: 45px;
    background: linear-gradient(135deg, #3498db, #2980b9);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 1.3rem;
    z-index: 3;
    box-shadow: 0 4px 12px rgba(52, 152, 219, 0.3);
    border: 3px solid white;
}

.step-number::after {
    content: '';
    position: absolute;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    background: linear-gradient(135deg, #3498db, #2980b9);
    z-index: -1;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% {
        transform: scale(1);
        opacity: 1;
    }
    50% {
        transform: scale(1.1);
        opacity: 0.7;
    }
    100% {
        transform: scale(1);
        opacity: 1;
    }
}

.step-icon {
    color: #3498db;
    margin: 2rem 0 1.5rem 0;
}

.step-container h3 {
    color: #2c3e50;
    font-weight: 600;
    margin-bottom: 1rem;
}

.step-container p {
    color: #6c757d;
    line-height: 1.6;
    margin-bottom: 2rem;
    flex-grow: 1;
}

.btn-step {
    border-radius: 25px;
    padding: 10px 25px;
    font-weight: 500;
    transition: all 0.3s ease;
    margin-top: auto;
    border-color: #3498db;
    color: #3498db;
}

.btn-step:hover {
    transform: translateY(-2px);
    background-color: #3498db;
    border-color: #3498db;
    color: white;
}



/* Styles pour la section programmes */
.main-section {
    padding: 4rem 0;
}

.main-section h2 {
    color: #2c3e50;
    font-weight: 700;
    font-size: 2.5rem;
    margin-bottom: 3rem;
}

.main-section .carousel-item .card {
    border: none;
    border-radius: 15px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    overflow: hidden;
    margin-bottom: 1rem;
}

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

.main-section .card-img-top {
    height: 200px;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.main-section .card:hover .card-img-top {
    transform: scale(1.05);
}

.main-section .card-title {
    color: #2c3e50;
    font-weight: 600;
    font-size: 1.25rem;
}

.main-section .btn-primary {
    background-color: #3498db;
    border-color: #3498db;
    border-radius: 25px;
    font-weight: 600;
    padding: 8px 20px;
    transition: all 0.3s ease;
}

.main-section .btn-primary:hover {
    background-color: #2980b9;
    border-color: #2980b9;
    transform: translateY(-2px);
}

/* Optimisations pour tablettes */
@media (max-width: 991px) and (min-width: 769px) {
    .hero h1 {
        font-size: 2.5rem;
    }
    
    .hero .lead-custom {
        font-size: 1.2rem;
    }
    
    .step-container {
        margin-bottom: 2.5rem;
    }
}

/* Optimisations pour mobile */
@media (max-width: 768px) {
    /* Redéfinir la variable pour tablettes */
    :root {
        --hero-title-font-size: 2.2rem; /* Taille tablette responsive */
    }
    
    .hero {
        min-height: 60vh;
    }
    
    .auth-height {
        height: 40vh;
        min-height: 350px;
    }
    
    .unauth-height {
        height: 70vh;
        min-height: 500px;
    }
    
    .hero h1 {
        margin-bottom: 1rem;
    }
    
    .hero .lead-custom {
        font-size: 1.1rem;
        margin-bottom: 2rem;
    }
    
    .cta-buttons {
        margin-top: 2rem;
        flex-direction: column;
        align-items: center;
        gap: 10px;
    }
    
    .cta-buttons .btn {
        width: 90%;
        max-width: 300px;
        margin: 5px 0;
        font-size: 1rem;
    }
    
    .hero .search-form {
        margin: 1.5rem auto 0;
        padding: 0 15px;
    }
    
    .how-it-works-section {
        padding: 3rem 0;
    }
    
    .how-it-works-section h2 {
        font-size: 2rem;
        margin-bottom: 2rem;
    }
    
    .step-container {
        margin-bottom: 3rem;
        padding: 1.5rem 1rem;
    }
    
    .step-icon {
        margin: 1.5rem 0 1rem 0;
    }
    
    .step-icon i {
        font-size: 2.5rem !important;
    }
    
    .main-section {
        padding: 3rem 0;
    }
    
    .main-section h2 {
        font-size: 2rem;
        margin-bottom: 2rem;
    }
    
    .main-section .card-img-top {
        height: 180px;
    }
    
    /* Amélioration de la grille pour mobile */
    .main-section .row {
        margin: 0 -10px;
    }
    
    .main-section .col-md-4 {
        padding: 0 10px;
    }
}

/* Optimisations pour petits mobiles */
@media (max-width: 576px) {
    /* Redéfinir la variable pour petits mobiles */
    :root {
        --hero-title-font-size: 1.8rem; /* Taille mobile responsive */
    }
    
    .hero h1 {
        line-height: 1.2;
    }
    
    .hero .lead-custom {
        font-size: 1rem;
        line-height: 1.4;
    }
    
    .cta-buttons .btn {
        width: 100%;
        padding: 15px 20px;
        font-size: 1rem;
    }
    
    .hero .search-form .search {
        padding: 12px 45px 12px 15px;
        font-size: 16px;
    }
    
    .step-number {
        width: 40px;
        height: 40px;
        font-size: 1.1rem;
        top: -12px;
    }
    
    .step-container {
        padding: 1.2rem 0.8rem;
    }
    
    .main-section h2 {
        font-size: 1.75rem;
    }
    
    .main-section .card-img-top {
        height: 160px;
    }
    
    .main-section .card-title {
        font-size: 1.1rem;
    }
    
    .main-section .card-text {
        font-size: 0.9rem;
    }
}

/* Optimisations pour très petits écrans */
@media (max-width: 400px) {
    /* Redéfinir la variable pour très petits écrans */
    :root {
        --hero-title-font-size: 1.6rem !important;
    }
    
    .hero .lead-custom {
        font-size: 0.95rem;
    }
    
    .step-container {
        margin-bottom: 2.5rem;
    }
    
    .main-section .card-img-top {
        height: 140px;
    }
}

/* Touch-friendly improvements */
@media (hover: none) and (pointer: coarse) {
    .step-container:hover {
        transform: none;
        box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
    }
    
    .main-section .carousel-item .card:hover {
        transform: none;
        box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
    }
    
    .btn-step:hover,
    .btn-primary:hover,
    .cta-primary:hover,
    .cta-secondary:hover {
        transform: none;
    }
}

/* Amélioration des animations pour les performances mobiles */
@media (prefers-reduced-motion: reduce) {
    .step-number::after {
        animation: none;
    }
    
    * {
        transition: none !important;
        animation: none !important;
    }
} 