/**
 * Feuille de style principale pour le site abcdemontration. (Version 3 - Complète)
 *
 * Inclus tous les styles : base, navigation, formulaires, responsivité
 * et la version finale des styles pour le Chat en Direct.
 *
 * Palette de couleurs :
 * - Fond principal : #121212 (Presque noir)
 * - Fond secondaire : #1E1E1E (Gris très foncé)
 * - Texte principal : #E0E0E0 (Gris clair)
 * - Couleur d'accentuation (primaire) : #007BFF (Bleu)
 */

/* === Variables CSS (Custom Properties) === */
:root {
    --primary-color: #007BFF;
    --background-color: #121212;
    --surface-color: #1E1E1E;
    --text-color: #E0E0E0;
    --text-color-muted: #888;
    --error-color: #cf6679;
    --success-color: #69f0ae;
    --header-height: 80px;
}

/* === Réinitialisation et styles de base === */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Poppins', sans-serif;
    background-color: var(--background-color);
    color: var(--text-color);
    line-height: 1.6;
    background-image: 
        linear-gradient(rgba(255, 255, 255, 0.02) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.02) 1px, transparent 1px);
    background-size: 30px 30px;
}

a {
    color: var(--primary-color);
    text-decoration: none;
}

h1, h2, h3 {
    font-weight: 500;
}

main {
    padding-top: var(--header-height);
}

/* === Barre de Navigation === */
.main-header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 1000;
    transition: background-color 0.3s ease, padding 0.3s ease;
}

.navbar {
	background-color: rgba(30, 30, 30, 0.95);
  	backdrop-filter: blur(10px);
 	box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
    height: var(--header-height);
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 0 2rem;
    transition: all 0.3s ease-in-out;
}

.navbar-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    max-width: 1200px;
}

.navbar-logo {
    color: #fff;
    font-size: 1.8rem;
    font-weight: 700;
}

.nav-menu {
    display: flex;
    align-items: center;
    list-style: none;
}

.nav-item {
    margin-left: 2rem;
}

.nav-link {
    color: var(--text-color);
    font-size: 1rem;
    font-weight: 400;
    padding: 0.5rem 0;
    border-bottom: 2px solid transparent;
    transition: color 0.3s ease, border-color 0.3s ease;
}

.nav-link:hover {
    color: var(--primary-color);
    border-bottom-color: var(--primary-color);
}

.nav-link.admin-link {
    color: #ffc107;
}

.main-header.scrolled .navbar {
    height: 60px;
    background-color: rgba(30, 30, 30, 0.95);
    backdrop-filter: blur(10px);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
}

/* === Boutons === */
.button-primary {
    display: inline-block;
    background-color: var(--primary-color);
    color: #fff;
    padding: 10px 25px;
    border: none;
    border-radius: 5px;
    font-weight: 500;
    cursor: pointer;
    text-align: center;
    transition: background-color 0.3s ease, transform 0.2s ease;
}

.button-primary:hover {
    background-color: #0056b3;
    transform: translateY(-2px);
}

/* === Section "Héros" (Accueil) === */
.hero-section {
    display: flex;
    justify-content: center;
    align-items: center;
    text-align: center;
    min-height: calc(100vh - var(--header-height));
    padding: 0 2rem;
}

.hero-title {
    font-size: 3.5rem;
    font-weight: 700;
    margin-bottom: 1rem;
    line-height: 1.2;
}

.hero-subtitle {
    font-size: 1.2rem;
    max-width: 600px;
    margin: 0 auto 2rem auto;
    color: var(--text-color-muted);
}

.hero-button {
    font-size: 1.1rem;
    padding: 15px 35px;
}

/* === Section "Features" (Accueil) === */
.features-section {
    padding: 60px 2rem;
    background-color: var(--surface-color);
}

.features-container {
    display: flex;
    justify-content: space-around;
    gap: 2rem;
    max-width: 1200px;
    margin: 0 auto;
}

.feature-item {
    text-align: center;
    flex-basis: 30%;
    padding: 2rem;
}

.feature-item h3 {
    font-size: 1.5rem;
    color: var(--primary-color);
    margin-bottom: 1rem;
}

/* === Formulaires === */
.form-page-container {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 4rem 2rem;
}

.form-wrapper {
    width: 100%;
    max-width: 450px;
    background-color: var(--surface-color);
    padding: 2.5rem;
    border-radius: 8px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

.form-title {
    text-align: center;
    margin-bottom: 2rem;
    font-size: 2rem;
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    color: var(--text-color-muted);
    font-size: 0.9rem;
}

.form-input {
    width: 100%;
    padding: 12px 15px;
    background-color: var(--background-color);
    border: 1px solid #444;
    border-radius: 5px;
    color: var(--text-color);
    font-size: 1rem;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.form-input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(0, 123, 255, 0.25);
}

.form-button {
    width: 100%;
    padding: 15px;
    font-size: 1.1rem;
}

.form-errors, .form-success {
    padding: 1rem;
    margin-bottom: 1.5rem;
    border-radius: 5px;
    border-left: 4px solid;
}

.form-errors {
    background-color: rgba(207, 102, 121, 0.1);
    border-color: var(--error-color);
    color: var(--error-color);
}

.form-success {
    background-color: rgba(105, 240, 174, 0.1);
    border-color: var(--success-color);
    color: var(--success-color);
}

.form-switch, .form-helper-link {
    text-align: center;
    margin-top: 1.5rem;
    font-size: 0.9rem;
}

/* === Pied de Page (Footer) === */
.main-footer {
    background-color: var(--surface-color);
    padding: 2rem;
    text-align: center;
    border-top: 1px solid #2a2a2a;
}

.footer-container p {
    margin-bottom: 0.5rem;
}

.footer-container a:hover {
    text-decoration: underline;
}

/* === Chat en Direct === */
#chat-bubble {
    position: fixed;
    bottom: 25px;
    right: 25px;
    width: 60px;
    height: 60px;
    background-color: var(--primary-color);
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    box-shadow: 0 5px 15px rgba(0,0,0,0.3);
    z-index: 1000;
    transition: transform 0.2s ease;
}
#chat-bubble:hover {
    transform: scale(1.1);
}
#chat-notification-badge {
    position: absolute;
    top: 0;
    right: 0;
    width: 15px;
    height: 15px;
    background-color: #dc3545;
    border-radius: 50%;
    border: 2px solid var(--primary-color);
}
#chat-window {
    position: fixed;
    bottom: 100px;
    right: 25px;
    width: 350px;
    max-width: 90vw;
    height: 500px;
    max-height: 70vh;
    background-color: var(--surface-color);
    border-radius: 10px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.4);
    z-index: 1000;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transition: opacity 0.3s ease, transform 0.3s ease;
}
#chat-window.hidden {
    opacity: 0;
    transform: translateY(20px);
    pointer-events: none;
}
#chat-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem;
    background-color: #2a2a2a;
}
#chat-header h3 { margin: 0; font-size: 1.1rem; }
#close-chat-btn { background: none; border: none; color: #fff; font-size: 2rem; cursor: pointer; }
#chat-messages { 
    flex-grow: 1; 
    padding: 1rem; 
    overflow-y: auto; 
    display: flex;
    flex-direction: column;
}
.chat-message { 
    max-width: 80%; 
    width: fit-content; 
    padding: 0.5rem 1rem; 
    border-radius: 18px; 
    margin-bottom: 0.75rem; 
}
.chat-message p { margin: 0; }
.sender-user { 
    background-color: var(--primary-color); 
    color: #fff; 
    align-self: flex-end;
    border-bottom-right-radius: 4px; 
}
.sender-admin, .sender-bot { 
    background-color: #333; 
    align-self: flex-start;
    border-bottom-left-radius: 4px; 
}
#chat-form { display: flex; padding: 1rem; border-top: 1px solid #333; }
#chat-input { flex-grow: 1; background-color: #333; border: 1px solid #555; border-radius: 5px; color: #fff; padding: 0.75rem; }
#chat-form button { background-color: var(--primary-color); border: none; color: #fff; border-radius: 5px; padding: 0.75rem 1rem; margin-left: 0.5rem; cursor: pointer; }

/* === Menu Hamburger (pour mobile) === */
.hamburger {
    display: none;
    cursor: pointer;
}

.hamburger span {
    display: block;
    width: 25px;
    height: 3px;
    margin: 5px auto;
    background-color: #fff;
    transition: all 0.3s ease-in-out;
}

/* === Responsivité (Media Queries) === */
@media (max-width: 768px) {
    .nav-menu {
        display: none;
        flex-direction: column;
        width: 100%;
        position: absolute;
        top: var(--header-height);
        left: -100%;
        background-color: var(--surface-color);
        transition: left 0.3s ease-in-out;
        padding: 1rem 0;
    }
    .nav-menu.active {
        display: flex;
        left: 0;
    }
    .nav-item {
        margin: 0;
        width: 100%;
        text-align: center;
    }
    .nav-link {
        display: block;
        padding: 1.5rem 0;
        border-bottom: 1px solid #333;
    }
    .nav-link:hover {
        border-bottom-color: #333;
        background-color: rgba(0, 123, 255, 0.1);
    }
    .hamburger {
        display: block;
    }
    .hamburger.active span:nth-child(1) {
        transform: translateY(8px) rotate(45deg);
    }
    .hamburger.active span:nth-child(2) {
        opacity: 0;
    }
    .hamburger.active span:nth-child(3) {
        transform: translateY(-8px) rotate(-45deg);
    }
    .hero-title {
        font-size: 2.5rem;
    }
    .hero-subtitle {
        font-size: 1rem;
    }
    .features-container {
        flex-direction: column;
        align-items: center;
    }
}