/* --- 1. STRUCTURE GÉNÉRALE --- */
html, body { height: 100%; margin: 0; }
body {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    font-family: 'Georgia', serif;
    background-color: #000;
}
body::before {
    content: "";
    position: fixed;
    inset: 0;
    background: url("images/arrière plan.png") center/cover no-repeat;
    opacity: 0.6;
    z-index: -1;
}
main { flex: 1; position: relative; z-index: 1; }

/* --- 2. NAVIGATION ET PIED DE PAGE --- */
header, footer { background-color: #66051d; color: #ffffff; padding: 20px 0; text-align: center; }
nav ul { list-style: none; padding: 0; display: flex; justify-content: center; gap: 30px; }
nav a { color: #ffffff; text-decoration: none; font-weight: bold; }

/* --- 3. CONTENEURS DE TEXTE ET TITRES --- */
.hero, .intro-text {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 60px 20px; /* Padding équilibré pour toutes les pages */
}

.hero h1, .hero h2, .intro-text h1, .intro-text h2,
.hero p, .intro-text p, .intro-text label, .intro-text span {
    color: #ffffff !important;
    text-shadow: 2px 2px 8px rgba(0, 0, 0, 0.9);
    text-align: center;
    margin: 10px 0;
}

/* Ajustements précis des textes pour éviter les vides */
.hero h2, .intro-text h2 { margin-top: 0; margin-bottom: 5px; }
.hero p, .intro-text p { margin-top: 5px; margin-bottom: 20px; font-size: 1.1rem; }

/* --- 4. BOUTONS --- */
.btn {
    display: inline-block;
    padding: 12px 30px;
    background-color: #66051d;
    color: #ffffff;
    text-decoration: none;
    font-weight: bold;
    border-radius: 5px;
    transition: all 0.3s ease;
    border: 2px solid #66051d;
}

.btn:hover { background-color: #8a0726; border-color: #ffffff; transform: translateY(-2px); }

.container-bouton-ligne { display: flex; gap: 20px; margin-top: 20px; }

/* --- STYLE SPÉCIFIQUE BOUTONS RETOUR À L'ACCUEIL (TRANSPARENT) --- */
.container-bouton-ligne a[href="index.php"],
.btn-group a[href="index.php"],
.btn-group a[href="../index.php"] {
    background-color: transparent !important;
    border: 2px solid #ffffff !important;
}

.container-bouton-ligne a[href="index.php"]:hover,
.btn-group a[href="index.php"]:hover,
.btn-group a[href="../index.php"]:hover {
    background-color: rgba(255, 255, 255, 0.2) !important;
}
/* --- 5. FORMULAIRES ET TABLEAUX --- */
.form-recherche {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
    max-width: 450px;
    margin: 0 auto;
}

input[type="text"], input[type="number"] {
    width: 100%;
    max-width: 300px;
    height: 40px;
    padding: 10px;
    margin-bottom: 10px;
    border: 2px solid #66051d;
    border-radius: 8px;
    background-color: rgba(255, 255, 255, 0.9);
    text-align: center;
}

.tableau-vins {
    width: 95%;
    max-width: 900px;
    margin: 20px auto;
    border-collapse: collapse;
    background-color: #fff;
    color: #333;
    box-shadow: 0 10px 30px rgba(0,0,0,0.5);
}

.tableau-vins th, .tableau-vins td { border: 1px solid #66051d; padding: 12px; text-align: center; }
.tableau-vins th { background-color: #66051d; color: white; }
.tableau-vins td a { color: #66051d; font-weight: bold; }

/* --- 6. CATALOGUE (CARTES) --- */
.liste-vins { display: flex; flex-wrap: wrap; justify-content: center; gap: 30px; padding: 20px; }
.carte { background-color: #fff; border-radius: 15px; width: 280px; padding: 20px; text-align: center; }
.carte img { width: 100%; height: 250px; object-fit: contain; }
.carte h3 { color: #66051d; margin-bottom: 10px; }
.carte p { color: #333 !important; text-shadow: none !important; margin: 5px 0; }

/* --- 7. RESPONSIVE --- */
@media (max-width: 576px) {
    .btn-group { flex-direction: column; }
    .btn { width: 100%; max-width: 300px; }
    .tableau-vins { font-size: 0.8rem; }
}

/* --- 5. STYLES POUR L'ADMINISTRATION (Gestion des Vins) --- */

/* Force le texte en blanc dans les sections d'administration */
.intro-text h1, .intro-text h2, .intro-text p, .intro-text {
    color: #ffffff;
}

/* Style du tableau de gestion */
.tableau-admin {
    width: 95%;
    max-width: 1000px;
    margin: 30px auto;
    border-collapse: collapse;
    background-color: rgba(0, 0, 0, 0.7); /* Fond noir semi-transparent */
    color: #ffffff;
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.8);
    border: 1px solid #66051d;
}

.tableau-admin thead {
    background-color: #66051d; /* Rouge bordeaux comme ton header */
}

.tableau-admin th, .tableau-admin td {
    padding: 15px;
    border: 1px solid #66051d;
    text-align: center;
}

.tableau-admin tr:hover {
    background-color: rgba(102, 5, 29, 0.3); /* Effet au survol des lignes */
}

/* Style des liens d'actions (Modifier / Supprimer) */
.tableau-admin a {
    color: #ffcc00; /* Jaune/Or pour bien ressortir */
    text-decoration: none;
    font-weight: bold;
    transition: 0.3s;
}

.tableau-admin a:hover {
    color: #ffffff;
    text-shadow: 0 0 5px #ffcc00;
}


/* --- STYLE POUR LE MENU ADMIN --- */

.btn-group {
    display: flex;
    flex-direction: column; /* Aligne les éléments verticalement */
    align-items: center;    /* Centre les boutons horizontalement */
    gap: 20px;             /* Ajoute un espace entre chaque bouton */
    margin-top: 20px;
}

.btn-group .btn {
    width: 100%;           /* Les boutons prendront la même largeur */
    max-width: 300px;      /* On limite la largeur pour que ce soit joli */
    text-align: center;    /* Centre le texte à l'intérieur du bouton */
}

/* Style pour le texte descriptif de l'admin */
.admin-description {
    color: #ffffff;
    max-width: 700px;      /* Plus large que les boutons pour être lisible */
    margin: 30px auto;    /* 30px d'espace en haut/bas et centré horizontalement */
    line-height: 1.6;      /* Espace entre les lignes pour le confort de lecture */
    text-align: center;
    font-style: italic;    /* Optionnel : pour le différencier du reste */
}

/* On s'assure que si le texte est dans une section intro-text, il reste blanc */
.intro-text .admin-description {
    color: #ffffff !important;
}
/* --- AJUSTEMENT POUR ALIGNER EN BAS --- */

.admin-container {
    min-height: 70vh; /* Donne une hauteur minimale à la section */
    display: flex;
    flex-direction: column;
}

.admin-footer-content {
    margin-top: auto; /* C'est LA ligne magique qui pousse tout vers le bas */
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding-bottom: 20px; /* Petit espace avant le vrai footer du site */
}
/* Cette règle rend transparent TOUS les boutons qui pointent vers l'accueil */
.container-bouton-ligne a[href="index.php"],
.container-bouton-ligne a[href="../index.php"],
.btn-group a[href="index.php"],
.btn-group a[href="../index.php"] {
    background-color: transparent !important;
    border: 2px solid #ffffff !important;
    color: #ffffff !important;
}

/* On garde le survol propre */
.container-bouton-ligne a[href="../index.php"]:hover,
.btn-group a[href="../index.php"]:hover {
    background-color: rgba(255, 255, 255, 0.15) !important;
}

.btn-center {
    display: block;
    margin: 20px auto;
    width: fit-content;
}
/* --- Ajustement des champs de saisie --- */
.form-gestion input, 
.form-gestion select {
    padding: 8px;           /* On réduit le padding (avant c'était sûrement trop gros) */
    font-size: 1rem;        /* On agrandit le texte (16px environ) */
    width: 100%;            /* Pour qu'ils gardent une largeur homogène */
    max-width: 400px;       /* Empêche les cases d'être trop larges sur grand écran */
    margin-bottom: 15px;    /* Espace entre les lignes */
}

/* --- Classe pour centrer le bouton --- */
.btn-center {
    display: block;
    margin: 20px auto !important; /* Force le centrage horizontal */
    width: fit-content;
    font-size: 1.1rem;      /* Un peu plus grand pour la lisibilité */
}