
/* =====================================================
   DYNAMIC STYLE - Version Corrigée
   Compatibilité : Bootstrap Carousel + Navbar visible
   ===================================================== */

:root {
    --primary-color: #4a6fa5;
    --secondary-color: #aaaaaa;
    --accent-color: #00a3d7;
    --text-color: #333;
    --bg-color: #f8f9fa;
    --card-bg: #ffffff;
    --header-bg: #2c3e50;
}

/* === GLOBAL === */
body {
    font-family: 'Nunito Sans', sans-serif;
    background-color: var(--bg-color);
    color: var(--text-color);
    margin: 0;
    padding: 0;
    overflow-x: hidden; /* Évite les débordements horizontaux */
}

h1, h2, h3, h4, h5, h6 {
    font-family: 'Gruppo', cursive;
    color: var(--primary-color);
}

/* === NAVBAR - TOUJOURS VISIBLE (z-index élevé) === */
.navbar,
header,
.navbar-collapse,
.navbar-nav,
.navbar-brand,
.nav-link {
    position: relative !important;
    z-index: 10000 !important; /* Priorité maximale */
}

.navbar {
    background-color: var(--header-bg) !important;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.navbar-brand, .nav-link {
    font-family: 'Gruppo', cursive;
    color: white !important;
    transition: color 0.3s ease;
}

.nav-link:hover {
    color: var(--secondary-color) !important;
}

/* Navbar fixed/sticky si utilisée */
.navbar.fixed-top,
.navbar.sticky-top {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    z-index: 10000 !important;
    background-color: var(--header-bg) !important;
}

/* === HERO SECTION === */
.hero-section {
    background-image: url('https://placehold.co/1920x600/4a6fa5/ffffff?text=Famille+Baumann');
    background-size: cover;
    background-position: center;
    height: 60vh;
    display: flex;
    align-items: center;
    position: relative;
}

.hero-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0,0,0,0.5);
}

.hero-content {
    position: relative;
    z-index: 1;
    color: white;
    text-align: center;
    padding: 2rem;
}

.section-title {
    color: var(--primary-color);
    margin-bottom: 1.5rem;
    text-align: center;
}

/* === CARDS === */
.card {
    border: none;
    border-radius: 15px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
    margin-bottom: 2rem;
    background-color: var(--card-bg);
    overflow: visible; /* Important pour ne pas couper le carousel */
    transition: transform 0.3s ease;
}

.card:hover {
    transform: translateY(-5px);
}

.card-header {
    background-color: var(--primary-color);
    color: white;
    font-weight: 600;
    padding: 1rem;
}

/* === BUTTONS === */
.btn-primary {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
    transition: all 0.3s ease;
}

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

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

.btn-secondary:hover {
    background-color: #d35400;
    border-color: #d35400;
}

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

.btn-accent:hover {
    background-color: #219653;
    border-color: #219653;
}

/* === ICONS === */
.icon {
    font-size: 1.5rem;
    margin-right: 0.5rem;
    color: var(--primary-color);
}

/* === FOOTER === */
footer {
    background-color: var(--header-bg);
    color: white;
    padding: 2rem 0;
    margin-top: 3rem;
    position: relative;
    z-index: 1;
}

footer a {
    color: rgba(255,255,255,0.8);
    text-decoration: none;
    transition: color 0.3s ease;
}

footer a:hover {
    color: #fff;
}

/* === FORMS === */
.form-control, .form-select {
    border-radius: 8px;
    border: 1px solid #ddd;
}

/* === CAROUSEL GÉNÉRIQUE (autres pages que detail.php) === */
/* Règles flexibles qui n'affectent PAS #tripCarousel */
.carousel-item img {
    max-width: 100%;
    height: auto;
    object-fit: contain;
    object-position: center;
}

/* Carousel spécifiques (si vous en avez d'autres) */
#homeCarousel .carousel-item img,
#galleryCarousel .carousel-item img {
    max-height: 500px;
    object-fit: contain;
}

/* === IMPORTANT : EXCLUSION DE #tripCarousel === */
/* Les styles de #tripCarousel sont gérés dans detail.php */
/* Ne PAS ajouter de règles .carousel-item ici qui pourraient interférer */

/* === RECIPE CATEGORY === */
.recipe-category {
    display: inline-block;
    background-color: var(--secondary-color);
    color: white;
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.85rem;
    margin-right: 0.5rem;
    margin-bottom: 0.5rem;
}

/* === SEARCH & LOGIN === */
.search-container {
    background-color: white;
    padding: 2rem;
    border-radius: 15px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
    margin-bottom: 2rem;
}

.login-container {
    max-width: 400px;
    margin: 2rem auto;
    padding: 2rem;
    background-color: white;
    border-radius: 15px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
}

/* === ALERTS === */
.alert {
    border-radius: 8px;
}

/* === MODULES SPECIFIQUES === */
.recipe-detail-img, 
.trip-detail-img {
    max-width: 100%;
    height: auto;
    border-radius: 10px;
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}

.map-container {
    height: 400px;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}

/* === PHOTOS DE VOYAGE (liste.php) === */
.travel-photo {
    width: 100%;
    object-fit: contain;
    background: #f8f9fa;
    transition: transform 0.2s ease;
}
.travel-photo:hover {
    transform: scale(1.02);
}
.travel-photo.portrait { max-height: 320px; }
.travel-photo.landscape { max-height: 220px; }

/* === RESPONSIVE === */
@media (max-width: 768px) {
    body {
        overflow-x: hidden !important;
    }
    
    .navbar-nav {
        z-index: 10000 !important;
    }
    
    .card {
        margin-bottom: 1rem;
    }
    
    .hero-section {
        height: 40vh;
    }
    
    #tripCarousel .carousel-item img {
        max-height: 60vh !important;
    }
}

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

.card {
    animation: fadeIn 0.5s ease forwards;
}

/* === UTILITIES === */
.text-primary-custom { color: var(--primary-color) !important; }
.bg-primary-custom { background-color: var(--primary-color) !important; }
.text-secondary-custom { color: var(--secondary-color) !important; }
.bg-secondary-custom { background-color: var(--secondary-color) !important; }