/* ==========================================================================
   MeeDoo Website Stylesheet
   ========================================================================== */

/* --- 1. CSS VARIABLES & GLOBAL SETUP --- */
:root {
    --font-family-sans: 'Montserrat', sans-serif;
    --font-family-serif: 'Playfair Display', serif;
    --container-width: 1200px;

    /* --- Light Theme (Default) --- */
    --primary-color: #0042AB;
    --accent-color: #6C7EE1;
    --text-color: #212529;
    --text-color-light: #6C757D;
    --bg-color: #FFFFFF;
    --card-bg: #FFFFFF;
    --border-color: #E9ECEF;
    --light-bg: #F8F9FA;
    --header-bg: rgba(255, 255, 255, 0.95);
}

/* --- Dark Theme (Automatic) --- */
@media (prefers-color-scheme: dark) {
    :root {
        --primary-color: #A5B4FC;
        --accent-color: #C4B5FD;
        --text-color: #E9ECEF;
        --text-color-light: #ADB5BD;
        --bg-color: #000000;
        --card-bg: #161B22;
        --border-color: #30363D;
        --light-bg: #161B22;
        --header-bg: rgba(0, 0, 0, 0.8);
    }
}

/* --- 2. RESET & BASE STYLES --- */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-family-sans);
    line-height: 1.7;
    color: var(--text-color);
    background-color: var(--bg-color);
    transition: background-color 0.3s ease, color 0.3s ease;
}

.container {
    width: 90%;
    max-width: var(--container-width);
    margin: 0 auto;
    padding: 0 20px;
}

/* --- 3. TYPOGRAPHY --- */
h1, h2, h3 {
    font-family: var(--font-family-serif);
    font-weight: 700;
    line-height: 1.2;
    color: var(--text-color);
}

h1 { font-size: 2.8rem; }
h2 { font-size: 2.5rem; text-align: center; margin-bottom: 3rem; }
h3 { font-size: 1.8rem; }

p { margin-bottom: 1rem; color: var(--text-color-light); }

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

a:hover { color: var(--accent-color); }

/* --- 4. COMPONENTS --- */

/* Buttons */
.btn {
    display: inline-block;
    padding: 12px 32px;
    border-radius: 8px;
    font-weight: 600;
    font-family: var(--font-family-sans);
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    border: 1px solid var(--text-color);
    font-size: 1rem;
    background-color: transparent;
    color: var(--text-color);
}

.btn-primary { border-color: var(--primary-color); color: var(--primary-color); }
.btn-primary:hover { background-color: var(--primary-color); color: var(--bg-color); transform: translateY(-2px); }
.btn-secondary { border-color: var(--text-color); color: var(--text-color); }
.btn-secondary:hover { background-color: var(--text-color); color: var(--bg-color); }
.btn-outline { border-color: var(--primary-color); color: var(--primary-color); }
.btn-outline:hover { background-color: var(--primary-color); color: var(--bg-color); }

.btn-large { padding: 15px 36px; font-size: 1.1rem; }
.btn-block { display: block; width: 100%; }

/* Grids */
.grid {
    display: grid;
    gap: 2rem;
    grid-template-columns: 1fr; /* Mobile-first default */
}

/* Cards */
.card {
    background-color: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 2.5rem;
    text-align: center;
    transition: all 0.4s ease;
    display: flex;
    flex-direction: column;
}

.card:hover {
    transform: translateY(-8px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
}


/* --- 5. LAYOUT & SECTIONS --- */

/* Header */
.header {
    padding: 1rem 0;
    position: fixed;
    width: 100%;
    top: 0;
    background-color: var(--header-bg);
    backdrop-filter: blur(15px);
    z-index: 1000;
    border-bottom: 1px solid var(--border-color);
}

.header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-family: var(--font-family-serif);
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--text-color);
}

.nav ul {
    list-style: none;
    display: none;
    align-items: center;
    gap: 1.5rem;
}

.nav a { color: var(--text-color); font-weight: 500; }
.nav a:hover { color: var(--primary-color); }

.mobile-menu-toggle {
    display: block;
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--text-color);
}

/* Hero Section */
.hero {
    padding: 100px 0 80px;
    text-align: center;
    background: linear-gradient(135deg, var(--bg-color) 0%, var(--light-bg) 100%);
}

.hero h1 { max-width: 800px; margin: 0 auto 1.5rem; }
.hero .subtitle { max-width: 600px; margin: 0 auto 2.5rem; font-size: 1.1rem; }
.cta-group { display: flex; gap: 1rem; justify-content: center; flex-wrap: wrap; }

/* Generic Section */
.section { padding: 80px 0; }

/* Services Section */
.services-section .grid {
    align-items: stretch; /* Make all cards same height */
}
.services-section .card h3 { font-size: 1.5rem; margin-bottom: 1rem; color: var(--primary-color); }
.services-section .card p { flex-grow: 1; margin-bottom: 1.5rem; }

/* --- 6. PRICING SECTION (GRILLE 3x3) --- */
.pricing-section {
    padding: 100px 0;
}

.pricing-grid {
    max-width: 1200px;
    margin: 0 auto;
    /* Grid layout is defined in the responsive section */
}

.pricing-card {
    border-radius: 16px;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    position: relative; /* For the badge positioning */
}

.pricing-card:hover {
    transform: translateY(-12px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
    border-color: var(--primary-color);
}

/* Featured Card */
.pricing-card.featured {
    border: 2px solid var(--primary-color);
    transform: scale(1.05);
    box-shadow: 0 15px 35px rgba(0, 82, 212, 0.3);
}
.pricing-card.featured:hover {
    transform: scale(1.05) translateY(-12px);
}

.badge {
    position: absolute;
    top: -15px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--primary-color);
    color: var(--bg-color);
    padding: 6px 20px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 1px;
    text-transform: uppercase;
}

/* Pricing Card Content */
.pricing-card-header {
    margin-bottom: 1.5rem;
}

.pricing-card h3 {
    font-family: var(--font-family-sans);
    font-size: 1.5rem;
    font-weight: 600;
    margin: 0 0 0.5rem;
    color: var(--text-color);
}

.pricing-card .price {
    font-size: 3.5rem;
    font-weight: 700;
    color: var(--primary-color);
    line-height: 1;
    margin: 1rem 0;
}

.pricing-card .price span {
    font-size: 1rem;
    font-weight: 400;
    color: var(--text-color-light);
}

.pricing-card p {
    color: var(--text-color-light);
    font-size: 0.95rem;
    margin-bottom: 2rem;
    flex-grow: 1;
}

.pricing-card ul {
    list-style: none;
    text-align: left;
    margin: 0;
    padding: 0;
    flex-grow: 1;
}

.pricing-card li {
    position: relative;
    padding-left: 30px;
    margin-bottom: 1.2rem;
    color: var(--text-color-light);
    font-size: 0.95rem;
}

.pricing-card li::before {
    content: '✔';
    position: absolute;
    left: 0;
    color: var(--primary-color);
    font-weight: bold;
}

.pricing-card li.negative::before {
    content: '✖';
    color: var(--text-color-light);
}

.pricing-card .btn {
    margin-top: auto;
    width: 100%;
}

/* ==========================================================================
   STYLES POUR LA SECTION "GREEN TECH" (PRICING)
   ========================================================================== */

/* --- Bloc Comparatif "Edge AI vs Cloud AI" --- */
.comparison-block {
    text-align: center;
    margin-bottom: 4rem;
    padding: 2.5rem;
    background-color: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 16px;
}
.comparison-block h3 {
    color: var(--text-color);
    font-family: var(--font-family-serif);
    font-size: 1.8rem;
}
.comparison-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
    margin-top: 2rem;
}
.comparison-item {
    padding: 1.5rem;
    border-radius: 8px;
    border: 1px solid var(--border-color);
    text-align: left;
    background-color: var(--card-bg);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}
.comparison-item:hover {
    transform: translateY(-4px);
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
}
.comparison-item.highlight {
    border-color: var(--primary-color);
    background-color: var(--light-bg);
}
.comparison-item h4 {
    margin-bottom: 1rem;
    color: var(--text-color);
    font-family: var(--font-family-sans);
    font-weight: 600;
}
.comparison-item ul {
    list-style: none;
    padding-left: 0;
}
.comparison-item ul li::before {
    content: '–';
    color: var(--text-color-light);
    margin-right: 0.5rem;
}
.comparison-item strong {
    color: var(--primary-color);
    font-weight: 600;
}

/* --- Styles pour la FAQ dans la section tarifs --- */
.pricing-faq {
    margin-top: 4rem;
    text-align: center;
}
.pricing-faq h3 {
    font-size: 2rem;
    margin-bottom: 2rem;
    color: var(--text-color);
    font-family: var(--font-family-serif);
}
.pricing-faq .faq-list {
    max-width: 800px;
    margin: 0 auto;
    text-align: left;
}
.pricing-faq .faq-list details {
    background-color: var(--card-bg);
    border: 1px solid var(--border-color);
    padding: 1.5rem;
    margin-bottom: 1rem;
    border-radius: 8px;
    cursor: pointer;
}
.pricing-faq .faq-list summary {
    font-weight: 600;
    color: var(--primary-color);
    font-size: 1.1rem;
    padding-right: 30px; /* Espace pour le '+' '-' */
    list-style: none; /* Cache la flèche par défaut */
    position: relative;
    transition: color 0.3s ease;
}
.pricing-faq .faq-list summary::after {
    content: '+';
    position: absolute;
    right: 0;
    top: 50%;
    transform: translateY(-50%);
    color: var(--primary-color);
    font-size: 1.5rem;
    transition: transform 0.2s ease;
}
.pricing-faq .faq-list details[open] summary::after {
    content: '−';
    transform: translateY(-50%) rotate(180deg); /* Tourne le signe pour l'effet */
}
.pricing-faq .faq-list p {
    padding-top: 1rem;
    color: var(--text-color-light);
    line-height: 1.7;
}

/* --- Responsive pour les nouveaux éléments --- */
@media (max-width: 768px) {
    .comparison-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
    .comparison-block {
        padding: 1.5rem;
    }
}

/* --- 7. FAQ & FOOTER --- */
.faq-list { max-width: 800px; margin: 0 auto; }
.faq-list details {
    margin-bottom: 1.5rem;
    padding: 1.5rem;
    background-color: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    cursor: pointer;
}
.faq-list summary {
    font-weight: 600;
    font-size: 1.2rem;
    color: var(--text-color);
    list-style: none;
    position: relative;
    padding-right: 30px;
}
.faq-list summary::after {
    content: '+';
    position: absolute;
    right: 0;
    top: 50%;
    transform: translateY(-50%);
    font-size: 1.5rem;
    color: var(--primary-color);
}
.faq-list details[open] summary::after { content: '-'; }
.faq-list p { padding-top: 1rem; }

.footer {
    font-family: var(--font-family-sans);
    padding: 60px 0 40px;
    background-color: var(--bg-color);
    border-top: 1px solid var(--border-color);
    color: var(--text-color);
}
.footer-content {
    display: grid;
    grid-template-columns: 1fr;
    gap: 3rem;
    margin-bottom: 3rem;
    text-align: center;
}
.footer-logo { margin-bottom: 2rem; }
.footer-logo h2 { font-family: var(--font-family-serif); font-size: 2rem; margin-bottom: 0.5rem; }
.footer-logo p { color: var(--text-color-light); }
.footer-links {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 2rem;
}
.footer-links h4 { color: var(--text-color); margin-bottom: 1rem; font-size: 1rem; font-weight: 600; }
.footer-links ul { list-style: none; }
.footer-links a { color: var(--text-color-light); display: block; margin-bottom: 0.5rem; }
.footer-links a:hover { color: var(--primary-color); }
.footer-bottom {
    text-align: center;
    padding-top: 2rem;
    border-top: 1px solid var(--border-color);
    font-size: 0.9rem;
    color: var(--text-color-light);
}
.footer-legal {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 1.5rem;
    margin-top: 1rem;
}
.footer-legal a { color: var(--text-color-light); font-size: 0.9rem; }
.footer-legal a:hover { color: var(--primary-color); }


/* --- 8. RESPONSIVE DESIGN (GRILLE 3x3 FORCÉE) --- */
@media (min-width: 768px) {
    h1 { font-size: 3.5rem; }
    h2 { font-size: 2.8rem; }
    .nav ul { display: flex; }
    .mobile-menu-toggle { display: none; }
    .grid { grid-template-columns: repeat(2, 1fr); }
    .footer-content {
        grid-template-columns: 1fr 2fr;
        text-align: left;
    }
    .footer-logo { text-align: left; margin-bottom: 0; }
    .footer-links { grid-template-columns: repeat(3, 1fr); }
}

/* --- CORRECTION POUR LE DESKTOP : GRILLE 3x2 IMPOSÉE --- */
@media (min-width: 1024px) {

    /* Grille de services sur 4 colonnes */
    .services-section .grid { grid-template-columns: repeat(4, 1fr); }

    /* GRILLE DE TARIFICATION FORCÉE : 3 en haut, 2 en bas */
    .pricing-grid {
        grid-template-columns: repeat(3, 1fr); /* 3 colonnes */
        grid-template-rows: auto auto;      /* 2 lignes */
    }

    /* Positionnement des 5 cartes dans la grille 3x2 */
    .pricing-card:nth-child(1) { grid-column: 1; grid-row: 1; }
    .pricing-card:nth-child(2) { grid-column: 2; grid-row: 1; }
    .pricing-card:nth-child(3) { grid-column: 3; grid-row: 1; }
    .pricing-card:nth-child(4) { grid-column: 1; grid-row: 2; }
    
    /* La 5ème carte (Enterprise) prend les 2 dernières cellules */
    .pricing-card:nth-child(5) {
        grid-column: 2 / 4; /* S'étend de la colonne 2 à la 4 */
        grid-row: 2;
    }
    
    /* Ajustement cosmétique pour la carte étendue */
    .pricing-card:nth-child(5) .pricing-card-header {
        display: flex;
        flex-direction: column;
        justify-content: center;
    }
}
