/* ============================================================
   DESIGN SYSTEM (COMPONENTS) - JOLIBUT
   Atomes & Molécules réutilisables
   ============================================================ */

/* --- 1. BOUTONS (.cmp-btn) --- */
.cmp-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 10px 16px;
    font-size: 1rem;
    font-weight: 600;
    border-radius: 8px;
    border: none;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
    gap: 8px;
}
.cmp-btn:active { transform: scale(0.98); }
.cmp-btn--full { width: 100%; }

.cmp-btn--primary { background-color: var(--color-primary); color: #fff; }
.cmp-btn--success { background-color: var(--color-success); color: #fff; }
.cmp-btn--danger  { background-color: var(--color-danger);  color: #fff; }
.cmp-btn--neutral { background-color: #6c757d; color: #fff; }
.cmp-btn--light   { background-color: var(--color-light); color: var(--color-dark); border: 1px solid #ddd; }

/* --- 2. FORMULAIRES (.cmp-form, .cmp-input) --- */
.cmp-form-group { margin-bottom: 1rem; }
.cmp-form-label { display: block; margin-bottom: 0.5rem; font-weight: 600; color: var(--color-dark); font-size: 0.9rem; }

.cmp-input-wrapper {
    position: relative;
    display: flex; align-items: center;
}
.cmp-input {
    width: 100%;
    padding: 12px;
    padding-left: 12px;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    font-size: 1rem;
    transition: border-color 0.2s;
}
.cmp-input.has-icon { padding-left: 40px; }
.cmp-input:focus { border-color: var(--color-primary); outline: none; box-shadow: 0 0 0 3px rgba(13,110,253,0.1); }

.cmp-input-icon {
    position: absolute; left: 10px;
    color: #adb5bd; pointer-events: none;
}

/* Widget Téléphone */
.cmp-phone-widget { position: relative; }
.cmp-phone-group { display: flex; }
.cmp-phone-trigger {
    display: flex; align-items: center; gap: 4px;
    padding: 0 12px;
    background: #f8f9fa; border: 1px solid #dee2e6;
    border-right: none; border-radius: 8px 0 0 8px;
    cursor: pointer; color: var(--color-dark); font-weight: 600;
}
.cmp-phone-input {
    border-radius: 0 8px 8px 0;
    flex-grow: 1;
}

/* --- 3. NAVIGATION TABS (.cmp-tabs) --- */
.cmp-tabs-nav {
    display: flex;
    background: #e9ecef;
    border-radius: 10px;
    padding: 4px;
    margin-bottom: 15px;
}
.cmp-tab-btn { 
    flex: 1; border: none; background: transparent; padding: 8px;
    border-radius: 8px; font-weight: 600; color: #6c757d; font-size: 0.9rem;
    transition: all 0.2s;
}
.cmp-tab-btn.active {
    background: #fff; color: var(--color-primary);
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

/* --- 4. DASHBOARD CARDS (.cmp-dashboard-card) --- */
.cmp-dashboard-card {
    display: flex; flex-direction: column; justify-content: space-between;
    padding: 20px;
    border-radius: 16px;
    text-decoration: none;
    background: #fff;
    box-shadow: 0 4px 12px rgba(0,0,0,0.03);
    border: 1px solid rgba(0,0,0,0.05);
    position: relative; overflow: hidden;
    min-height: 140px;
    transition: transform 0.2s, box-shadow 0.2s;
}
.cmp-dashboard-card:active { transform: scale(0.98); }

.cmp-card-icon { margin-bottom: 15px; position: relative; width: fit-content; }
.cmp-card-icon .material-icons { font-size: 36px; }

/* Variantes couleurs cartes */
.cmp-card--success .cmp-card-icon { color: var(--color-success); }
.cmp-card--warning .cmp-card-icon { color: var(--color-warning); }
.cmp-card--primary .cmp-card-icon { color: var(--color-primary); }
.cmp-card--info .cmp-card-icon    { color: #0dcaf0; }
.cmp-card--neutral .cmp-card-icon { color: #6c757d; }

.cmp-card-title { font-size: 1.1rem; font-weight: 700; color: var(--color-dark); line-height: 1.2; }
.cmp-card-desc { font-size: 0.8rem; color: #95a5a6; margin-top: 5px; display: block; }
.cmp-card-arrow { position: absolute; top: 15px; right: 15px; color: #e9ecef; }
.cmp-card-badge {
    position: absolute; top: -5px; right: -10px;
    background: var(--color-danger); color: white;
    font-size: 0.7rem; font-weight: bold; padding: 2px 6px;
    border-radius: 10px; border: 2px solid #fff;
}

/* --- 5. ITEM LISTS (.cmp-player-card, .cmp-match-card) --- */
.cmp-player-card, .cmp-match-card {
    background: #fff; border-radius: 12px;
    box-shadow: 0 2px 6px rgba(0,0,0,0.03); border: 1px solid #f0f0f0;
    margin-bottom: 12px;
}

/* Player */
.cmp-player-card { padding: 12px; display: flex; align-items: center; }
.cmp-player-avatar {
    width: 40px; height: 40px; 
    /* Utilisation de la couleur primaire ou d'une couleur de repli si la variable n'est pas lue */
    background: var(--color-primary, #006AB3); 
    color: #fff; border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-weight: bold; margin-right: 15px; flex-shrink: 0;
}

.cmp-player-number {
    /* S'assurer que le numéro hérite de la couleur blanche de l'avatar */
    color: inherit; 
    font-weight: bold;
    font-size: 1rem;
}

.cmp-player-info { flex-grow: 1; min-width: 0; }
.cmp-player-name { font-size: 1rem; margin: 0; color: var(--color-dark); font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cmp-player-licence { font-size: 0.8rem; color: #999; }
.cmp-player-actions { display: flex; gap: 5px; }

/* Match */
.cmp-match-card { padding: 12px 16px; position: relative; cursor: pointer; transition: background 0.1s; }
.cmp-match-card:active { background: #fafafa; }
.cmp-match-header {
    display: flex; align-items: center; font-size: 0.85rem; color: #6c757d;
    margin-bottom: 10px; border-bottom: 1px solid #f8f9fa; padding-bottom: 6px;
}
.cmp-match-time { font-weight: 700; color: var(--color-dark); margin-right: 10px; }
.cmp-match-pitch { flex-grow: 1; display: flex; align-items: center; gap: 4px; }
.cmp-match-status { width: 8px; height: 8px; border-radius: 50%; }

.cmp-team-row { display: flex; align-items: center; justify-content: space-between; margin-bottom: 6px; }
.cmp-team-name { flex-grow: 1; font-weight: 600; font-size: 0.95rem; color: #343a40; }
.cmp-team-logo { width: 24px; height: 24px; object-fit: contain; margin: 0 10px; }
.cmp-team-score { width: 30px; text-align: center; font-size: 1.1rem; background: #f8f9fa; border-radius: 6px; }
.cmp-match-action { position: absolute; top: 10px; right: 10px; color: var(--color-primary); opacity: 0.5; }

/* --- 6. UTILS BOUTONS ACTIONS (.btn-icon, .btn-action-stat) --- */
.btn-icon { background: none; border: none; padding: 5px; cursor: pointer; border-radius: 50%; }
.btn-icon:active { background: rgba(0,0,0,0.05); }

/* Boutons stats (Match Modal) */
.btn-action-stat {
    width: 36px; height: 36px; border-radius: 50%; border: 1px solid #ddd;
    display: flex; align-items: center; justify-content: center;
    background: white; color: #ccc; cursor: pointer; transition: all 0.2s;
    font-weight: bold; font-size: 0.9rem; position: relative;
}
.btn-action-stat.active-goal { background: var(--color-success); color: white; border-color: var(--color-success); }
.btn-action-stat.active-yellow { background: var(--color-warning); color: white; border-color: #e0a800; }
.btn-action-stat.active-red { background: var(--color-danger); color: white; border-color: #bd2130; }
.btn-action-stat.active-white { background: #fff; color: #333; border-color: #333; box-shadow: inset 0 0 0 2px #333; }

.goal-badge {
    position: absolute; top: -5px; right: -5px;
    background: var(--color-dark); color: white; font-size: 10px;
    width: 16px; height: 16px; border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
}