/* --- Variables et Reset --- */
:root {
    --primary-color: #2D8DF7; /* Bleu Israël */
    --secondary-color: #2D8DF7; /* Bleu plus foncé pour le hover */
    --accent-color: #ffcc00; /* Jaune/Or pour attirer l'attention */
    --text-dark: #333;
    --text-light: #f4f4f4;
    --white: #ffffff;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Open Sans', sans-serif;
    line-height: 1.6;
    color: var(--text-dark);
}

h1, h2, h3, h4 {
    font-family: 'Montserrat', sans-serif;
    margin-bottom: 1rem;
}

a {
    text-decoration: none;
    color: inherit;
}

ul {
    list-style: none;
}

.container {
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 20px;
}

/* --- Navigation --- */
.navbar {
    background: #ffffff;
    box-shadow: 0 2px 15px rgba(0,0,0,0.05);
    position: fixed;
    width: 100%;
    top: 0;
    z-index: 1000;
    height: 70px;
    display: flex;
    align-items: center;
    transition: top 0.3s ease, background-color 0.3s ease;
}

/* --- Navbar Transparente (Accueil) --- */
.navbar.transparent {
    background: transparent;
    box-shadow: none;
    position: fixed; /* Reste fixe au défilement */
    transition: background-color 0.3s ease;
}

.navbar.transparent .logo,
.navbar.transparent .nav-links a,
.navbar.transparent .hamburger {
    color: var(--white);
}

.navbar.transparent .btn-nav-donate {
    background-color: var(--white);
    color: var(--primary-color) !important;
}

/* Navbar décalée quand il y a le top-bar */
.navbar.with-topbar {
    top: 40px;
}

/* Le menu remonte en haut de page au scroll */
.navbar.scrolled {
    top: 0;
}

/* Style du header transparent quand on scrolle vers le bas */
.navbar.transparent.scrolled {
    background-color: rgba(255, 255, 255, 0.8); /* Fond semi-transparent */
    backdrop-filter: blur(10px); /* Effet de flou moderne */
    box-shadow: 0 2px 15px rgba(0,0,0,0.05);
    top: 0; /* Remonte en haut quand on scrolle */
}

/* Changement de couleur du texte quand le menu devient blanc au scroll */
.navbar.transparent.scrolled .logo {
    color: var(--primary-color);
}
.navbar.transparent.scrolled .nav-links a {
    color: var(--text-dark);
}
.navbar.transparent.scrolled .hamburger {
    color: var(--text-dark);
}
.navbar.transparent.scrolled .btn-nav-donate {
    background-color: var(--primary-color);
    color: var(--white) !important;
}

.navbar .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
}

.logo {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary-color); /* Couleur par défaut foncée sur fond blanc */
}

.nav-links {
    display: flex;
    align-items: center;
}

.nav-links li {
    margin-left: 20px;
}

.nav-links a {
    font-weight: 600;
    color: var(--text-dark); /* Couleur par défaut foncée */
    transition: color 0.3s;
}

.nav-links a:hover {
    color: var(--accent-color);
}

.btn-nav-donate {
    background-color: var(--primary-color); /* Bouton bleu sur fond blanc */
    color: var(--white) !important;
    padding: 10px 20px;
    border-radius: 5px;
    transition: background 0.3s;
}

.btn-nav-donate:hover {
    background-color: var(--accent-color);
    color: var(--text-dark) !important;
}

.hamburger {
    display: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--text-dark);
}

/* --- Hero Section --- */
.hero {
    position: relative;
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    color: var(--white);
    padding: 120px 0;
    overflow: hidden;
}

/* Vidéo de fond */
.back-video {
    position: absolute;
    right: 0;
    bottom: 0;
    min-width: 100%;
    min-height: 100%;
    width: auto;
    height: auto;
    z-index: -1;
    object-fit: cover;
    filter: brightness(0.5); /* Assombrit la vidéo pour lire le texte */
}

.hero h1 {
    font-size: 3rem;
    margin-bottom: 20px;
}

.hero p {
    font-size: 1.2rem;
    margin-bottom: 30px;
    max-width: 700px;
    margin-left: auto;
    margin-right: auto;
}

.btn-primary {
    display: inline-block;
    background: var(--accent-color);
    color: var(--text-dark);
    padding: 12px 30px;
    border-radius: 5px;
    font-weight: bold;
    transition: transform 0.2s;
}

.btn-primary:hover {
    transform: scale(1.05);
    background: #e6b800;
}

/* --- Mission Section --- */
.section-mission {
    padding: 80px 0;
    background: #f9f9f9;
    text-align: center;
}

.subtitle {
    color: #666;
    margin-bottom: 40px;
}

.cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 30px;
}

.card {
    background: var(--white);
    padding: 30px;
    border-radius: 10px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.05);
    transition: transform 0.3s;
}

.card:hover {
    transform: translateY(-10px);
}

.icon {
    font-size: 3rem;
    color: var(--primary-color);
    margin-bottom: 20px;
}

/* --- Projects Section --- */
.section-projects {
    padding: 80px 0;
}

.project-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 40px;
    margin-top: 40px;
}

.project-text {
    flex: 1;
}

.project-image {
    flex: 1;
    height: 300px;
    border-radius: 10px;
    background-color: #eee;
}

/* --- Gallery Section --- */
.section-gallery {
    padding: 80px 0;
    background: #fff;
    text-align: center;
}

.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 15px;
    margin-top: 30px;
}

.gallery-item img {
    width: 100%;
    height: 250px;
    object-fit: cover;
    border-radius: 10px;
    transition: transform 0.3s ease;
}

/* --- Donate Section --- */
.section-donate {
    padding: 80px 0;
    background: var(--primary-color);
    color: var(--white);
    text-align: center;
}

.donation-options {
    margin: 30px 0;
}

.amount-btn {
    background: transparent;
    border: 2px solid var(--white);
    color: var(--white);
    padding: 10px 20px;
    margin: 5px;
    border-radius: 5px;
    cursor: pointer;
    font-size: 1.1rem;
    transition: all 0.3s;
}

.amount-btn:hover, .amount-btn:focus {
    background: var(--white);
    color: var(--primary-color);
}

.btn-large {
    font-size: 1.2rem;
    padding: 15px 40px;
}

.tax-info {
    margin-top: 20px;
    opacity: 0.8;
}

/* Tableau d'équivalence des dons */
.donation-table {
    width: 100%;
    max-width: 600px;
    margin: 30px auto;
    border-collapse: collapse;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: var(--white);
}
.donation-table td {
    padding: 15px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
    font-size: 1.1rem;
    text-align: left;
}
.donation-table tr:last-child td {
    border-bottom: none;
}
.donation-table td:first-child {
    font-weight: bold;
    color: var(--accent-color);
    width: 30%;
    text-align: right;
    padding-right: 20px;
}

/* --- Page Don (Nouveau Design) --- */
.donate-header {
    /* Fond avec image et dégradé bleu */
    background: linear-gradient(rgba(45, 141, 247, 0.9), rgba(45, 141, 247, 0.6)), url('https://images.unsplash.com/photo-1488521787991-ed7bbaae773c?auto=format&fit=crop&w=1920&q=80');
    background-size: cover;
    background-position: center;
    color: var(--white);
    padding: 280px 0 200px; /* Hauteur encore augmentée */
    text-align: center;
    margin-top: -70px; /* Pour passer sous la navbar fixe */
}

.donate-header h1 {
    font-size: 3rem;
    margin-bottom: 20px;
}

/* --- En-tête standard pour les autres pages --- */
.page-header {
    background: var(--primary-color); /* Fond bleu uni */
    color: var(--white);
    padding: 360px 0 160px; /* Espace augmenté pour le menu fixe */
    text-align: center;
    margin-top: -70px; /* Remonte sous la navbar */
}

.page-header h1 {
    font-size: 2.5rem;
    margin-bottom: 40px;
}

.page-header p {
    font-size: 1.2rem;
    max-width: 700px;
    margin: 0 auto;
}

.section-impact {
    padding: 80px 0;
    background: #fff;
}

.impact-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 30px;
    margin-top: 40px;
    margin-bottom: 50px;
}

/* Force 4 colonnes sur grand écran */
@media (min-width: 992px) {
    .impact-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

.impact-card {
    border: 1px solid #eee;
    border-radius: 15px;
    padding: 40px 30px;
    text-align: center;
    transition: all 0.3s ease;
    background: #fff;
    box-shadow: 0 5px 15px rgba(0,0,0,0.05);
    position: relative;
    overflow: hidden;
    cursor: pointer;
    opacity: 0; /* Pour l'animation */
    animation: fadeInUp 0.8s ease-out forwards;
}

.impact-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 15px 30px rgba(45, 141, 247, 0.15);
    border-color: var(--primary-color);
}

/* Délais d'animation pour l'effet cascade */
.impact-card:nth-child(1) { animation-delay: 0.1s; }
.impact-card:nth-child(2) { animation-delay: 0.2s; }
.impact-card:nth-child(3) { animation-delay: 0.3s; }
.impact-card:nth-child(4) { animation-delay: 0.4s; }

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.impact-card.featured {
    background: var(--primary-color);
    color: var(--white);
    transform: scale(1.05);
    box-shadow: 0 15px 30px rgba(45, 141, 247, 0.3);
    border: none;
}

.impact-card.featured:hover {
    transform: scale(1.05) translateY(-10px);
}

.impact-amount {
    display: block;
    font-size: 2.5rem;
    font-weight: 800;
    margin-bottom: 15px;
    color: var(--primary-color);
}

.impact-card.featured .impact-amount {
    color: var(--accent-color);
}

.impact-desc {
    font-size: 1.1rem;
    margin-bottom: 25px;
    line-height: 1.4;
}

.btn-donate-card {
    display: inline-block;
    padding: 10px 25px;
    border: 2px solid var(--primary-color);
    border-radius: 50px;
    color: var(--primary-color);
    font-weight: 600;
    transition: all 0.3s;
}

.impact-card:hover .btn-donate-card {
    background: var(--primary-color);
    color: var(--white);
}

.impact-card.featured .btn-donate-card {
    border-color: var(--white);
    color: var(--white);
}

.impact-card.featured:hover .btn-donate-card {
    background: var(--white);
    color: var(--primary-color);
}

/* Correction lisibilité bouton au survol */
.btn-donate-card:hover {
    background: var(--accent-color) !important;
    color: var(--text-dark) !important;
    border-color: var(--accent-color) !important;
}

/* --- FAQ Section --- */
.section-faq {
    padding: 80px 0;
    background: #f9f9f9;
}

.faq-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
    margin-top: 40px;
    align-items: start;
}

/* FAQ en 2 colonnes sur Desktop */
@media (min-width: 768px) {
    .faq-grid {
        grid-template-columns: 1fr 1fr;
    }
}

.faq-item {
    background: var(--white);
    padding: 30px;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.03);
}

.faq-question {
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
}

.faq-question h4 {
    color: var(--primary-color);
    margin-bottom: 0;
    font-size: 1.2rem;
}

.faq-toggle {
    transition: transform 0.3s ease;
}

.faq-item.active .faq-toggle {
    transform: rotate(180deg);
}

.faq-answer {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
    opacity: 0;
}

.faq-item.active .faq-answer {
    margin-top: 15px;
    opacity: 1;
}

/* --- Popup Montant Libre --- */
.popup-overlay {
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0,0,0,0.7);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 2000;
    opacity: 0;
    transition: opacity 0.3s;
}

.popup-overlay.open {
    display: flex;
    opacity: 1;
}

.popup-content {
    background: var(--white);
    padding: 40px;
    border-radius: 10px;
    width: 90%;
    max-width: 500px;
    position: relative;
    text-align: center;
}

.close-popup {
    position: absolute;
    top: 15px;
    right: 20px;
    font-size: 1.5rem;
    cursor: pointer;
    color: #999;
}

/* --- Top Donation Bar (Bandeau fin) --- */
.top-donation-bar {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 40px;
    background-color: var(--accent-color);
    color: var(--text-dark);
    z-index: 1001; /* Au-dessus de la navbar (si elle n'est pas scrolled) */
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.9rem;
    font-weight: bold;
    transition: transform 0.3s ease;
}

.top-donation-bar.hidden {
    transform: translateY(-100%);
}

.top-donation-bar span {
    margin: 0 10px;
}

/* Style spécifique de la barre de progression dans le bandeau */
.top-donation-bar .progress-container {
    width: 200px;
    height: 10px;
    margin: 0;
    display: inline-block;
    vertical-align: middle;
    background-color: rgba(255,255,255,0.4);
    box-shadow: none;
}

.top-donation-bar .progress-bar {
    background-color: var(--primary-color);
    background-image: linear-gradient(45deg,rgba(255,255,255,.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,.15) 50%,rgba(255,255,255,.15) 75%,transparent 75%,transparent);
    background-size: 40px 40px;
    animation: progress-stripes 1s linear infinite;
}

@keyframes progress-stripes {
    0% { background-position: 40px 0; }
    100% { background-position: 0 0; }
}

.top-donation-bar .progress-text {
    display: none; /* On cache le texte % dans le bandeau fin pour la clarté */
}

/* Ancienne section goal (si besoin de garder des styles génériques) */
.progress-container {
    background-color: #e0e0e0;
    border-radius: 25px;
    height: 30px;
    text-align: center;
}

.progress-bar {
    background-color: var(--accent-color);
    height: 100%;
    width: 0; /* Initialisé à 0 pour l'animation JS */
    border-radius: 25px 0 0 25px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: width 1.5s ease-in-out;
}

.progress-text {
    color: var(--text-dark);
    font-weight: bold;
    font-size: 0.9rem;
    white-space: nowrap;
    padding: 0 10px;
}


/* --- Contact Page --- */
.section-contact {
    padding: 80px 0;
    background: #f9f9f9;
}

.contact-wrapper {
    max-width: 700px;
    margin: 0 auto;
    background: var(--white);
    padding: 40px;
    border-radius: 10px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.05);
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
}

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 5px;
    font-family: inherit;
}

/* --- Sections Accueil (Nouvelles) --- */
.section-home-intro {
    padding: 80px 0;
    text-align: center;
    background: var(--white);
}

.goal-stats {
    display: flex;
    justify-content: space-between;
    max-width: 800px;
    margin: 0 auto;
    font-size: 1.1rem;
    color: #555;
}

.section-stats {
    padding: 60px 0;
    background: var(--primary-color);
    color: var(--white);
    text-align: center;
}

.stats-grid {
    display: flex;
    justify-content: space-around;
    flex-wrap: wrap;
    margin-top: 30px;
}

.stat-item h3 {
    font-size: 2.5rem;
    margin-bottom: 5px;
    color: var(--accent-color);
}

/* --- Footer --- */
footer {
    background: #222;
    color: #b0b0b0;
    padding: 50px 0 20px;
}

.footer-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 40px;
    margin-bottom: 40px;
}

.footer-col h4 {
    font-size: 1.2rem;
    color: var(--white);
    margin-bottom: 25px;
    position: relative;
}

.footer-col ul li {
    margin-bottom: 10px;
}

.footer-col ul li a {
    color: #b0b0b0;
    transition: all 0.3s ease;
    display: block;
}

.footer-col ul li a:hover {
    color: var(--white);
    padding-left: 8px;
}

.newsletter-form {
    display: flex;
    margin-top: 15px;
}

.newsletter-form input {
    height: 45px;
    width: 100%;
    padding: 10px;
    border: none;
    outline: none;
    border-radius: 4px 0 0 4px;
}

.newsletter-form button {
    height: 45px;
    width: 50px;
    border: none;
    background: var(--primary-color);
    color: var(--white);
    cursor: pointer;
    border-radius: 0 4px 4px 0;
    transition: background 0.3s;
}

.newsletter-form button:hover {
    background: var(--accent-color);
    color: var(--text-dark);
}

.socials a {
    font-size: 1.5rem;
    margin-right: 15px;
    transition: color 0.3s;
}

.socials a:hover {
    color: var(--primary-color);
}

.footer-bottom {
    text-align: center;
    border-top: 1px solid #444;
    padding-top: 20px;
}

/* --- Responsive Mobile --- */
@media (max-width: 768px) {
    .nav-links {
        position: absolute;
        right: 0;
        top: 70px;
        height: calc(100vh - 70px);
        background-color: var(--white); /* Fond blanc propre et moderne */
        display: flex;
        flex-direction: column;
        align-items: flex-end;
        justify-content: flex-start; /* Alignement vers le haut */
        padding-top: 50px;
        padding-right: 30px;
        width: 75%;
        transform: translateX(100%); /* Caché par défaut */
        transition: transform 0.3s ease-in-out;
        box-shadow: -5px 0 15px rgba(0,0,0,0.05);
    }
    .nav-links li {
        margin: 20px 0;
        margin-left: 0;
        opacity: 0;
        transform: translateX(20px);
        transition: all 0.4s ease;
    }
    /* Animation d'apparition des liens quand le menu est ouvert */
    .nav-links.nav-active li {
        opacity: 1;
        transform: translateX(0);
        transition-delay: 0.2s;
    }
    /* Force la couleur sombre et une police plus grosse sur mobile */
    .nav-links a, .navbar.transparent .nav-links a {
        color: var(--text-dark);
        font-size: 1.3rem;
        font-weight: 700;
    }
    /* Bouton "Faire un don" sur mobile */
    .nav-links .btn-nav-donate {
        display: inline-block; /* Assure la visibilité et le dimensionnement */
        background-color: var(--primary-color);
        color: var(--white) !important;
        padding: 10px 25px;
        border-radius: 50px;
        margin-top: 10px;
    }
    .nav-links.nav-active {
        transform: translateX(0%); /* Visible */
    }
    .hamburger {
        display: block;
    }
    .hero-content {
        padding: 0 20px; /* Marges sur le texte mobile */
    }
    .hero h1 {
        font-size: 2rem;
    }
    .project-row {
        flex-direction: column;
    }
    /* Optimisation du Bandeau Top Bar sur Mobile (1 ligne) */
    .top-donation-bar {
        font-size: 0.75rem;
        justify-content: center;
    }
    .top-donation-bar span:first-child {
        display: none; /* On cache "Objectif Collecte :" pour gagner de la place */
    }
    .top-donation-bar .progress-container {
        width: 80px; /* Barre plus compacte */
        margin: 0 8px;
    }
}
