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

/* ========== Variables globales ========== */
:root {
    --clr-bg: #f5f7fa;                           /* fond général */
    --clr-card: #ffffff;                         /* fond des cartes */
    --clr-text: #000000;                         /* texte */
    --shadow-card: 0 4px 16px rgba(0,0,0,0.08);   /* ombre par défaut */
    --shadow-card-hover: 0 8px 24px rgba(0,0,0,0.12); /* ombre au hover */
    --radius-card: 5px;                         /* coins arrondis */
}

.flag-icon {
    border-radius: 2px;
    filter: drop-shadow(0 0 1px #fff) drop-shadow(0 1px 2px rgba(15,23,42,.3)) !important;
}

/* ========== Exposants ========== */
sup { line-height: 0; font-size: 0.72em; margin-left: 0; }

/* ========== Box-sizing global ========== */
*,
*::before,
*::after {
    box-sizing: border-box;
}

/* ========== Styles de base ========== */
body {
    font-family: 'Inter', sans-serif;
    background-color: #ffffff; /* Fond blanc par défaut */
    color: var(--clr-text);
    margin: 0;
    padding: 0;
    overflow-x: hidden;
}

body.main-page{
    padding-top: 57px;
}

body.login-bg {
    background-color: #23262B; /* Fond sombre pour la page de login */
    color: #ffffff; /* Texte blanc pour la page de login */
}

.container {
    box-sizing: border-box;
    margin-top: 15px !important;
}

.navbar-custom {
    user-select: none;
    background-color: #23262B;
    border-bottom: 1px solid rgba(255,255,255,0.06);
    box-shadow: 0 2px 16px rgba(0,0,0,0.30);
}
.navbar-impersonate {
    user-select: none;
    background-color: #92400e;
    border-bottom: 3px solid #f59e0b;
}

.navbar-brand,
.navbar-nav .nav-link,
.navbar-nav .dropdown-item {
    color: #ffffff !important;
}

.navbar-brand img {
    max-width: 40px;
    max-height: 30px;
    margin-right: 10px;
    margin-left: 10px;
    transform: scale(1.6);
    transform-origin: left center;
    margin-top: -5px;
}

.navbar-nav .nav-link {
    padding: 6px 12px !important;
    border-radius: 8px;
    font-weight: 500;
    font-size: 14px;
    transition: background-color 0.18s ease, color 0.18s ease;
}

.navbar-nav .nav-link:hover {
    background-color: rgba(31,95,159,0.30);
    color: #ffffff !important;
}

.navbar-nav .nav-link:focus,
.navbar-nav .dropdown-item:focus {
    outline: none;
}

.navbar-toggler {
    border-color: rgba(255,255,255,0.20);
    border-radius: 8px;
    margin-right: 10px;
    padding: 5px 8px;
}

.navbar-toggler-icon {
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 30'%3e%3cpath stroke='rgba%28255,255,255,0.75%29' stroke-width='2' stroke-linecap='round' stroke-miterlimit='10' d='M4 7h22M4 15h22M4 23h22'/%3e%3c/svg%3e");
}

.dropdown-menu {
    background-color: #1e2228;
    border: 1px solid rgba(255,255,255,0.10);
    border-radius: 8px;
    box-shadow: 0 8px 28px rgba(0,0,0,0.40);
    padding: 4px;
}

.dropdown-menu .dropdown-item {
    color: rgba(255,255,255,0.88) !important;
    padding: 9px 14px;
    border-radius: 6px;
    margin-bottom: 2px;
    font-weight: 500;
    font-size: 14px;
    transition: background-color 0.15s ease;
}

.dropdown-menu .dropdown-item:last-child {
    margin-bottom: 0;
}

.dropdown-menu .dropdown-item:hover {
    background-color: rgba(31,95,159,0.40);
    color: #ffffff !important;
}

@media (max-width: 992px) {
    .navbar-nav .nav-item {
        margin-bottom: 2px;
    }
    .navbar-nav .dropdown-menu {
        right: 0;
        left: auto;
        background-color: rgba(255,255,255,0.05);
        border: none;
        box-shadow: none;
        padding: 2px 0 2px 10px;
        margin: 2px 0 6px;
        border-radius: 0;
        border-left: 2px solid rgba(255,255,255,0.12);
    }
    .navbar-nav .dropdown-menu .dropdown-item {
        border-radius: 6px;
        padding: 8px 14px;
    }
    .navbar-nav.ml-auto {
        margin-left: auto !important;
    }
    .navbar-collapse {
        margin-top: 8px;
        border-top: 1px solid rgba(255,255,255,0.08);
        padding-top: 10px;
        padding-bottom: 6px;
    }
}

.login-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding-top: 0; /* Supprimer le padding supérieur */
    padding-right: 20px;
    padding-left: 20px;
}

.language-selector {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-top: 20px;
}

.language-selector a {
    display: flex;
    align-items: center;
    color: #ffffff;
    text-decoration: none;
    font-weight: bold;
}

.language-selector img {
    width: 24px; /* Taille ajustée pour ne pas écraser les drapeaux */
    height: auto;
    margin-right: 5px;
}

.navbar-nav .dropdown-item img {
    width: 24px;
    height: auto;
    margin-right: 5px;
}

.navbar-nav .dropdown-toggle img {
    width: 24px;
    height: auto;
}

.login-title {
    font-size: 1.5rem;
    font-weight: bold;
    text-align: center;
    margin-bottom: 20px;
}

.login-input {
    width: 100%;
    margin-bottom: 10px;
    padding: 10px;
    border: none;
    border-radius: 0.5rem;
    background-color: #434343; /* Fond sombre pour les champs de saisie */
    color: #ffffff; /* Texte blanc pour les champs de saisie */
}

.login-input::placeholder {
    color: #b0b0b0; /* Placeholder en gris clair */
}

.login-button {
    width: 100%;
    padding: 10px;
    border: none;
    border-radius: 0.5rem;
    background-color: #1a3a6b; /* Bouton bleu */
    color: #ffffff; /* Texte blanc pour le bouton */
    font-size: 1rem;
    font-weight: bold;
}

.login-button:hover {
    background-color: #10284d;
}

.login-button-secondary:hover {
    background-color: #555 !important;
    color: #fff;
}

.login-container .login-button {
    background-color: #1f5f9f;
}

.login-container .login-button:hover {
    background-color: #1a4f86;
}

.auth-link {
    display: block;
    margin-top: 12px;
    color: #ffffff;
    text-align: center;
    text-decoration: underline;
    font-weight: 600;
}

.auth-link:hover {
    color: #dbeafe;
}

.auth-help {
    width: 100%;
    margin: -2px 0 12px;
    color: #d1d5db;
    font-size: 0.86rem;
    line-height: 1.35;
    text-align: left;
}

.nationality-select-wrapper {
    margin-bottom: 15px;
    width: 100%;
}

.login-container .nationality-select-wrapper .custom-select-container {
    width: 100%;
}

.login-container .custom-select-trigger {
    display: flex;
    align-items: center;
    width: 100%;
    min-height: 44px;
    gap: 10px;
    padding: 10px 12px;
    background: #434343;
    border: 1px solid transparent;
    border-radius: 0.5rem;
    color: #fff;
    cursor: pointer;
    transition: border-color 0.18s ease, box-shadow 0.18s ease, background-color 0.18s ease;
}

.login-container .custom-select-trigger:hover,
.login-container .custom-select-trigger:focus-within {
    background: #4a4a4a;
    border-color: rgba(255,255,255,0.22);
    box-shadow: 0 0 0 3px rgba(6,115,255,0.18);
}

.login-container .custom-select-trigger .flag-icon {
    flex: 0 0 auto;
    font-size: 1.18rem;
    margin: 0;
}

.login-container .custom-select-trigger .selected-text {
    flex: 1;
    min-width: 0;
    color: #fff;
    font-weight: 700;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.login-container .custom-select-trigger i {
    flex: 0 0 auto;
    color: #cbd5e1;
    font-size: 0.82rem;
}

.login-container .custom-select-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.7);
    z-index: 99999;
    justify-content: center;
    align-items: center;
    padding: 20px;
}

.login-container .custom-select-overlay.open {
    display: flex;
}

.login-container .custom-options {
    background: #2f333a;
    border-radius: 12px;
    width: 100%;
    max-width: min(360px, calc(100vw - 32px));
    max-height: 80vh;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    box-shadow: 0 18px 50px rgba(0,0,0,0.45);
}

.login-container .custom-options-header,
.login-container .custom-options-search-wrap {
    padding: 14px 16px;
    border-bottom: 1px solid #555;
}

.login-container .custom-options-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: #fff;
    font-weight: 800;
}

.login-container .custom-options-search {
    width: 100%;
    border: 1px solid #666;
    border-radius: 8px;
    padding: 10px 12px;
    color: #fff;
    background: #2f2f2f;
    outline: none;
}

.login-container .custom-options-search:focus {
    border-color: #0673ff;
    box-shadow: 0 0 0 3px rgba(6,115,255,0.2);
}

.login-container .custom-options-close {
    background: none;
    border: none;
    color: #fff;
    font-size: 1.5em;
    cursor: pointer;
    line-height: 1;
    padding: 2px 4px;
}

.login-container .custom-option {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    color: #fff;
    border-bottom: 1px solid #555;
    cursor: pointer;
    font-weight: 700;
}

.login-container .custom-option:hover,
.login-container .custom-option.selected {
    background: rgba(6,115,255,0.22);
}

.login-container .custom-option .flag-icon {
    flex: 0 0 auto;
    font-size: 1.15rem;
}

.login-container .custom-option span:last-child {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

#sessionModal .modal-dialog {
    margin: 12px auto;
    max-width: min(400px, calc(100vw - 24px));
}

.session-modal-content {
    background: #2f2f2f;
    color: #fff;
    border: none;
    border-radius: 14px;
    box-shadow: 0 12px 40px rgba(0,0,0,0.6);
    max-height: calc(100dvh - 24px);
    overflow-y: auto;
}

.session-modal-header {
    border-bottom: 1px solid #444;
    padding: 14px 16px 12px;
}

.session-modal-header .modal-title {
    font-size: 1rem;
    font-weight: 700;
    color: #fff;
}

.session-modal-body {
    padding: 16px;
    font-size: 0.95rem;
    line-height: 1.5;
}

.session-modal-body p {
    margin-bottom: 6px;
    color: #ddd;
}

.session-modal-greeting {
    font-size: 1rem;
    color: #fff !important;
}

.session-modal-question {
    color: #aaa !important;
    font-size: 0.88rem;
}

.session-modal-footer {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    border-top: 1px solid #444;
    padding: 12px 16px;
    gap: 8px;
}

.session-modal-footer .login-button {
    width: 100%;
    box-sizing: border-box;
    margin: 0;
    display: block;
    text-align: center;
    text-decoration: none;
    padding: 9px 10px;
    font-size: 0.95rem;
}

.login-icon {
    max-width: 85%; /* Taille de l'image augmentée */
    max-height: 330px;
    margin-bottom: 10px; /* Réduire l'espace sous l'image */
}

.error-message {
    color: #dc3545; /* Rouge pour le texte de l'erreur */
    margin-bottom: 10px;
    text-align: center; /* Centré */
    font-size: 0.9rem; /* Taille de police plus petite */
}

.alert-danger {
    width: 100%;
    text-align: center;
}

.navbar-nav.ml-auto {
    display: flex;
    align-items: center;
}

.navbar-nav .nav-item.dropdown {
    position: relative;
}

.dropdown-menu-right {
    right: 0;
    left: auto;
}

.modal-dialog {
    width: auto; /* Garder la largeur de la modal par défaut */
}

.modal-content {
    display: flex;
    flex-direction: column;
    max-height: 90vh; /* Limiter la hauteur totale de la modal pour ne pas dépasser l'écran */
}

.modal-header, .modal-footer {
    flex-shrink: 0; /* Empêche le rétrécissement des sections header et footer */
    display: flex; /* Assure que header et footer sont flexibles */
    align-items: center; /* Centrer verticalement le contenu dans header et footer */
}

.modal-body {
    overflow-y: auto; /* Activer le scroll vertical si le contenu dépasse */
    flex-grow: 1; /* Permet à la modal-body de s'étendre pour occuper l'espace restant */
    max-height: calc(90vh - 60px - 40px); /* Ajuster pour tenir compte des hauteurs du header et du footer */
}


.modal-footer{
    justify-content: center;
    padding: 0;
}

.modal-footer button{
    margin: 1px 5px 2px 5px;
}

table.table td,table.table th{
    vertical-align: middle ;
}

/* ========== Penalty Winner Overlay ========== */
.penalty-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.87);
    z-index: 10000;
    justify-content: center;
    align-items: center;
    padding: 16px;
}
.penalty-overlay.active {
    display: flex;
}
.penalty-card {
    background: #fff;
    border-radius: 20px;
    padding: 32px 24px 28px;
    max-width: 420px;
    width: 100%;
    text-align: center;
    box-shadow: 0 24px 80px rgba(0, 0, 0, 0.5);
    animation: penaltyCardIn 0.28s cubic-bezier(0.34, 1.56, 0.64, 1);
}
@keyframes penaltyCardIn {
    from { transform: translateY(40px) scale(0.93); opacity: 0; }
    to   { transform: translateY(0) scale(1); opacity: 1; }
}
.penalty-card-icon {
    font-size: 2.4rem;
    color: #1a3a6b;
    margin-bottom: 10px;
}
.penalty-card h5 {
    color: #1a3a6b;
    font-weight: 700;
    font-size: 1.05rem;
    margin-bottom: 5px;
}
.penalty-card .penalty-subtitle {
    color: #999;
    font-size: 12.5px;
    margin-bottom: 0;
}
.penalty-teams {
    display: flex;
    gap: 12px;
    margin-top: 22px;
    align-items: stretch;
}
.penalty-team-btn {
    flex: 1;
    border: 2px solid #dce8f8;
    background: #fff;
    border-radius: 14px;
    padding: 18px 8px 14px;
    cursor: pointer;
    transition: border-color 0.16s, background 0.16s, transform 0.14s;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    font-weight: 600;
    color: #1a3a6b;
    min-height: 100px;
    touch-action: manipulation;
    line-height: 1.3;
}
.penalty-team-btn:hover,
.penalty-team-btn:focus {
    border-color: #1a3a6b;
    background: #eef3ff;
    transform: scale(1.04);
    outline: none;
}
.penalty-team-btn.penalty-selected {
    border-color: #16a34a;
    background: #f0fdf4;
    color: #15803d;
    transform: scale(1.06);
}
.penalty-team-btn.penalty-selected::after {
    content: '✓';
    display: block;
    font-size: 1.4rem;
    font-weight: 700;
    color: #16a34a;
    margin-top: 2px;
}
.penalty-team-btn.penalty-dimmed {
    opacity: 0.35;
    transform: scale(0.97);
    pointer-events: none;
}
.penalty-team-btn .flag-icon {
    font-size: 2rem;
}
.penalty-vs-sep {
    font-weight: 700;
    color: #ccc;
    font-size: 1rem;
    align-self: center;
    flex-shrink: 0;
}
.penalty-winner-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    margin-top: 5px;
    font-size: 11.5px;
    color: #1a3a6b;
    font-weight: 600;
    background: #e8f0fe;
    padding: 2px 9px;
    border-radius: 20px;
}

/* ===================================================
   DARK MODE TOGGLE BUTTON
   =================================================== */
.dark-mode-toggle-btn {
    font-size: 1rem;
    transition: color 0.2s ease;
}
.dark-mode-toggle-btn:hover {
    color: #f0c040 !important;
}
body.dark-mode .dark-mode-toggle-btn {
    color: #f0c040 !important;
}

/* ===================================================
   DARK MODE — STYLES GLOBAUX
   =================================================== */
body.dark-mode {
    background-color: #0f1117;
    color: #d8dce8;
}

/* Dropdown menus — déjà sombres, mais s'assurer qu'ils restent cohérents */
body.dark-mode .dropdown-menu {
    background-color: #1a1e26;
    border-color: rgba(255,255,255,0.10);
}
body.dark-mode .dropdown-menu .dropdown-item {
    color: rgba(255,255,255,0.85) !important;
}
body.dark-mode .dropdown-menu .dropdown-item:hover {
    background-color: rgba(31,95,159,0.35);
}

/* Modaux */
body.dark-mode .modal-content {
    background-color: #1a1e26;
    color: #d8dce8;
    border-color: rgba(255,255,255,0.10);
}
body.dark-mode .modal-header {
    border-bottom-color: rgba(255,255,255,0.08);
    color: #d8dce8;
}
body.dark-mode .modal-footer {
    border-top-color: rgba(255,255,255,0.08);
}
body.dark-mode .modal-body {
    color: #d8dce8;
}
body.dark-mode .close {
    color: #fff;
    text-shadow: none;
    opacity: 1;
}
body.dark-mode .close:hover {
    color: #fff;
    opacity: 0.8;
}

/* Tableaux */
body.dark-mode .table {
    color: #d8dce8;
}
body.dark-mode .table td,
body.dark-mode .table th {
    border-color: rgba(255,255,255,0.07);
}
body.dark-mode .table-hover tbody tr:hover {
    background-color: rgba(255,255,255,0.04);
    color: #d8dce8;
}
body.dark-mode .table-striped tbody tr:nth-of-type(odd) {
    background-color: rgba(255,255,255,0.03);
}
body.dark-mode .thead-light th {
    background-color: #1e2330;
    border-color: rgba(255,255,255,0.07);
    color: #9ba3b8;
}
body.dark-mode .thead-dark th {
    background-color: #1a1e26;
    border-color: rgba(255,255,255,0.1);
}

/* Formulaires */
body.dark-mode .form-control {
    background-color: #242836;
    color: #d8dce8;
    border-color: rgba(255,255,255,0.12);
}
body.dark-mode .form-control:focus {
    background-color: #2a3040;
    color: #fff;
    border-color: rgba(100,160,255,0.45);
    box-shadow: 0 0 0 0.2rem rgba(100,160,255,0.15);
}
body.dark-mode .form-control::placeholder {
    color: rgba(200,210,230,0.4);
}
body.dark-mode select.form-control option {
    background-color: #1e2330;
    color: #d8dce8;
}
body.dark-mode input[type="text"],
body.dark-mode input[type="email"],
body.dark-mode input[type="password"],
body.dark-mode input[type="search"],
body.dark-mode textarea {
    background-color: #242836;
    color: #d8dce8;
    border-color: rgba(255,255,255,0.12);
}

/* Cartes génériques Bootstrap */
body.dark-mode .card {
    background-color: #1a1e26;
    border-color: rgba(255,255,255,0.09);
}
body.dark-mode .card-header {
    background-color: #1e2330;
    border-bottom-color: rgba(255,255,255,0.08);
    color: #d8dce8;
}
body.dark-mode .card-footer {
    background-color: #1e2330;
    border-top-color: rgba(255,255,255,0.08);
    color: #c0c8da;
}
body.dark-mode .card-body {
    color: #d8dce8;
}

/* Badges, alerts */
body.dark-mode .badge-light,
body.dark-mode .badge-secondary {
    background-color: #2a2e3a;
    color: #c0c8da;
}
body.dark-mode .alert-info {
    background-color: #0d2544;
    color: #7ec8f0;
    border-color: rgba(100,185,240,0.2);
}
body.dark-mode .alert-warning {
    background-color: #2a1d00;
    color: #fbbf24;
    border-color: rgba(251,191,36,0.2);
}
body.dark-mode .alert-danger {
    background-color: #2a0d0d;
    color: #f87171;
    border-color: rgba(248,113,113,0.2);
}
body.dark-mode .alert-success {
    background-color: #0a2510;
    color: #4ade80;
    border-color: rgba(74,222,128,0.2);
}

/* List groups */
body.dark-mode .list-group-item {
    background-color: #1a1e26;
    border-color: rgba(255,255,255,0.07);
    color: #d8dce8;
}
body.dark-mode .list-group-item:hover {
    background-color: #1e2330;
}
body.dark-mode .list-group-item-action:focus,
body.dark-mode .list-group-item-action:hover {
    background-color: #1e2330;
    color: #d8dce8;
}

/* Divers */
body.dark-mode hr {
    border-color: rgba(255,255,255,0.08);
}
body.dark-mode .bg-light {
    background-color: #1a1e26 !important;
}
body.dark-mode .bg-white {
    background-color: #1a1e26 !important;
}
body.dark-mode .text-dark {
    color: #d8dce8 !important;
}
body.dark-mode .text-muted {
    color: #7a8098 !important;
}
body.dark-mode .border {
    border-color: rgba(255,255,255,0.09) !important;
}
body.dark-mode .btn-light {
    background-color: #2a2e3a;
    border-color: rgba(255,255,255,0.1);
    color: #d8dce8;
}
body.dark-mode .btn-light:hover {
    background-color: #32374a;
    color: #fff;
}
body.dark-mode .btn-outline-secondary {
    color: rgba(200,210,230,0.8);
    border-color: rgba(200,210,230,0.25);
}
body.dark-mode .btn-outline-secondary:hover {
    background-color: rgba(255,255,255,0.08);
    color: #fff;
}
body.dark-mode .btn-secondary {
    background-color: #3a3e4e;
    border-color: rgba(255,255,255,0.15);
    color: #d8dce8;
}

/* Overlay pénalité (penalty-card reste clair intentionnellement, c'est un focus visuel) */
body.dark-mode .penalty-card {
    background: #1e2330;
    color: #d8dce8;
}
body.dark-mode .penalty-card h5 {
    color: #7ec8f0;
}
body.dark-mode .penalty-team-btn {
    background: #242836;
    border-color: #2e3a4e;
    color: #d8dce8;
}
body.dark-mode .penalty-team-btn:hover,
body.dark-mode .penalty-team-btn:focus {
    background: #2a3040;
    border-color: #4a7abf;
}
body.dark-mode .penalty-team-btn.penalty-selected {
    border-color: #16a34a;
    background: #0a2510;
    color: #4ade80;
}
body.dark-mode .penalty-winner-badge {
    background: rgba(100,160,255,0.15);
    color: #7ec8f0;
}
