.main-container {
    max-width: 1100px;
    margin: auto;
    background-color: #f9f9f9;
    padding: 5px 20px 0px;
    border-radius: 8px;
    box-shadow: 0 0 10px rgba(0,0,0,0.1);
}

body {
    background-image: url('./background.png');
    background-repeat: no-repeat;
    background-size: cover;
    background-attachment: fixed;   
    /* 5. Centre l'image (optionnel) */
    background-position: center center;
    /* 6. Couleur de secours si l'image ne charge pas (bonne pratique) */
    background-color: #dafaae;
    font-family: Arial, sans-serif;
    font-size: 14px;
    justify-content: center;
    align-items: flex-start;
    min-height: 100vh;
    text-decoration-color: #81bd1e;
    padding: 5px;
    box-sizing: border-box;
}

h1 { text-align: center; margin: 4px;}
h2 { color: #006600; }
h4 { margin-top: 10px; margin-bottom: 10px}

label {
    display: block;
    margin-bottom: 0px;
    font-weight: bold;
    text-align: left;
}

caption {
  caption-side: top;
  text-align: left;
  padding-bottom: 4px;
  font-weight: bold;
  margin: 10px;
}

table {
    width: 100%; border-collapse: collapse; margin-top: 10px;
}

table thead {
    background-color: #efeef5;
}

th, td {
    border: 1px solid #ccc; padding: 4px; text-align: left;
}

button {
    background-color: #4CAF50;
    color: white;
    padding: 8px 10px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    margin: 4px;
}

.button-container {
  display: flex;
  justify-content: space-between;
  align-items: center; /* Aligne les boutons verticalement */
  width: 100%; /* S'assure que le conteneur prend toute la largeur */
  padding: 10px;
  /*border: 1px solid #ccc;*/
}

.buttons-right {
  display: flex; /* Active Flexbox pour le conteneur */
  justify-content: flex-end; /* Aligne les éléments à la fin (à droite) */
  gap: 10px; /* Ajoute un espace entre les boutons (facultatif) */
}

button:disabled { background-color: #cccccc; cursor: not-allowed; }

.buttons {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 15px;
}

.button-green { background-color: #4CAF50; color: white; }
.button-green:active { background-color: #337735; transform: translateY(1px) translateY(1px); }
.button-green:hover { background-color: #429b45;}

.button-red {  background-color: #f44336; color: white;}
.button-red:active { background-color: #c7362c; transform: translateY(1px) translateY(1px); }
.button-red:hover { background-color: #d4382d; }

.button-blue { background-color: #008CBA; color: white;}
.button-blue:active { background-color: #016f94; transform: translateY(1px) translateY(1px); }
.button-blue:hover { background-color: #026383; }

.button-orange { background-color: #FF9800; color: white;}
.button-orange:active { background-color: #cc7a00; transform: translateY(1px) translateY(1px); }
.button-orange:hover { background-color: #e68900; }

.button-purple { background-color: #9C27B0; color: white;}
.button-purple:active { background-color: #7d1f8d; transform: translateY(1px) translateY(1px); }
.button-purple:hover { background-color: #8e24aa; }

.button-grey { background-color: #443e3e81;}
.button-grey:active { background-color: #443e3ebd; transform: translateY(1px) translateY(1px); }
.button-grey:hover { background-color: #443e3e9a; }

form { background: #f9f9f9; border-radius: 8px; box-shadow: 0 0 10px rgba(0,0,0,0.1); }

input[type=text], input[type=number], input[type=date], input[type=time] {
    width: 100%;
    padding: 4px;
    border: 1px solid #ccc;
    border-radius: 4px;
    box-sizing: border-box;
}

.container-flex {
    display: flex;
    /* Option 1 : Espacer les éléments de manière égale, le premier et le dernier sont collés aux bords. */
    justify-content: space-between;
    align-items: center;
}

.checkbox-container {
    display: flex;
    align-items: center;
    gap: 8px;
}

.filter-input-container {
    position: relative;
    max-width: 300px;
}

.filter-input-container input {
    padding-right: 28px;
}

.clear-filter-btn {
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: #999;
    cursor: pointer;
    padding: 0;
    margin: 0;
    font-size: 14px;
    width: 16px;
    height: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.2s;
    line-height: 1;
}

.clear-filter-btn:hover {
    color: #555;
}

.clear-filter-btn.hidden {
    display: none;
}

/* Styles pour la boîte de dialogue (modal) */
.modal {
    display: none; /* Cachée par défaut */
    position: fixed;
    z-index: 1;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    max-width: 900px;
    overflow: auto;
    background-color: rgb(0,0,0);
    background-color: rgba(0,0,0,0.4);
}
.modal-content {
    background-color: #fefefe;
    margin: 15% auto;
    padding: 20px;
    border: 1px solid #888;
    width: 80%;
}
.close {
    color: #aaa;
    float: right;
    font-size: 28px;
    font-weight: bold;
}
.close:hover,
.close:focus {
    color: black;
    text-decoration: none;
    cursor: pointer;
}

/* ========== MEDIA PRINT - STYLES DE BASE ========== */
@media print {
    .noprint {
        display: none !important;
    }
    h2 {
        font-size: 14pt;
        margin: 0 0 3px 0;
    }
    h3 {
        font-size: 12pt;
        margin: 0 0 5px 0;
    }

    .header-container {
        margin-bottom: 10px;
        padding-top: 5px;
    }

    .header-container h2,
    .header-container h3 {
        padding-right: 130px; /* Laisser de la place pour le logo */
    }

    .button-container {
        display: none;
    }
}

/* Optimisation pour l'impression des résultats en portrait */
.logo {
    display: block !important;
}

body {
    font-size: 11pt;
}

/* Mode portrait avec marges de 6 mm (0.5 inch) */
@page {
    size: A4 portrait;
    margin: 6mm;
}

.summary-line {
    font-size: 11pt;
    margin: 8px 0;
}

/* ========== STYLES SPÉCIFIQUES PAGES SCORES ========== */
/* Optimisation pour les pages de saisie de scores */
.col-scores input {
    font-size: 9pt;
    padding: 2px;
    width: 100%;
    box-sizing: border-box;
}

/* Ajuster les tableaux de scores pour impression */
table.player-teetime {
    width: 100%;
    table-layout: auto;
}

/* ========== STYLES ÉQUIPES ========== */
/* Styles pour différencier les équipes */
.team-1 {
    background-color: #e3f2fd; /* Bleu clair */
}

.team-2 {
    background-color: #fff3e0; /* Orange clair */
}

.team-header {
    border-top: 2px solid #333;
}

/* ========== STYLES COMMUNS PAGES SCORES ========== */
/* Colonnes pour les pages de scores */
.col-scores {
    display: table-cell;
}

.col-departs {
    display: none;
}

/* Input de score */
#score-input {
    font-family: monospace;
    width: 12ch;
    -moz-appearance: textfield; /* Firefox */
    appearance: textfield;
}

/* ========== STYLES RÉSULTATS ET SCORES ========== */
/* Styles pour les pages de résultats */
.header-container {
    position: relative;
    margin-bottom: 0px;
    padding-top: 10px;
    min-height: 120px;
}

.header-container h2 {
    margin: 0 0 5px 0;
    padding-right: 140px; /* Laisser de la place pour le logo */
}

.header-container h3 {
    margin: 0;
    padding-right: 140px; /* Laisser de la place pour le logo */
}

.logo {
    position: absolute;
    top: 0;
    right: 20px;
    max-width: 120px;
    height: auto;
}

/* ========== STYLES MENU ACTIONS ========== */
/* Menu déroulant d'actions avec icônes et texte */
.action-menu-container {
    position: relative;
    display: inline-block;
}

.action-menu-btn {
    background-color: #4CAF50;
    color: white;
    padding: 4px 6px;
    border: 2px solid #337735;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.2s;
}

.action-menu-btn:hover {
    background-color: #429b45;
    transform: scale(1.05);
}

.action-menu-btn:active {
    background-color: #337735;
    transform: translateY(1px);
}

.action-menu {
    display: none;
    position: absolute;
    right: 0;
    background-color: white;
    min-width: 60px;
    box-shadow: 0px 8px 16px 0px rgba(0,0,0,0.3);
    z-index: 1000;
    border-radius: 4px;
    border: 1px solid #ddd;
    margin-top: 2px;
    padding: 2px 10px 2px 4px;
}

.action-menu.open-upward {
    bottom: 100%;
    margin-top: 0;
    margin-bottom: 5px;
}

.action-menu.show {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.action-menu a {
    text-decoration: none;
    display: block;
    width: 100%;
}

.action-menu button {
    width: 100%;
    padding: 10px 12px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.2s;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 10px;
}

.action-menu button:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.action-menu button:not(:disabled):hover {
    filter: brightness(0.9);
    transform: translateX(2px);
}