@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;600&display=swap');

/* --- 1. BASE & FOND --- */
:root {
    --glass-bg: rgba(255, 255, 255, 0.75); /* Transparence blanche */
    --glass-border: rgba(255, 255, 255, 0.6);
    --glass-shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.1);
    --primary: #7F008A;  /* Bleu nuit élégant */
    --accent: #009ffd;   /* Bleu clair vibrant */
    --text: #1e293b;
    --text-light: #64748b;
    --radius: 16px;
}

* { box-sizing: border-box; }

@font-face {
	font-family: 'Quicksand-VariableFont_wght';
	src: url('../polices/Quicksand-VariableFont_wght.ttf') format('truetype');
	font-weight: normal;
	font-style: normal;
}

body {
    font-family: 'Quicksand-VariableFont_wght';
    margin: 0;
    padding: 0;
    color: var(--text);
    /* Fond dégradé subtil pour faire ressortir l'effet verre */
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    min-height: 100vh;
    padding-bottom: 50px;
    display: flex;
    flex-direction: column;
    align-items: center; /* Centre tout le contenu verticalement */
}

button, input, textarea, select {
    font-family: 'Quicksand-VariableFont_wght';
	display: inline-block;
    padding: 10px 20px;
    border-radius: 30px; /* Boutons pillule */
    text-decoration: none;
    color: black;
    font-size: 0.9rem;
    border: 1px solid rgba(255,255,255,0.2);
    cursor: pointer;
    transition: all 0.3s;
    background: rgba(255,255,255,0.1);
    backdrop-filter: blur(4px);
    margin-right: 5px;
}

/* --- 2. CONTENEUR FLUIDE CENTRÉ --- */
.container {
    width: 90%; /* Largeur fluide par défaut */
    max-width: 1100px; /* Max pour grands écrans */
    margin: 10px auto;
    /* Le conteneur lui-même n'a pas de fond, c'est le contenu qui l'aura */
}

/* --- 3. LE STYLE "GLASS" (Appliqué aux blocs) --- */
/* On cible les éléments qui étaient blancs avant */
header, 
.admin-panel, 
form, 
table, 
.card, 
div[style*="background:white"], /* Force l'override des styles inline */
div[style*="background:#fff"] {
    background: var(--glass-bg) !important;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--glass-border) !important;
    box-shadow: var(--glass-shadow);
    border-radius: var(--radius);
    padding: 30px; /* Espace interne aéré */
    margin-bottom: 25px;
}

/* --- 4. HEADER & NAVIGATION --- */
header {
    width: 90%;
    max-width: 1100px;
    margin-top: 20px;
    padding: 15px 30px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

header h1 {
    font-weight: 300;
    letter-spacing: 0.5px;
    color: var(--primary);
    margin: 0;
}

nav {
    display: flex;
    gap: 15px;
}

/* --- 5. ÉLÉMENTS ÉLÉGANTS --- */

/* Titres */
h2, h3 {
    text-align: center; /* Tout centrer par défaut pour l'élégance */
    color: var(--primary);
    font-weight: 600;
    margin-bottom: 25px;
}

/* Inputs & Forms */
input, select, textarea {
    width: 100%;
    padding: 14px;
    margin-bottom: 20px;
    border: 1px solid rgba(0,0,0,0.1);
    background: rgba(255, 255, 255, 0.5); /* Input légèrement transparent */
    border-radius: 8px;
    font-size: 1rem;
    transition: all 0.3s ease;
}

input:focus, select:focus, textarea:focus {
    outline: none;
    border-color: var(--accent);
    background: #fff;
    box-shadow: 0 0 0 4px rgba(0, 159, 253, 0.1);
}

label {
    margin-left: 5px;
    margin-bottom: 8px;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-light);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Boutons "Pill" shape */
.btn {
    display: inline-block;
    padding: 8px 12px;
    border-radius: 30px; /* Boutons pillule */
    text-decoration: none;
    color: white;
    font-size: 0.9rem;
    border: 1px solid rgba(255,255,255,0.2);
    cursor: pointer;
    transition: all 0.3s;
    background: #7F008A;
    backdrop-filter: blur(4px);
    margin-right: 5px;
}

.btn:hover {
    background: #F7B3FF;
    color: black;
    box-shadow: 0 0 15px rgba(255,255,255,0.5);
}

/* Tableaux Modernes */
table {
    width: 100%;
    border-collapse: separate; /* Nécessaire pour border-radius */
    border-spacing: 0;
    overflow: hidden; /* Coupe les coins */
    padding: 0; /* Reset du padding global pour le tableau */
}

th {
    background: rgba(42, 42, 114, 0.05);
    color: var(--primary);
    padding: 18px;
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.8rem;
    letter-spacing: 1px;
}

td {
    padding: 15px 18px;
    border-bottom: 1px solid rgba(0,0,0,0.05);
}

tr:last-child td { border-bottom: none; }

/* Alertes */
.alert {
    background: rgba(16, 185, 129, 0.1);
    color: #065f46;
    border: 1px solid rgba(16, 185, 129, 0.2);
    border-radius: var(--radius);
    padding: 15px;
    text-align: center;
    margin-bottom: 20px;
}

/* --- 6. ADAPTATION < 900px (Tablette & Mobile) --- */
@media (max-width: 900px) {
    
    /* Le conteneur prend plus de place sur les côtés */
    .container, header {
        width: 95%;
        padding: 5px;
    }

    /* Le header s'empile verticalement */
    header .container {
        flex-direction: column;
        gap: 15px;
        text-align: center;
    }

    nav {
        flex-wrap: wrap;
        justify-content: center;
    }

    /* Les grilles (formulaires côte à côte) passent en 1 colonne */
    div[style*="display:grid"], 
    div[style*="grid-template-columns"] {
        display: flex !important;
        flex-direction: column;
        gap: 0 !important;
    }

    /* TABLEAUX RESPONSIVE : Scroll Horizontal */
    /* On force le tableau à scroller s'il est trop large */
    .table-responsive {
        display: block;
        width: 100%;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
    
    table {
        min-width: 600px; /* Force une largeur min pour ne pas écraser le contenu */
    }

    /* Boutons pleine largeur sur mobile pour faciliter le clic */
    .btn {
        margin-bottom: 5px;
    }
}