/* ==========================================
   BETLEITZ - STYLE BETCLIC
   Couleurs: Jaune (#ffcc00), Noir (#1A1A1A), Rouge (#E3000F)
   Mode: CLAIR
   ========================================== */

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

body {
    font-family: 'poppins', 'Helvetica Neue', sans-serif;
    background: #F5F5F5;
    min-height: 100vh;
    padding: 20px;
    color: #1A1A1A;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
}

/* ==========================================
   LOGO PERSO
   ========================================== */
.logo-image {
    height: 60px;
    width: auto;
    vertical-align: middle;
    margin-right: 15px;
}

.logo-image-small {
    height: 35px;
    width: auto;
    vertical-align: middle;
    margin-right: 10px;
}


/* ==========================================
   ICÔNES SVG (navbar mobile)
   ========================================== */
.mobile-icon svg,
.fab-icon svg {
    width: 24px;
    height: 24px;
    display: block;
}

.fab-icon svg {
    width: 28px;
    height: 28px;
}

/* Couleur des SVG par défaut */
.mobile-icon svg {
    fill: #666;
}

.mobile-tab.active .mobile-icon svg {
    fill: #1A1A1A;
}

.fab-icon svg {
    fill: #1A1A1A;
}

/* ==========================================
   CARTE / CARD
   ========================================== */
.card {
    border-radius: 12px;
    padding: 30px;
    margin-bottom: 20px;
}

/* ==========================================
   LOGO ET TITRES
   ========================================== */
.logo {
    text-align: center;
    margin-bottom: 30px;
}

.logo h1 {
    color: #1A1A1A;
    font-size: 3em;
    font-weight: bold;
    margin-bottom: 10px;
}

.logo h1::first-letter {
    color: #E3000F;
}

.tagline {
    color: #666;
    font-size: 1.1em;
    font-style: italic;
}

h1 {
    color: #1A1A1A;
    text-align: center;
    margin-bottom: 30px;
    font-size: 2.5em;
}

h2 {
    color: #1A1A1A;
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 3px solid #ffcc00;
    font-size: 1.6em;
}

h3 {
    color: #1A1A1A;
    margin-top: 30px;
    margin-bottom: 15px;
    font-size: 1.3em;
}

/* ==========================================
   BOUTONS
   ========================================== */
.btn {
    border: none;
    padding: 14px 30px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 16px;
    font-weight: bold;
    transition: all 0.3s ease;
    margin: 5px;
}

.btn-primary {
    background: #ffcc00;
    color: #1A1A1A;
    border: 2px solid #ffcc00;
}

.btn-primary:hover {
    background: #FFDD33;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(255, 211, 0, 0.3);
}

.btn-secondary {
    background: #FFFFFF;
    color: #1A1A1A;
    border: 2px solid #1A1A1A;
}

.btn-secondary:hover {
    background: #1A1A1A;
    color: #FFFFFF;
}

.btn-success {
    background: #00C851;
    color: white;
    border: 2px solid #00C851;
}

.btn-success:hover {
    background: #00E25B;
}

.btn-danger {
    background: #E3000F;
    color: white;
    border: 2px solid #E3000F;
}

.btn-danger:hover {
    background: #FF1122;
}

.btn-small {
    padding: 8px 20px;
    font-size: 14px;
}

.btn-logout {
    background: #666;
    color: white;
    border: 2px solid #666;
}

.btn-logout:hover {
    background: #777;
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* ==========================================
   FORMULAIRES
   ========================================== */
.form-group {
    margin-bottom: 20px;
}

label {
    display: block;
    margin-bottom: 8px;
    color: #1A1A1A;
    font-weight: bold;
    font-size: 14px;
}

input, select, textarea {
    width: 100%;
    padding: 12px;
    margin: 5px 0;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    background: #FFFFFF;
    color: #1A1A1A;
    transition: border-color 0.3s;
    font-family: 'poppins', sans-serif;
}

input:focus, select:focus, textarea:focus {
    outline: none;
}

input::placeholder, textarea::placeholder {
    color: #999;
}

.help-text {
    text-align: center;
    margin-top: 20px;
    color: #666;
}

/* ==========================================
   EN-TÊTE UTILISATEUR
   ========================================== */
.user-header {
    background: linear-gradient(135deg, #ffcc00 0%, #FFC700 100%);
    color: #1A1A1A;
    padding: 20px;
    border-radius: 12px;
    margin-bottom: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 4px 12px rgba(255, 211, 0, 0.2);
    border: 2px solid #E0E0E0;
}

.user-info-left,
.user-info-center,
.user-info-right {
    flex: 1;
}

.user-info-center {
    text-align: center;
}

.user-info-right {
    text-align: right;
}

.site-name {
    font-size: 2em;
    font-weight: bold;
}

.user-name {
    font-size: 1.1em;
    font-weight: 600;
}

.user-points {
    margin-top: 5px;
    font-size: 1.3em;
    font-weight: bold;
}

.user-score {
    font-size: 1.5em;
    font-weight: bold;
    margin-bottom: 10px;
}

.user-info-right {
    text-align: right;
    display: flex;
    align-items: center;
    gap: 15px;
    justify-content: flex-end;
}

.btn-create-pari {
    padding: 12px 24px !important;
    font-size: 16px !important;
    background: #1A1A1A !important;
    color: #FFFFFF !important;
    border: 2px solid #1A1A1A !important;
}

.btn-create-pari:hover {
    background: #2A2A2A !important;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2) !important;
}

.btn-logout-link {
    background: none;
    border: none;
    color: #1A1A1A;
    cursor: pointer;
    font-size: 14px;
    text-decoration: underline;
    opacity: 0.6;
    transition: opacity 0.3s;
    padding: 0;
}

.btn-logout-link:hover {
    opacity: 1;
}

.badge-admin {
    background: #E3000F;
    color: #FFFFFF;
    padding: 3px 10px;
    border-radius: 12px;
    font-size: 0.65em;
    margin-left: 8px;
    font-weight: bold;
}

/* ==========================================
   ONGLETS / TABS
   ========================================== */
.tabs {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.tabs-desktop {
    display: flex;
}

.mobile-navbar {
    display: none;
}

.tab {
    flex: 1;
    min-width: 150px;
    padding: 15px;
    background: #FFFFFF;
    border: 2px solid #D0D0D0;
    border-radius: 8px;
    cursor: pointer;
    font-weight: bold;
    transition: all 0.3s;
    color: #1A1A1A;
    font-size: 15px;
}

.tab:hover {
    background: #F9F9F9;
    border-color: #ffcc00;
}

.tab.active {
    background: #ffcc00;
    color: #1A1A1A;
    border-color: #ffcc00;
}

/* ==========================================
   SOUS-ONGLETS DE PÉRIODE
   ========================================== */
.period-tabs {
    display: flex;
    gap: 10px;
    margin-bottom: 25px;
    justify-content: center;
}

.period-tab {
    padding: 10px 25px;
    background: #F9F9F9;
    border: 2px solid #D0D0D0;
    border-radius: 25px;
    cursor: pointer;
    font-weight: bold;
    transition: all 0.3s;
    color: #1A1A1A;
    font-size: 14px;
}

.period-tab:hover {
    background: #FFFEF0;
    border-color: #ffcc00;
}

.period-tab.active {
    background: #ffcc00;
    color: #1A1A1A;
    border-color: #ffcc00;
}

/* ==========================================
   CARTES DE PARIS
   ========================================== */
.pari-card {
    background: #FFFFFF;
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 15px;
    transition: transform 0.2s;
}

.pari-card.termine {
    opacity: 0.7;
    border-left-color: #999;
}

.pari-card.termine.collapsed .pari-content {
    display: none;
}

.pari-card.termine .pari-header {
    cursor: pointer;
    transition: background 0.3s;
}

.pari-card.termine .pari-header:hover {
    background: #F9F9F9;
}

.expand-icon {
    display: inline-block;
    margin-right: 10px;
    transition: transform 0.3s;
    font-size: 0.8em;
}

.pari-card.termine:not(.collapsed) .expand-icon {
    transform: rotate(90deg);
}

.pari-content {
    margin-top: 15px;
}

.pari-header {
    display: flex;
    justify-content: space-between;
    align-items: start;
    margin-bottom: 15px;
}

.pari-title {
    font-size: 1.2em;
    font-weight: bold;
    color: #1A1A1A;
    flex: 1;
}

.pari-points {
    background: #ffcc00 0%;
    color: #1A1A1A;
    padding: 8px 16px;
    border-radius: 8px;
    font-weight: bold;
    margin-left: 10px;
    font-size: 1.1em;
}

.pari-meta {
    color: #666;
    font-size: 0.9em;
    margin-bottom: 10px;
}

.pari-options {
    margin-top: 15px;
}

.option-item {
    background: #f5f5f5;
    padding: 12px;
    margin: 8px 0;
    border-radius: 8px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: all 0.3s;
}

.option-item.selected {
    background: #ffcc00;
    color: #1A1A1A;
    border-color: #ffcc00;
}

.vote-btn {
    padding: 8px 20px;
    border-radius: 20px;
    border: 2px solid #ffcc00;
    background: #FFFFFF;
    color: #1A1A1A;
    cursor: pointer;
    font-weight: bold;
    transition: all 0.3s;
}

.vote-btn:hover {
    background: #ffcc00;
    color: #1A1A1A;
}

.vote-btn.voted {
    background: #00C851;
    color: white;
    border-color: #00C851;
}

.response-input {
    width: calc(100% - 120px);
    display: inline-block;
    margin-right: 10px;
}

.participants {
    margin-top: 10px;
    font-size: 0.9em;
    color: #666;
}

.countdown {
    color: #E3000F;
    font-weight: bold;
}

.countdown.expired {
    color: #FF6B6B;
    font-style: italic;
}

.expired-message {
    background: #FFF3CD;
    color: #856404;
    padding: 12px;
    border-radius: 8px;
    margin-top: 10px;
    border-left: 4px solid #ffcc00;
    font-size: 14px;
}

/* ==========================================
   CLASSEMENT / LEADERBOARD
   ========================================== */
.leaderboard-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px;
    margin: 10px 0;
    background: #FFFFFF;
    border-radius: 10px;
}

.leaderboard-item.top1 {
    background: linear-gradient(135deg, #ffcc00 0%, #FFC700 100%);
    color: #1A1A1A;
    font-size: 1.2em;
}

.leaderboard-item.top2 {
    background: linear-gradient(135deg, #E8E8E8 0%, #D0D0D0 100%);
    color: #1A1A1A;
}

.leaderboard-item.top3 {
    background: linear-gradient(135deg, #E8B17D 0%, #CD7F32 100%);
    color: #1A1A1A;
}

.rank {
    font-size: 1.6em;
    font-weight: bold;
    margin-right: 15px;
    min-width: 50px;
}

.username {
    flex: 1;
    font-weight: bold;
}

.score {
    font-size: 1.5em;
    font-weight: bold;
}


/* ==========================================
   STATISTIQUES
   ========================================== */
.stat-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
    margin-top: 20px;
}

.stat-card {
    background: linear-gradient(135deg, #ffcc00 0%, #FFC700 100%);
    color: #1A1A1A;
    padding: 25px;
    border-radius: 12px;
    text-align: center;
    box-shadow: 0 4px 12px rgba(255, 211, 0, 0.2);
    border: 2px solid #E0E0E0;
}

.stat-value {
    font-size: 2.5em;
    font-weight: bold;
    margin-bottom: 5px;
}

.stat-label {
    font-size: 1em;
    opacity: 0.9;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* ==========================================
   ADMINISTRATION
   ========================================== */
.admin-actions {
    margin-bottom: 20px;
    text-align: right;
}

.pending-user {
    background: #FFF8E1;
    border: 2px solid #ffcc00;
    padding: 15px;
    margin: 10px 0;
    border-radius: 10px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.pending-info {
    flex: 1;
}

.pending-info strong {
    display: block;
    font-size: 1.2em;
    margin-bottom: 5px;
    color: #1A1A1A;
}

.pending-info small {
    color: #666;
}

.pending-actions {
    display: flex;
    gap: 10px;
}

/* ==========================================
   ALERTES
   ========================================== */
.alert {
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 20px;
    border-left: 5px solid;
}

.alert-info {
    background: #E3F2FD;
    border-color: #2196F3;
    color: #1A1A1A;
}

.alert-warning {
    background: #FFF8E1;
    border-color: #ffcc00;
    color: #1A1A1A;
}

.alert-success {
    background: #E8F5E9;
    border-color: #00C851;
    color: #1A1A1A;
}

.user-info-box {
    background: #F9F9F9;
    padding: 20px;
    border-radius: 10px;
    margin: 20px 0;
    border: 2px solid #E0E0E0;
}

/* ==========================================
   NOTIFICATIONS
   ========================================== */
.notification {
    position: fixed;
    top: 20px;
    right: 20px;
    background: #FFFFFF;
    padding: 20px;
    border-radius: 10px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
    z-index: 1000;
    animation: slideIn 0.3s ease-out;
    max-width: 350px;
    border: 2px solid;
}

@keyframes slideIn {
    from {
        transform: translateX(400px);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

.notification.success {
    border-color: #00C851;
    background: #E8F5E9;
}

.notification.info {
    border-color: #2196F3;
    background: #E3F2FD;
}

.notification.warning {
    border-color: #ffcc00;
    background: #FFF8E1;
}

.notification.error {
    border-color: #E3000F;
    background: #FFEBEE;
}

/* ==========================================
   LOADING / SPINNER
   ========================================== */
.loading {
    text-align: center;
    padding: 40px;
    color: #666;
}

.spinner {
    border: 4px solid #E0E0E0;
    border-top: 4px solid #ffcc00;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
    margin: 0 auto 20px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* ==========================================
   UTILITAIRES
   ========================================== */
.hidden {
    display: none !important;
}

/* ==========================================
   BARRE DE RECHERCHE
   ========================================== */

#searchHistory {
    width: 300px; 
    padding: 10px 15px; 
    border-radius: 8px; 
    font-size: 14px;;
    margin-bottom: 20px;
}

/* ==========================================
   RESPONSIVE
   ========================================== */
@media (max-width: 768px) {
    body {
        padding-bottom: 80px;
    }

    .tabs-desktop {
        display: none !important;
    }
    
    .mobile-navbar {
        display: flex !important;
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        background: #FFFFFF;
        border-top: 2px solid #E0E0E0;
        box-shadow: 0 -4px 12px rgba(0, 0, 0, 0.1);
        z-index: 1000;
        justify-content: space-around;
        align-items: center;
    }

    .mobile-tab {
        background: none;
        border: none;
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: 4px;
        cursor: pointer;
        color: #666;
        transition: all 0.3s;
        flex: 1;
        max-width: 80px;
    }

    .mobile-tab.active {
        color: #1A1A1A;
    }

    .mobile-tab.active .mobile-icon {
        transform: scale(1.2);
    }

    .mobile-icon {
        font-size: 24px;
        transition: transform 0.3s;
    }

    .mobile-label {
        font-size: 11px;
        font-weight: 500;
    }

    .mobile-fab {
        width: 70px;
        height: 70px;
        border-radius: 50%;
        background: linear-gradient(135deg, #ffcc00 0%, #FFC700 100%);
        border: 4px solid #FFFFFF;
        box-shadow: 0 6px 20px rgba(0, 0, 0, 0.2);
        cursor: pointer;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        margin: 0 10px;
        transition: all 0.3s;
        position: relative;
        top: -25px;
        gap: 2px;
    }

    .mobile-fab:active {
        transform: scale(0.95);
    }

    .fab-icon {
        font-size: 28px;
        line-height: 1;
    }

    .fab-label {
        font-size: 10px;
        font-weight: bold;
        color: #1A1A1A;
        line-height: 1;
    }

    .btn-create-pari {
        display: none !important;
    }

    .user-header {
        flex-direction: column;
        text-align: center;
        gap: 15px;
    }

    .user-info-left,
    .user-info-center,
    .user-info-right {
        text-align: center;
    }

    .user-info-right {
        justify-content: center;
    }

    .site-name {
        font-size: 1.5em;
    }

    .pari-header {
        flex-direction: column;
    }

    .pari-points {
        margin-left: 0;
        margin-top: 10px;
    }

    .logo h1 {
        font-size: 2em;
    }

    .stat-grid {
        grid-template-columns: 1fr;
    }
}