/* ============================================
   RUGBY CLUB - STYLESHEET
   ============================================ */

:root {
    --vert:      #1a472a;
    --vert-clair:#2d6a4f;
    --vert-dark: #0d2b1a;
    --or:        #c9a84c;
    --or-clair:  #e8c97a;
    --blanc:     #f5f5f0;
    --gris:      #e8e8e2;
    --gris-dark: #3a3a3a;
    --rouge:     #c0392b;
    --bleu:      #2980b9;
    --text:      #1a1a1a;
    --shadow:    0 4px 20px rgba(0,0,0,0.12);
    --radius:    10px;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
    font-family: 'Barlow', sans-serif;
    background: #f0ede8;
    color: var(--text);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* ---- NAVBAR ---- */
.navbar {
    background: var(--vert-dark);
    padding: 0 2rem;
    display: flex;
    align-items: center;
    gap: 2rem;
    height: 64px;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 2px 10px rgba(0,0,0,0.3);
    border-bottom: 3px solid var(--or);
}

.nav-brand {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    text-decoration: none;
    flex-shrink: 0;
}
.nav-logo { font-size: 1.5rem; }
.nav-title {
    font-family: 'Bebas Neue', cursive;
    font-size: 1.4rem;
    color: var(--or);
    letter-spacing: 1px;
    white-space: nowrap;
}

.nav-links {
    display: flex;
    list-style: none;
    gap: 0.3rem;
    flex: 1;
}
.nav-links a {
    color: #ccc;
    text-decoration: none;
    font-size: 0.88rem;
    font-weight: 600;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    padding: 0.4rem 0.8rem;
    border-radius: 6px;
    transition: all 0.2s;
}
.nav-links a:hover, .nav-links a.active {
    color: var(--or);
    background: rgba(201,168,76,0.12);
}

.nav-user {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex-shrink: 0;
}
.user-name { color: #aaa; font-size: 0.85rem; }
.btn-logout {
    background: transparent;
    border: 1px solid #555;
    color: #aaa;
    padding: 0.3rem 0.8rem;
    border-radius: 5px;
    text-decoration: none;
    font-size: 0.8rem;
    transition: all 0.2s;
}
.btn-logout:hover { border-color: var(--rouge); color: var(--rouge); }

.nav-toggle { display: none; background: none; border: none; color: #fff; font-size: 1.4rem; cursor: pointer; }

/* ---- LAYOUT ---- */
.container { max-width: 1200px; margin: 0 auto; padding: 0 1.5rem; }
.main-content { flex: 1; padding: 2rem 1.5rem; max-width: 1200px; margin: 0 auto; width: 100%; }

/* ---- PAGE HEADER ---- */
.page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 3px solid var(--or);
}
.page-title {
    font-family: 'Bebas Neue', cursive;
    font-size: 2.2rem;
    color: var(--vert-dark);
    letter-spacing: 1px;
}
.page-subtitle { color: #666; font-size: 0.9rem; margin-top: 0.2rem; }

/* ---- CARDS ---- */
.card {
    background: #fff;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    overflow: hidden;
}
.card-header {
    background: var(--vert);
    color: #fff;
    padding: 1rem 1.5rem;
    font-family: 'Barlow Condensed', sans-serif;
    font-size: 1.1rem;
    font-weight: 700;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.card-body { padding: 1.5rem; }

/* ---- STATS CARDS ---- */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.2rem;
    margin-bottom: 2rem;
}
.stat-card {
    background: #fff;
    border-radius: var(--radius);
    padding: 1.5rem;
    box-shadow: var(--shadow);
    border-left: 5px solid var(--or);
    display: flex;
    align-items: center;
    gap: 1rem;
}
.stat-icon { font-size: 2rem; }
.stat-value { font-family: 'Bebas Neue', cursive; font-size: 2.2rem; color: var(--vert); line-height: 1; }
.stat-label { font-size: 0.8rem; color: #888; text-transform: uppercase; font-weight: 600; letter-spacing: 0.5px; }

/* ---- TABLES ---- */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 0.92rem; }
thead tr { background: var(--vert); color: #fff; }
thead th {
    padding: 0.85rem 1rem;
    text-align: left;
    font-family: 'Barlow Condensed', sans-serif;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 700;
}
tbody tr { border-bottom: 1px solid var(--gris); transition: background 0.15s; }
tbody tr:hover { background: #f8f7f3; }
tbody td { padding: 0.85rem 1rem; }
tbody tr:last-child { border-bottom: none; }

/* ---- BADGES ---- */
.badge {
    display: inline-block;
    padding: 0.25rem 0.7rem;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.badge-vert    { background: #d4edda; color: #155724; }
.badge-rouge   { background: #f8d7da; color: #721c24; }
.badge-bleu    { background: #d1ecf1; color: #0c5460; }
.badge-or      { background: #fff3cd; color: #856404; }
.badge-gris    { background: #e2e3e5; color: #383d41; }

/* ---- BUTTONS ---- */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.55rem 1.2rem;
    border-radius: 6px;
    font-size: 0.88rem;
    font-weight: 600;
    border: none;
    cursor: pointer;
    text-decoration: none;
    transition: all 0.2s;
    font-family: 'Barlow', sans-serif;
}
.btn-primary   { background: var(--vert); color: #fff; }
.btn-primary:hover { background: var(--vert-clair); }
.btn-or        { background: var(--or); color: var(--vert-dark); }
.btn-or:hover  { background: var(--or-clair); }
.btn-rouge     { background: var(--rouge); color: #fff; }
.btn-rouge:hover { background: #a93226; }
.btn-outline   { background: transparent; border: 2px solid var(--vert); color: var(--vert); }
.btn-outline:hover { background: var(--vert); color: #fff; }
.btn-sm        { padding: 0.3rem 0.7rem; font-size: 0.8rem; }
.btn-group     { display: flex; gap: 0.5rem; flex-wrap: wrap; }

/* ---- FORMS ---- */
.form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 1.2rem; }
.form-group { display: flex; flex-direction: column; gap: 0.4rem; }
.form-group label { font-weight: 600; font-size: 0.88rem; color: var(--gris-dark); text-transform: uppercase; letter-spacing: 0.4px; }
.form-control {
    border: 2px solid var(--gris);
    border-radius: 6px;
    padding: 0.6rem 0.9rem;
    font-size: 0.95rem;
    font-family: 'Barlow', sans-serif;
    transition: border-color 0.2s;
    background: #fff;
}
.form-control:focus { outline: none; border-color: var(--vert); }
.form-actions { display: flex; gap: 1rem; margin-top: 1.5rem; flex-wrap: wrap; }

/* ---- ALERTS ---- */
.alert {
    padding: 1rem 1.2rem;
    border-radius: var(--radius);
    margin-bottom: 1.5rem;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}
.alert-success { background: #d4edda; color: #155724; border-left: 4px solid #28a745; }
.alert-error   { background: #f8d7da; color: #721c24; border-left: 4px solid #dc3545; }
.alert-info    { background: #d1ecf1; color: #0c5460; border-left: 4px solid #17a2b8; }

/* ---- DASHBOARD ---- */
.dashboard-grid { display: grid; grid-template-columns: 2fr 1fr; gap: 1.5rem; }
.prochains-matchs .match-item {
    display: flex;
    align-items: center;
    padding: 1rem 0;
    border-bottom: 1px solid var(--gris);
    gap: 1rem;
}
.match-date { 
    background: var(--vert); color: #fff; 
    border-radius: 8px; padding: 0.4rem 0.7rem;
    text-align: center; min-width: 55px;
    font-family: 'Barlow Condensed', sans-serif;
}
.match-date .day { font-size: 1.4rem; font-weight: 700; line-height: 1; }
.match-date .month { font-size: 0.7rem; text-transform: uppercase; }
.match-info { flex: 1; }
.match-vs { font-weight: 700; color: var(--vert-dark); }
.match-meta { font-size: 0.82rem; color: #888; margin-top: 0.2rem; }

/* ---- FEUILLE DE MATCH ---- */
.feuille-terrain {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    margin-bottom: 1.5rem;
}
.terrain-section { background: #f8f7f3; border-radius: 8px; padding: 1rem; }
.terrain-title { font-family: 'Barlow Condensed', sans-serif; font-weight: 700; font-size: 1rem; text-transform: uppercase; color: var(--vert); margin-bottom: 0.8rem; letter-spacing: 0.5px; border-bottom: 2px solid var(--or); padding-bottom: 0.4rem; }

.joueur-row {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    padding: 0.5rem;
    border-radius: 5px;
    transition: background 0.15s;
}
.joueur-row:hover { background: #ede9e0; }
.joueur-num {
    width: 28px; height: 28px;
    background: var(--vert); color: #fff;
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-size: 0.78rem; font-weight: 700;
    flex-shrink: 0;
}
.joueur-nom { flex: 1; font-weight: 600; font-size: 0.9rem; }
.joueur-poste { font-size: 0.78rem; color: #888; }
.capitaine-badge { font-size: 0.7rem; background: var(--or); color: var(--vert-dark); padding: 0.1rem 0.4rem; border-radius: 3px; font-weight: 700; }

/* ---- SCORE BOARD ---- */
.score-board {
    background: var(--vert-dark);
    color: #fff;
    border-radius: var(--radius);
    padding: 1.5rem;
    text-align: center;
    margin-bottom: 1.5rem;
}
.score-teams { display: flex; align-items: center; justify-content: space-around; gap: 1rem; }
.score-team-name { font-family: 'Barlow Condensed', sans-serif; font-size: 1.1rem; font-weight: 700; text-transform: uppercase; }
.score-numbers { display: flex; align-items: center; gap: 1rem; }
.score-num { font-family: 'Bebas Neue', cursive; font-size: 3.5rem; line-height: 1; color: var(--or); }
.score-sep { font-family: 'Bebas Neue', cursive; font-size: 2.5rem; color: #555; }

/* ---- LOGIN ---- */
.login-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--vert-dark);
    background-image: repeating-linear-gradient(
        45deg,
        transparent,
        transparent 40px,
        rgba(201,168,76,0.04) 40px,
        rgba(201,168,76,0.04) 80px
    );
}
.login-box {
    background: #fff;
    border-radius: 14px;
    padding: 2.5rem;
    width: 100%;
    max-width: 400px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.4);
}
.login-logo { text-align: center; font-size: 3rem; margin-bottom: 0.5rem; }
.login-title { text-align: center; font-family: 'Bebas Neue', cursive; font-size: 1.8rem; color: var(--vert-dark); letter-spacing: 2px; margin-bottom: 0.3rem; }
.login-sub { text-align: center; color: #888; font-size: 0.9rem; margin-bottom: 2rem; }

/* ---- FOOTER ---- */
.footer {
    background: var(--vert-dark);
    color: #666;
    padding: 1rem 2rem;
    font-size: 0.82rem;
    border-top: 2px solid var(--or);
    margin-top: auto;
}
.footer-inner { display: flex; justify-content: space-between; align-items: center; max-width: 1200px; margin: 0 auto; }

/* ---- EMPTY STATE ---- */
.empty-state { text-align: center; padding: 3rem 1rem; color: #aaa; }
.empty-state .icon { font-size: 3rem; margin-bottom: 1rem; }
.empty-state p { font-size: 1rem; }

/* ---- MODAL ---- */
.modal-overlay { display: none; position: fixed; inset: 0; background: rgba(0,0,0,0.5); z-index: 200; align-items: center; justify-content: center; }
.modal-overlay.active { display: flex; }
.modal { background: #fff; border-radius: 12px; width: 90%; max-width: 600px; max-height: 90vh; overflow-y: auto; box-shadow: 0 20px 60px rgba(0,0,0,0.3); }
.modal-header { background: var(--vert); color: #fff; padding: 1rem 1.5rem; display: flex; align-items: center; justify-content: space-between; }
.modal-title { font-family: 'Barlow Condensed', sans-serif; font-size: 1.1rem; font-weight: 700; text-transform: uppercase; }
.modal-close { background: none; border: none; color: #fff; font-size: 1.4rem; cursor: pointer; line-height: 1; }
.modal-body { padding: 1.5rem; }

/* ---- RESPONSIVE ---- */
@media (max-width: 768px) {
    .nav-links { display: none; position: absolute; top: 64px; left: 0; right: 0; background: var(--vert-dark); flex-direction: column; padding: 1rem; gap: 0.3rem; }
    .nav-links.open { display: flex; }
    .nav-toggle { display: block; }
    .nav-user .user-name { display: none; }
    .dashboard-grid { grid-template-columns: 1fr; }
    .feuille-terrain { grid-template-columns: 1fr; }
    .page-header { flex-direction: column; align-items: flex-start; gap: 1rem; }
    .stats-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 480px) {
    .stats-grid { grid-template-columns: 1fr; }
    .main-content { padding: 1rem; }
}

/* ---- PRINT (feuille de match) ---- */
@media print {
    .navbar, .footer, .btn, .no-print { display: none !important; }
    body { background: #fff; }
    .main-content { padding: 0; max-width: 100%; }
    .card { box-shadow: none; border: 1px solid #ccc; }
}
