/* General Body and Container Styles */
body {
    font-family: sans-serif;
    background-color: #f0f2f5;
    color: #fffdfdff;
    background-image: url('/styles/incastyle/theme/images/background.jpg');
}

.container {
    position: relative;
    max-width: 1400px;
    margin: 20px auto;
    padding: 10px;
    background: rgba(0, 0, 0, .4);
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

h1, h2, h3 {
    text-align: center;
    color: #e7e8faff;
    margin-top: 10px;
    margin-bottom: 10px;
}

a {
    color: #efefef;
}

/* Header Styles */
.desktop-view {
    display: block;
}
.mobile-view {
    display: none;
}

#logo {
    width: 100%; /* CHANGED: Make logo responsive */
    max-width: 350px; /* CHANGED: Set a max-width */
    height: auto;
}

.header-banner-desktop img {
    max-width: 400px;
    width: 100%;
    height: auto;
    border-radius: 8px;
}

.header-banner-mobile {
    text-align: center; /* ADDED: Center banner container */
    margin-bottom: 15px; /* ADDED: Space below banner */
}

.header-banner-mobile img {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
}


/* Controls for index.php */
.controls {
    display: flex;
    justify-content: center;
    align-items: center;
    margin-bottom: 10px;
    gap: 10px;
    flex-wrap: wrap; /* ADDED: Allow controls to wrap on small screens */
}

/* Custom Select Styling */
.custom-select {
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    background-color: #004a99;
    color: white;
    border: 2px solid #ffd700;
    border-radius: 5px;
    padding: 10px 40px 10px 20px;
    font-size: 1.1em;
    cursor: pointer;
    background-image: url('data:image/svg+xml;charset=US-ASCII,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%22292.4%22%20height%3D%22292.4%22%3E%3Cpath%20fill%3D%22%23ffd700%22%20d%3D%22M287%2069.4a17.6%2017.6%200%200%200-13-5.4H18.4c-5%200-9.3%201.8-12.9%205.4A17.6%2017.6%200%200%200%200%2082.2c0%205%201.8%209.3%205.4%2012.9l128%20127.9c3.6%203.6%207.8%205.4%2012.8%205.4s9.2-1.8%2012.8-5.4L287%2095c3.5-3.5%205.4-7.8%205.4-12.8%200-5-1.9-9.2-5.4-12.8z%22%2F%3E%3C%2Fsvg%3E');
    background-repeat: no-repeat;
    background-position: right 15px center;
    background-size: 12px;
    min-width: 250px; /* Ensure a minimum width */
}

.custom-select:hover {
    border-color: #fff;
}

.custom-select option {
    background-color: #004a99;
    color: white;
}

.custom-select optgroup {
    font-style: italic;
    background-color: #003366;
}

/* Pitch Styles */
.pitch-container {
    display: flex;
    justify-content: center;
}

.pitch {
    position: relative;
    width: 450px;
    height: 600px;
    margin: 10px auto;
    background-color: #008000;
    border: 2px solid white;
    box-sizing: border-box;
    overflow: hidden;
}

.pitch-line {
    position: absolute;
    background-color: transparent;
    border: 2px solid rgba(255, 255, 255, 0.5);
    box-sizing: border-box;
}
.center-line { top: 50%; left: 0; right: 0; border-top-width: 2px; }
.center-circle { top: 50%; left: 50%; transform: translate(-50%, -50%); width: 120px; height: 120px; border-radius: 50%; }
.penalty-area { position: absolute; left: 50%; transform: translateX(-50%); width: 60%; height: 18%; border: 2px solid rgba(255,255,255,0.5); }
.penalty-area.top { top: 0; border-top: none; }
.penalty-area.bottom { bottom: 0; border-bottom: none; }
.goal-area { position: absolute; left: 50%; transform: translateX(-50%); width: 30%; height: 7%; border: 2px solid rgba(255,255,255,0.5); }
.goal-area.top { top: 0; border-top: none; }
.goal-area.bottom { bottom: 0; border-bottom: none; }

/* Player Position Styles */
.position {
    position: absolute;
    width: 70px;
    height: 70px;
    border-radius: 50%;
    background-color: rgba(255, 255, 255, 0.8);
    border: 2px solid #004a99;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    font-size: 10px;
    font-weight: bold;
    flex-direction: column;
    transform: translate(-50%, -50%);
}
.position.filled {
    background-color: #004a99;
    color: white;
    border-color: #ffd700;
    cursor: default;
}
.position:not(.filled):hover {
    transform: scale(1.1) translate(-45%, -45%);
}
.player-name {
    font-size: 12px;
    margin-top: 2px;
}
.player-pos-label {
    font-size: 10px;
    opacity: 0.8;
}


/* Index Page Specific */
#submit-btn { display: block; width: 100%; padding: 15px; background-color: #007bff; color: white; font-size: 18px; border: none; border-radius: 5px; cursor: pointer; margin-top: 10px; }
#submit-btn:disabled { background-color: #ccc; }

/* Player Modal Styles */
#player-modal { display: none; position: fixed; z-index: 1000; left: 0; top: 0; width: 100%; height: 100%; overflow: auto; background-color: rgba(0,0,0,0.6); }
.modal-content { background-color: #003366; margin: 15% auto; padding: 20px; border: 2px solid #ffd700; width: 80%; max-width: 400px; color: #fff; border-radius: 8px; }
.modal-content h3 { color: #ffd700; }
.modal-content ul { list-style: none; padding: 0; max-height: 300px; overflow-y: auto; }
.modal-content li { padding: 10px; cursor: pointer; border-bottom: 1px solid #004a99; }
.modal-content li:hover { background-color: #004a99; }
.close-btn { color: #ffd700; float: right; font-size: 28px; font-weight: bold; cursor: pointer; }
.close-btn:hover { color: #fff; }
#player-search { width: calc(100% - 20px); padding: 8px; margin-bottom: 10px; background-color: #004a99; border: 1px solid #ffd700; color: white; border-radius: 5px; }
#player-search::placeholder { color: #ccc; }

#message { text-align: center; padding: 10px; margin-top: 10px; border-radius: 5px; display: none; }
.success { background-color: #d4edda; color: #155724; }
.error { background-color: #f8d7da; color: #721c24; }

.login-message {
    min-height: auto;
    text-align: center;
}

/* Results Page Specific Styles */
.container.results-page {
    max-width: 1400px; /* Match container width */
    padding: 20px;
}

.matchday-selector-container {
    text-align: center;
    margin-bottom: 20px;
}

.results-header {
    text-align: center;
    margin-bottom: 20px;
    font-size: 1.1em;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
}

.results-container {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-around;
    gap: 20px;
    margin-top: 20px;
}

.pitch-wrapper,
.table-wrapper {
    flex: 1;
    min-width: 450px;
    padding: 10px;
    background: rgba(0, 0, 0, .3);
    border-radius: 8px;
}

.results-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 10px;
    color: #e7e8faff;
}
.results-table th, .results-table td { border: 1px solid #555; padding: 8px; text-align: left; }
.results-table th { background-color: #004a99; color: white; }
.results-table tr:nth-child(even) { background-color: rgba(255,255,255,0.05); }
.percentage-bar-container { background-color: rgba(255,255,255,0.2); border-radius: 5px; }
.percentage-bar { background-color: #007bff; height: 20px; border-radius: 5px; display: flex; align-items: center; justify-content: center; font-size: 12px; color: white; }


/* Responsive Styles */
/* Responsive Styles */
@media (max-width: 800px) {
    .desktop-view {
        display: none;
    }
    .mobile-view {
        display: block;
        text-align: center; /* CHANGED: This now centers all inline content, including the logo */
    }
    .logo-mobile {
        /* text-align: center; -> This rule is removed from here */
        margin-bottom: 15px;
    }
    .container {
        max-width: 95%;
    }
    .results-container {
        flex-direction: column;
    }
   .pitch-wrapper, .table-wrapper {
        min-width: 0; /* Reseteamos el min-width del modo escritorio */
        width: 100%;  /* Hacemos que ocupe el ancho completo de su contenedor */
        box-sizing: border-box;
    }
    .pitch {
        width: 100%;
        max-width: 450px;
    }
}

@media (max-width: 480px) {
    .container {
        margin: 10px;
        padding: 10px;
    }
    h1 { font-size: 1.5em; }
    .controls { flex-direction: column; }
    .pitch { height: 500px; }
    .position { width: 60px; height: 60px; font-size: 9px; }
    .player-name { font-size: 10px; }
}

/* ====================================================== */
/* ============== Estilo de Botones Unificado =========== */
/* ====================================================== */
.rz-button {
    display: inline-block;
    background-color: #004a99;
    color: #efefef;
    padding: 10px 15px;
    border-radius: 5px;
    border: none;
    text-decoration: none;
    cursor: pointer;
    font-size: 1em;
    margin-top: 10px; /* Añadido para separación */
    transition: background-color 0.2s ease-in-out;
}

.rz-button:hover:not(:disabled) {
    background-color: #0056b3;
}

.rz-button:disabled {
    background-color: #ccc;
    cursor: not-allowed;
}

/* Ajuste para los selectores en la página de resultados */
.results-page .custom-select {
    min-width: 0; /* Anulamos el ancho mínimo por defecto */
    width: auto;  /* Dejamos que el ancho se ajuste al contenido */
    padding: 8px 35px 8px 15px; /* Reducimos un poco el padding */
    font-size: 1em; /* Hacemos la fuente un poco más pequeña */
}