/* ==========================================================================
   1. VARIABLES AMÉLIORÉES (Palette plus douce & Élévation)
   ========================================================================== */
:root {
    --primary: #6366f1;
    --primary-soft: rgba(99, 102, 241, 0.1);
    --primary-dark: #4338ca;
    --bg-main: #f8fafc;
    --bg-card: #ffffff;
    --text-main: #1e293b;
    --text-muted: #64748b;
    --border-color: #e2e8f0;
    
    /* Système d'ombres "Soft Layering" */
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.1);
    --shadow-md: 0 10px 25px -5px rgba(0,0,0,0.05), 0 8px 10px -6px rgba(0,0,0,0.05);
    --shadow-lg: 0 20px 25px -5px rgba(0,0,0,0.1);
    
    --radius-lg: 1rem;
    --radius-md: 0.75rem;
    --header-h: 72px;
}

/* ==========================================================================
   2. RESET & GLOBAL (Focus sur la lisibilité)
   ========================================================================== */
*, *::before, *::after {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    background-color: var(--bg-main);
    color: var(--text-main);
    line-height: 1.6;
    padding-top: var(--header-h); /* Pour éviter que le contenu passe sous la nav */
}

/* ==========================================================================
   3. NAVIGATION (Effet Flou & Moderne)
   ========================================================================== */
nav {
    position: fixed;
    top: 0;
    width: 100%;
    height: var(--header-h);
    background: rgba(255, 255, 255, 0.75);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    border-bottom: 1px solid var(--border-color);
    z-index: 1000;
    display: flex;
    align-items: center;
}

nav ul {
    display: flex;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
    width: 100%;
    list-style: none;
    gap: 1.5rem;
}

nav a {
    text-decoration: none;
    color: var(--text-muted);
    font-weight: 500;
    font-size: 0.95rem;
    padding: 0.5rem 1rem;
    border-radius: var(--radius-md);
    transition: all 0.2s ease;
}

nav a:hover {
    color: var(--primary);
    background: var(--primary-soft);
}

/* ==========================================================================
   4. CONTAINERS & CARDS (Style Bento)
   ========================================================================== */
.container, .div, .mid {
    max-width: 900px;
    margin: 2rem auto;
    background: var(--bg-card);
    padding: 2.5rem;
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-md);
    animation: fadeIn 0.5s ease-out;
}

.annonce {
    background: linear-gradient(to right, #eef2ff, #ffffff);
    border-left: 4px solid var(--primary) !important;
    padding: 1.5rem 1rem;
}

/* ==========================================================================
   5. FORMULAIRES (Champs épurés)
   ========================================================================== */
form {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

label {
    display: block;
    font-weight: 600;
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
    color: var(--text-main);
}

input, select, textarea {
    width: 100%;
    padding: 0.8rem 1rem;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    background: #fcfcfd;
    font-size: 1rem;
    transition: all 0.2s border;
}

input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 4px var(--primary-soft);
    background: #fff;
}

/* ==========================================================================
   6. BOUTONS (Effet de profondeur)
   ========================================================================== */
button, .btn, input[type="submit"] {
    background: var(--primary);
    color: white;
    padding: 0.8rem 1.5rem;
    border: none;
    border-radius: var(--radius-md);
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.1s active, background 0.2s;
    display: inline-flex;
    justify-content: center;
    align-items: center;
}

button:hover {
    background: var(--primary-dark);
    box-shadow: var(--shadow-sm);
}

button:active {
    transform: scale(0.98);
}

/* ==========================================================================
   7. ÉLÉMENTS SPÉCIFIQUES (Matchs, Stats)
   ========================================================================== */
.match {
    background: #f8fafc;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 1.5rem;
    margin-bottom: 1rem;
    align-items: center;
    text-align: center;
}

.stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 1rem;
    margin-top: 1rem;
}

.stats p {
    background: #fff;
    padding: 1rem;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
    text-align: center;
}

.stats strong {
    display: block;
    font-size: 1.5rem;
    color: var(--primary);
}

/* Status Badges */
.statuty, .statutn {
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
}

.statuty { background: #dcfce7; color: #166534; border: none; }
.statutn { background: #fee2e2; color: #991b1b; border: none; }

/* ==========================================================================
   8. ANIMATIONS & RESPONSIVE
   ========================================================================== */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

@media (max-width: 768px) {
    .container { margin: 1rem; padding: 1.5rem; }
    nav ul { justify-content: center; padding: 0 1rem; }
    .match { grid-template-columns: 1fr; gap: 1rem; }
}

/* ==========================================================================
   SECTION COMMENTAIRES
   ========================================================================== */

.commentaire-section {
    margin-top: 2rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border-color);
}

.commentaire-section h4 {
    font-size: 1.1rem;
    font-weight: 700;
    margin-bottom: 1rem;
    color: var(--text-main);
}

/* Liste des commentaires */
.commentaires-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

/* Commentaire individuel */
.commentaire-item {
    background: #ffffff;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 1rem 1.25rem;
    box-shadow: var(--shadow-sm);
    position: relative;
    animation: fadeIn 0.3s ease-out;
}

/* Header commentaire */
.commentaire-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
}

.commentaire-header strong {
    font-size: 0.9rem;
    color: var(--text-main);
}

.commentaire-header small {
    font-size: 0.75rem;
    color: var(--text-muted);
}

/* Contenu commentaire */
.commentaire-item p {
    margin: 0;
    font-size: 0.95rem;
    color: var(--text-main);
    line-height: 1.5;
    word-wrap: break-word;
}

/* Bouton suppression (admin) */
.commentaire-item form {
    margin-top: 0.5rem;
    text-align: right;
}

.commentaire-item .btn-link,
.commentaire-item button {
    background: none;
    border: none;
    color: #dc2626;
    font-size: 0.75rem;
    font-weight: 600;
    cursor: pointer;
    padding: 0;
    transition: color 0.2s ease;
}

.commentaire-item button:hover {
    color: #991b1b;
    text-decoration: underline;
}

/* ==========================================================================
   FORMULAIRE AJOUT COMMENTAIRE
   ========================================================================== */

.commentaire-form {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.commentaire-form textarea {
    resize: none;
    min-height: 80px;
    padding: 0.75rem 1rem;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
    font-family: inherit;
    font-size: 0.95rem;
    background: #fcfcfd;
    transition: all 0.2s ease;
}

.commentaire-form textarea::placeholder {
    color: var(--text-muted);
    font-size: 0.85rem;
}

.commentaire-form textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 4px var(--primary-soft);
    background: #fff;
}

/* Bouton envoyer */
.commentaire-form button {
    align-self: flex-end;
    background: var(--primary);
    color: white;
    padding: 0.6rem 1.25rem;
    border-radius: var(--radius-md);
    font-size: 0.85rem;
    font-weight: 600;
    transition: background 0.2s ease, transform 0.1s ease;
}

.commentaire-form button:hover {
    background: var(--primary-dark);
}

.commentaire-form button:active {
    transform: scale(0.97);
}

/* ==========================================================================
   RESPONSIVE
   ========================================================================== */

@media (max-width: 768px) {
    .commentaire-item {
        padding: 1rem;
    }

    .commentaire-form button {
        width: 100%;
        align-self: stretch;
    }
}
