/* Variables CSS */
:root {
    --primary-color: #e3350d;
    --secondary-color: #ffcb05;
    --accent-color: #2a75bb;
    --background-color: #f5f5f5;
    --card-bg: #ffffff;
    --text-color: #333333;
    --border-radius: 8px;
    --box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}



.error-message {
    background: #f8d7da;
    color: #721c24;
    padding: 1.5rem;
    border-radius: 8px;
    border: 1px solid #f5c6cb;
    text-align: center;
    margin: 1rem 0;
}

.error-message button {
    margin-top: 1rem;
}


/* Estilos para la pantalla de login */
.login-screen {
    min-height: 100vh;
    min-height: 100dvh; /* Para navegadores modernos */
    height: 100vh;
    height: 100dvh;
    display: flex;
    justify-content: center;
    align-items: center;
    background: linear-gradient(135deg, var(--primary-color), var(--accent-color));
    padding: 1rem;
    overflow: hidden;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100%;
}

.login-container {
    background: white;
    padding: 2rem;
    border-radius: 20px;
    box-shadow: 0 20px 40px rgba(0,0,0,0.1);
    width: 90%;
    max-width: 400px;
    max-height: 95vh;
    text-align: center;
    margin: 0 auto;
    overflow-y: auto;
    overflow-x: hidden;
}

.login-container input{
    padding: 5px !important;
}

.login-container * {
    max-height: none;
    overflow: visible;
    margin-bottom: unset !important;
}

.login-container::-webkit-scrollbar {
    width: 4px;
}

.login-container::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 10px;
}

.login-container::-webkit-scrollbar-thumb {
    background: var(--primary-color);
    border-radius: 10px;
}

.login-container::-webkit-scrollbar-thumb:hover {
    background: #c12a0a;
}

.login-form {
    overflow: visible !important;
    max-height: none !important;
}

.login-container::-webkit-scrollbar {
    display: none;
}

.login-container {
    -ms-overflow-style: none;
    scrollbar-width: none;
}

/* Asegurar que no haya scroll en body */
body.login-active {
    overflow: hidden;
    position: fixed;
    width: 100%;
    height: 100%;
}

.login-header {
    margin-bottom: 2rem;
}

.seasonal-pokemon-large {
    font-size: 4rem;
    animation: bounce 2s infinite;
}

.login-header h1 {
    color: var(--primary-color);
    margin-bottom: 0.5rem;
    font-size: 2.5rem;
}

.login-subtitle {
    color: #666;
    font-size: 1.1rem;
}

.login-form {
    text-align: left;
}

.login-btn {
    width: 100%;
    padding: 1rem;
    font-size: 1.1rem;
    margin-top: 1rem;
    position: relative;
    height: 50px;
}

.btn-loading {
    display: none;
}

.btn-loading.hidden {
    display: none;
}

.btn-text.hidden {
    display: none;
}

.login-help {
    margin: 1.5rem 0;
    border: 1px solid #e0e0e0;
    border-radius: 10px;
    padding: 1rem;
}

.login-help details {
    cursor: pointer;
}

.login-help summary {
    font-weight: bold;
    padding: 0.5rem;
    background-color: #f8f9fa;
    border-radius: 8px;
    list-style: none;
    text-align: center;
}

.login-help summary::-webkit-details-marker {
    display: none;
}

.login-help summary::after {
    content: ' ▶';
    font-size: 0.8em;
    transition: transform 0.3s;
}

.login-help details[open] summary::after {
    transform: rotate(90deg);
}

.test-credentials {
    margin-top: 1rem;
    padding: 1rem;
    background-color: #f8f9fa;
    border-radius: 8px;
    border-left: 4px solid var(--accent-color);
}

.test-credentials p {
    margin: 0.5rem 0;
    font-size: 0.9rem;
    text-align: left;
}

.test-credentials button {
    width: 100%;
    margin-top: 0.5rem;
}

.login-footer {
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid #e0e0e0;
    color: #666;
    font-size: 0.9rem;
}

/* Estilos para la aplicación principal cuando está oculta */
#app-main.hidden {
    display: none;
}

#login-screen.hidden {
    display: none;
}

/* Animaciones */
@keyframes bounce {
    0%, 100% { 
        transform: translateY(0) scale(1); 
    }
    50% { 
        transform: translateY(-10px) scale(1.1); 
    }
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

.login-container {
    animation: fadeIn 0.6s ease-out;
}

/* Estados de carga */
.loading {
    opacity: 0.7;
    pointer-events: none;
}

.loading .btn-text {
    display: none;
}

.loading .btn-loading {
    display: inline-block;
}

/* Responsive mejorado */
@media (max-width: 480px) {
    .login-screen {
        padding-top: 1rem;
    }
    
    .login-container {
        padding: 1.5rem 1rem;
        max-height: 95vh;
        margin: 0.5rem;
    }
    
    .seasonal-pokemon-large {
        font-size: 2.5rem !important;
    }
    
    .login-header h1 {
        font-size: 1.8rem !important;
    }
    
    .login-subtitle {
        font-size: 0.9rem !important;
    }
}

@media (max-height: 700px) and (max-width: 480px) {
    .login-container {
        padding: 1rem 0.75rem;
        max-height: 98vh;
    }
    
    .seasonal-pokemon-large {
        font-size: 2rem !important;
        margin-bottom: 0.5rem !important;
    }
    
    .login-header h1 {
        font-size: 1.5rem !important;
        margin-bottom: 0.25rem !important;
    }
    
    .form-group {
        margin-bottom: 0.75rem;
    }
    
    .login-footer {
        margin-top: 1rem;
        padding-top: 0.5rem;
        font-size: 0.8rem;
    }
}

/* Prevenir zoom en iOS */
@media (max-width: 480px) {
    input, select, textarea {
        font-size: 16px !important; /* Previene zoom en iOS */
    }
}

/* Reset y base */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* Estilos para la sección de registro */
.register-section {
    text-align: center;
    padding-top: 10px;
    border-top: 1px solid #dee2e6;
}

.register-label {
    margin-bottom: 10px;
    color: #6c757d;
    font-size: 14px;
}

.signup-btn {
    width: 100%;
    padding: 10px;
    background-color: #6c757d;
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 14px;
}

.signup-btn:hover {
    background-color: #5a6268;
}

/* Indicador de fuerza de contraseña */
.password-strength {
    margin-top: 10px;
}

.strength-bar {
    width: 100%;
    height: 5px;
    background-color: #e9ecef;
    border-radius: 3px;
    overflow: hidden;
}

.strength-fill {
    height: 100%;
    width: 0%;
    transition: all 0.3s ease;
}

#signup-password-strength-text {
    font-size: 12px;
    color: #6c757d;
    display: block;
    margin-top: 5px;
}

/* Estilos para la información del usuario */
#user-info {
    display: inline-block;
    text-align: left;
}

#current-user {
    font-weight: bold;
    color: #f7f3f3;
}

.user-role {
    font-size: 12px;
    color: #f7f3f3;
    margin-top: 2px;
}

#user-menu {
    display: flex;
    align-items: center;
    gap: 10px;
}

body {
    font-family: 'Arial', sans-serif;
    background-color: var(--background-color);
    color: var(--text-color);
    line-height: 1.6;
}

/* Header */
#main-header {
    background: linear-gradient(135deg, var(--primary-color), var(--accent-color));
    color: white;
    padding: 1rem 0;
    box-shadow: var(--box-shadow);
}

.header-content {
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 2rem;
}

#app-title {
    font-size: 2rem;
    font-weight: bold;
}

#seasonal-pokemon {
    font-size: 3rem;
    text-align: center;
}

#main-nav ul {
    list-style: none;
    display: flex;
    gap: 2rem;
}

#main-nav a {
    color: white;
    text-decoration: none;
    padding: 0.5rem 1rem;
    border-radius: var(--border-radius);
    transition: background-color 0.3s;
}

#main-nav a:hover {
    background-color: rgba(255,255,255,0.2);
}

/* Main content */
#main-content {
    max-width: 1200px;
    margin: 2rem auto;
    padding: 0 2rem;
}

.view {
    background: var(--card-bg);
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
    padding: 2rem;
}

.hidden {
    display: none;
}

/* Cards y grids */
.card {
    background: var(--card-bg);
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
    padding: 1.5rem;
    margin-bottom: 1rem;
}

.grid {
    display: grid;
    gap: 1rem;
}

.grid-2 {
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
}

.grid-3 {
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
}

/* Tablas */
.table-container {
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
    margin: 1rem 0;
}

th, td {
    padding: 0.75rem;
    text-align: left;
    border-bottom: 1px solid #ddd;
}

th {
    background-color: var(--accent-color);
    color: white;
    font-weight: bold;
}

tr:hover {
    background-color: #f5f5f5;
}

/* Formularios */
.form-group {
    margin-bottom: 1rem;
}

label {
    display: block;
    margin: 5px;
    font-weight: bold;
}

input, select, textarea {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid #ddd;
    border-radius: var(--border-radius);
    font-size: 1rem;
}

button {
    background-color: var(--primary-color);
    color: white;
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: var(--border-radius);
    cursor: pointer;
    font-size: 1rem;
    transition: background-color 0.3s;
}

button:hover {
    background-color: #c12a0a;
}

button.secondary {
    background-color: var(--accent-color);
}

button.secondary:hover {
    background-color: #1f5a9a;
}

/* Modales */
.modal {
    display: flex !important;
    justify-content: center;
}

.modal-dialog {
    margin: auto;
    max-width: 90%;
    width: 600px;
    transform: none !important;
}

.modal-content {
    border-radius: var(--border-radius);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    border: none;
    opacity: 1 !important;
}

.modal-header {
    display: flex;
    justify-content: between;
    align-items: center;
    margin-bottom: 1rem;
}

.close-modal {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
}

/* Estados y utilidades */
.success { background-color: #d4edda; color: #155724; }
.warning { background-color: #fff3cd; color: #856404; }
.error { background-color: #f8d7da; color: #721c24; }
.info { background-color: #d1ecf1; color: #0c5460; }

.badge {
    display: inline-block;
    padding: 0.25rem 0.5rem;
    border-radius: 20px;
    font-size: 0.875rem;
    font-weight: bold;
}

.badge.admin { background-color: #dc3545; color: white; }
.badge.maestro { background-color: #ffc107; color: black; }
.badge.entrenador { background-color: #28a745; color: white; }

/* Responsive */
@media (max-width: 768px) {
    .header-content {
        flex-direction: column;
        gap: 1rem;
    }
    
    #main-nav ul {
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .grid-2, .grid-3 {
        grid-template-columns: 1fr;
    }
}

/* Estilos para el login mejorado */
.login-help {
    margin: 1rem 0;
    border: 1px solid #ddd;
    border-radius: var(--border-radius);
    padding: 0.5rem;
}

.login-help details {
    cursor: pointer;
}

.login-help summary {
    font-weight: bold;
    padding: 0.5rem;
    background-color: #f5f5f5;
    border-radius: 4px;
}

.test-credentials {
    margin-top: 1rem;
    padding: 1rem;
    background-color: #f8f9fa;
    border-radius: var(--border-radius);
    border-left: 4px solid var(--accent-color);
}

.test-credentials p {
    margin: 0.5rem 0;
    font-size: 0.9rem;
}

/* Estilos para el Pokémon estacional en el login */
.seasonal-pokemon {
    animation: bounce 2s infinite;
}

@keyframes bounce {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.1); }
}

/* Mejoras para el modal de login */
.modal-content .modal-header {
    text-align: center;
}

.modal-content .modal-header h3 {
    margin-bottom: 0.5rem;
}

/* Estilos mejorados para los logs */
.log-filters {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    margin-bottom: 1.5rem;
    padding: 1.5rem;
    background-color: #f8f9fa;
    border-radius: var(--border-radius);
    border: 1px solid #e9ecef;
}

.filter-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.filter-group label {
    font-weight: bold;
    font-size: 0.9rem;
    color: #495057;
    margin-bottom: 0.25rem;
}

.filter-actions {
    display: flex;
    align-items: flex-end;
}

.filter-actions button {
    width: 100%;
}

.logs-info {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    margin-bottom: 1.5rem;
    padding: 1rem;
    background: linear-gradient(135deg, #e8f4fd, #d1ecf1);
    border-radius: var(--border-radius);
    border-left: 4px solid var(--accent-color);
}

.logs-info p {
    margin: 0;
    font-size: 0.9rem;
    display: flex;
    flex-direction: column;
}

.logs-info strong {
    margin-bottom: 0.25rem;
    color: #495057;
}

#filtered-logs.warning-text {
    color: #dc3545;
    font-weight: bold;
    background-color: #f8d7da;
    padding: 0.1rem 0.5rem;
    border-radius: 4px;
}

#active-filters.filters-active {
    color: #28a745;
    font-weight: bold;
    background-color: #d4edda;
    padding: 0.1rem 0.5rem;
    border-radius: 4px;
}

/* Mejoras para la tabla de logs */
.log-timestamp {
    font-size: 0.85rem;
    white-space: nowrap;
}

.log-date {
    font-weight: bold;
    color: var(--text-color);
}

.log-time {
    color: #6c757d;
    font-size: 0.8rem;
    font-family: 'Courier New', monospace;
}

.user-info {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.user-info .username {
    font-weight: 500;
    color: #495057;
}

.log-action {
    padding: 0.3rem 0.6rem;
    border-radius: 15px;
    font-size: 0.75rem;
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    display: inline-block;
    min-width: 80px;
    text-align: center;
}

.log-action.create { 
    background-color: #d1e7dd; 
    color: #0f5132; 
    border: 1px solid #badbcc;
}
.log-action.update { 
    background-color: #fff3cd; 
    color: #664d03; 
    border: 1px solid #ffecb5;
}
.log-action.delete { 
    background-color: #f8d7da; 
    color: #721c24; 
    border: 1px solid #f1aeb5;
}
.log-action.score_change { 
    background-color: #cfe2ff; 
    color: #052c65; 
    border: 1px solid #9ec5fe;
}
.log-action.login { 
    background-color: #d1ecf1; 
    color: #0c5460; 
    border: 1px solid #bee5eb;
}
.log-action.logout { 
    background-color: #e2e3e5; 
    color: #383d41; 
    border: 1px solid #d6d8db;
}

.log-target {
    padding: 0.3rem 0.6rem;
    border-radius: 8px;
    font-size: 0.8rem;
    background-color: #f8f9fa;
    border: 1px solid #dee2e6;
    color: #495057;
    display: inline-block;
    min-width: 70px;
    text-align: center;
}

.log-details {
    max-width: 300px;
    word-wrap: break-word;
    line-height: 1.4;
    color: #495057;
}

.log-ip {
    background-color: #f8f9fa;
    padding: 0.3rem 0.5rem;
    border-radius: 4px;
    font-family: 'Courier New', monospace;
    font-size: 0.8rem;
    color: #6c757d;
    border: 1px solid #e9ecef;
}

/* Estados vacíos */
.empty-state, .no-results {
    text-align: center;
    padding: 3rem 2rem;
    color: #6c757d;
}

.empty-state p, .no-results p {
    margin: 0.5rem 0;
    font-size: 1.1rem;
}

.empty-state p:last-child, .no-results p:last-child {
    font-size: 0.9rem;
    font-style: italic;
}

/* Responsive para logs */
@media (max-width: 768px) {
    .log-filters {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .logs-info {
        grid-template-columns: 1fr;
        gap: 0.75rem;
    }
    
    #logs-table {
        font-size: 0.8rem;
    }
    
    .log-action, .log-target {
        font-size: 0.7rem;
        padding: 0.2rem 0.4rem;
        min-width: 60px;
    }
    
    .log-details {
        max-width: 200px;
        font-size: 0.8rem;
    }
}

@media (max-width: 480px) {
    .log-timestamp {
        font-size: 0.75rem;
    }
    
    .user-info {
        gap: 0.1rem;
    }
    
    .log-details {
        max-width: 150px;
        font-size: 0.75rem;
    }
    
    .empty-state, .no-results {
        padding: 2rem 1rem;
    }
}

/* Efectos hover para mejor UX */
.log-action:hover {
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    transition: all 0.2s ease;
}

#logs-table tbody tr:hover {
    background-color: #f8f9fa;
    transition: background-color 0.2s ease;
}

/* Estilos para las tarjetas de torneos */
.tournament-card {
    border: 2px solid #e9ecef;
    transition: all 0.3s ease;
    position: relative;
}

.tournament-card:hover {
    border-color: var(--accent-color);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.tournament-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 1rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid #e9ecef;
}

.tournament-title h3 {
    margin: 0 0 0.25rem 0;
    color: var(--text-color);
    font-size: 1.25rem;
}

.tournament-modality {
    background-color: var(--accent-color);
    color: white;
    padding: 0.2rem 0.5rem;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: bold;
}

.tournament-status {
    padding: 0.3rem 0.8rem;
    border-radius: 15px;
    font-size: 0.8rem;
    font-weight: bold;
    text-transform: uppercase;
}

.tournament-status.scheduled {
    background-color: #fff3cd;
    color: #856404;
    border: 1px solid #ffeaa7;
}

.tournament-status.active {
    background-color: #d1ecf1;
    color: #0c5460;
    border: 1px solid #bee5eb;
}

.tournament-status.completed {
    background-color: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.tournament-details {
    margin-bottom: 1rem;
}

.detail-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.4rem 0;
    border-bottom: 1px solid #f8f9fa;
}

.detail-item:last-child {
    border-bottom: none;
}

.detail-item strong {
    color: #495057;
    font-size: 0.9rem;
}

.participant-count {
    background-color: var(--primary-color);
    color: white;
    padding: 0.2rem 0.5rem;
    border-radius: 10px;
    font-size: 0.8rem;
    font-weight: bold;
}

.creator {
    color: var(--accent-color);
    font-weight: 500;
}

.creation-date, .update-date {
    color: #6c757d;
    font-size: 0.85rem;
}

.tournament-standings-preview {
    background-color: #f8f9fa;
    border-radius: 8px;
    padding: 1rem;
    margin-bottom: 1rem;
    border-left: 4px solid var(--secondary-color);
}

.tournament-standings-preview h4 {
    margin: 0 0 0.75rem 0;
    color: var(--text-color);
    font-size: 1rem;
    text-align: center;
}

.standing-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.5rem;
    margin-bottom: 0.25rem;
    background-color: white;
    border-radius: 6px;
    border: 1px solid #e9ecef;
}

.standing-item.first-place {
    background: linear-gradient(135deg, #fff3cd, #ffeaa7);
    border-color: #ffd43b;
}

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

.position {
    font-weight: bold;
    color: var(--primary-color);
    min-width: 30px;
}

.standing-item .username {
    flex: 1;
    margin: 0 0.5rem;
    font-weight: 500;
}

.points {
    background-color: var(--accent-color);
    color: white;
    padding: 0.2rem 0.5rem;
    border-radius: 8px;
    font-size: 0.8rem;
    font-weight: bold;
    min-width: 50px;
    text-align: center;
}

.tournament-actions {
    display: grid;
    grid-template-columns: 1fr auto auto;
    gap: 0.5rem;
    margin-top: 1rem;
}

.tournament-actions button {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.5rem 0.75rem;
    font-size: 0.85rem;
    white-space: nowrap;
}

.tournament-actions .icon {
    font-size: 1rem;
}

/* Estilos para el modal de confirmación de eliminación */
.error-message {
    background-color: #f8d7da;
    color: #721c24;
    padding: 0.75rem;
    border-radius: 6px;
    border-left: 4px solid #dc3545;
    margin: 1rem 0;
}

.tournament-info {
    background-color: #f8f9fa;
    padding: 1rem;
    border-radius: 6px;
    margin: 1rem 0;
    border: 1px solid #e9ecef;
}

.tournament-info p {
    margin: 0.25rem 0;
    font-size: 0.9rem;
}

.warning-text {
    color: #dc3545;
    font-weight: bold;
    text-align: center;
    padding: 0.5rem;
    background-color: #fff3f3;
    border-radius: 4px;
    border: 1px solid #f8d7da;
}

/* Responsive para torneos */
@media (max-width: 768px) {
    .tournament-header {
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .tournament-actions {
        grid-template-columns: 1fr;
    }
    
    .tournament-actions button {
        justify-content: flex-start;
    }
    
    .detail-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.25rem;
    }
}

@media (max-width: 480px) {
    .tournament-title h3 {
        font-size: 1.1rem;
    }
    
    .tournament-modality {
        font-size: 0.7rem;
    }
    
    .tournament-status {
        font-size: 0.7rem;
        padding: 0.2rem 0.6rem;
    }
    
    .standing-item {
        padding: 0.4rem;
        font-size: 0.8rem;
    }
}

/* Estilos para la sección de jornadas y marcadores */
.journeys-container {
    max-height: 70vh;
    overflow-y: auto;
    padding-right: 0.5rem;
}

.journey-card {
    background: #f8f9fa;
    border-radius: 10px;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    border: 2px solid #e9ecef;
}

.journey-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    padding-bottom: 0.75rem;
    border-bottom: 2px solid #dee2e6;
}

.journey-header h4 {
    margin: 0;
    color: var(--primary-color);
    font-size: 1.2rem;
}

.journey-date {
    background: var(--accent-color);
    color: white;
    padding: 0.3rem 0.8rem;
    border-radius: 15px;
    font-size: 0.85rem;
    font-weight: bold;
}

.matches-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 1rem;
}

.match-card {
    background: white;
    border-radius: 8px;
    padding: 1rem;
    border: 2px solid #e9ecef;
    transition: all 0.3s ease;
}

.match-card.completed {
    border-color: #28a745;
    background: linear-gradient(135deg, #f8fff9, #e8f5e8);
}

.match-card.pending {
    border-color: #ffc107;
    background: linear-gradient(135deg, #fffdf0, #fff3cd);
}

.match-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid #dee2e6;
}

.match-id {
    font-size: 0.8rem;
    color: #6c757d;
    font-family: 'Courier New', monospace;
}

.match-modality {
    background: #6c757d;
    color: white;
    padding: 0.2rem 0.5rem;
    border-radius: 10px;
    font-size: 0.7rem;
    font-weight: bold;
}

.match-teams {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    gap: 1rem;
    align-items: center;
    margin-bottom: 1rem;
}

.team {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
}

.home-team {
    text-align: right;
}

.away-team {
    text-align: left;
}

.team-name {
    font-weight: bold;
    color: var(--text-color);
    font-size: 0.9rem;
}

.score-input {
    width: 60px;
    height: 40px;
    text-align: center;
    font-size: 1.1rem;
    font-weight: bold;
    border: 2px solid #ced4da;
    border-radius: 6px;
    background: white;
}

.score-input:focus {
    border-color: var(--accent-color);
    outline: none;
    box-shadow: 0 0 0 3px rgba(42, 117, 187, 0.1);
}

.score-input:disabled {
    background-color: #f8f9fa;
    color: #495057;
    border-color: #e9ecef;
}

.score-input.locked {
    background-color: #e9ecef;
    color: #6c757d;
    border-color: #dee2e6;
}

.vs-separator {
    text-align: center;
    font-weight: bold;
    color: #6c757d;
    font-size: 0.9rem;
}

.special-points-section {
    text-align: center;
    margin-bottom: 1rem;
    padding: 0.75rem;
    background: #f8f9fa;
    border-radius: 6px;
    border: 1px solid #e9ecef;
}

.special-points-section label {
    font-weight: bold;
    margin-right: 0.5rem;
    color: #495057;
}

.special-points-select {
    padding: 0.4rem 0.8rem;
    border: 2px solid #ced4da;
    border-radius: 6px;
    background: white;
    font-size: 0.9rem;
}

.special-points-select:focus {
    border-color: var(--accent-color);
    outline: none;
}

.special-points-select:disabled {
    background-color: #f8f9fa;
}

.match-status {
    text-align: center;
    margin-bottom: 1rem;
    padding: 0.75rem;
    border-radius: 6px;
}

.match-result {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.result-text {
    font-weight: bold;
    color: var(--primary-color);
    font-size: 1.1rem;
}

.special-points-badge {
    background: var(--secondary-color);
    color: #000;
    padding: 0.3rem 0.6rem;
    border-radius: 12px;
    font-size: 0.8rem;
    font-weight: bold;
}

.winner {
    font-weight: bold;
    color: #28a745;
    font-size: 0.9rem;
}

.pending-text {
    color: #ffc107;
    font-weight: bold;
    font-style: italic;
}

.match-actions {
    display: flex;
    gap: 0.5rem;
    justify-content: center;
    flex-wrap: wrap;
}

.match-actions button {
    padding: 0.5rem 0.75rem;
    font-size: 0.8rem;
    display: flex;
    align-items: center;
    gap: 0.3rem;
}

/* Estilos para las estadísticas */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1rem;
}

.stat-card {
    background: white;
    border-radius: 8px;
    padding: 1.5rem;
    border: 2px solid #e9ecef;
}

.stat-card h4 {
    margin: 0 0 1rem 0;
    color: var(--primary-color);
    text-align: center;
    border-bottom: 2px solid #e9ecef;
    padding-bottom: 0.5rem;
}

.stat-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.5rem 0;
    border-bottom: 1px solid #f8f9fa;
}

.stat-item:last-child {
    border-bottom: none;
}

.stat-label {
    color: #495057;
    font-weight: 500;
}

.stat-value {
    background: var(--accent-color);
    color: white !important;
    padding: 0.2rem 0.6rem;
    border-radius: 10px;
    font-weight: bold;
    font-size: 0.9rem;
}

.leader-item, .offense-item, .defense-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem;
    margin-bottom: 0.5rem;
    border-radius: 6px;
    border: 1px solid #e9ecef;
}

.leader-item.gold {
    background: linear-gradient(135deg, #fff3cd, #ffd54f);
    border-color: #ffc107;
}

.leader-item.silver {
    background: linear-gradient(135deg, #e9ecef, #b0bec5);
    border-color: #6c757d;
}

.leader-item.bronze {
    background: linear-gradient(135deg, #f8d7da, #e0a6ab);
    border-color: #dc3545;
}

.offense-item {
    background: linear-gradient(135deg, #d1ecf1, #a6e0e9);
    border-color: #17a2b8;
}

.defense-item {
    background: linear-gradient(135deg, #d4edda, #a6d5b0);
    border-color: #28a745;
}

.leader-position, .offense-rank, .defense-rank {
    font-weight: bold;
    color: var(--primary-color);
    min-width: 30px;
}

.leader-name, .offense-name, .defense-name {
    flex: 1;
    margin: 0 0.5rem;
    font-weight: 500;
}

.leader-points, .offense-points, .defense-points {
    background: var(--accent-color);
    color: white;
    padding: 0.2rem 0.5rem;
    border-radius: 8px;
    font-size: 0.8rem;
    font-weight: bold;
    min-width: 50px;
    text-align: center;
}

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

/* Responsive */
@media (max-width: 768px) {
    .matches-grid {
        grid-template-columns: 1fr;
    }
    
    .match-teams {
        grid-template-columns: 1fr;
        gap: 0.5rem;
    }
    
    .home-team, .away-team {
        text-align: center;
        flex-direction: row;
        justify-content: space-between;
    }
    
    .vs-separator {
        order: -1;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
    }
    
    .match-actions {
        flex-direction: column;
    }
    
    .match-actions button {
        justify-content: center;
    }
}

@media (max-width: 480px) {
    .journey-card {
        padding: 1rem;
    }
    
    .match-card {
        padding: 0.75rem;
    }
    
    .score-input {
        width: 50px;
        height: 35px;
        font-size: 1rem;
    }
    
    .special-points-section {
        padding: 0.5rem;
    }
}

/* Estilos para tablas de posición */
.modal-content.x-large {
    max-width: 95%;
    width: 95%;
    max-height: 90vh;
}

.standings-container {
    padding: 1rem 0;
}

.standings-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid #e9ecef;
}

.standings-header h4 {
    margin: 0;
    color: var(--primary-color);
    font-size: 1.3rem;
}

.standings-info {
    display: flex;
    gap: 1rem;
    align-items: center;
}

.tournament-modality, .participants-count, .journey-date, .matches-count {
    background: var(--accent-color);
    color: white;
    padding: 0.3rem 0.8rem;
    border-radius: 15px;
    font-size: 0.8rem;
    font-weight: bold;
}

.standings-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
}

.standings-table th {
    background: linear-gradient(135deg, var(--primary-color), var(--accent-color));
    color: white;
    padding: 0.75rem;
    text-align: center;
    font-weight: bold;
    border: none;
}

.standings-table td {
    padding: 0.6rem;
    border-bottom: 1px solid #e9ecef;
    text-align: center;
}

.standings-table .center {
    text-align: center;
}

.standings-table tr.top-three {
    background: linear-gradient(135deg, #fff9e6, #fff3cd);
}

.standings-table tr:hover {
    background-color: #f8f9fa;
}

.position-cell {
    text-align: center;
}

.position {
    display: inline-block;
    width: 30px;
    height: 30px;
    line-height: 30px;
    border-radius: 50%;
    font-weight: bold;
    font-size: 0.8rem;
}

.position.first {
    background: linear-gradient(135deg, #ffd700, #ffed4e);
    color: #000;
}

.position.second {
    background: linear-gradient(135deg, #c0c0c0, #e0e0e0);
    color: #000;
}

.position.third {
    background: linear-gradient(135deg, #cd7f32, #e89d5d);
    color: #000;
}

.position:not(.first):not(.second):not(.third) {
    background: #f8f9fa;
    color: #495057;
}

.participant-cell {
    text-align: left;
}

.participant-info {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.participant-info .username {
    font-weight: 500;
    color: var(--text-color);
}

.wins {
    color: #28a745;
    font-weight: bold;
}

.draws {
    color: #ffc107;
    font-weight: bold;
}

.losses {
    color: #dc3545;
    font-weight: bold;
}

.points-for {
    color: #17a2b8;
    font-weight: bold;
}

.points-against {
    color: #6c757d;
    font-weight: bold;
}

.difference.positive {
    color: #28a745;
    font-weight: bold;
}

.difference.negative {
    color: #dc3545;
    font-weight: bold;
}

.total-points {
    background: var(--primary-color);
    color: white;
    font-weight: bold;
    border-radius: 15px;
    margin: 0 0.5rem;
}

.performance {
    position: relative;
}

.performance-bar {
    position: relative;
    height: 20px;
    background: #e9ecef;
    border-radius: 10px;
    overflow: hidden;
}

.performance-fill {
    height: 100%;
    background: linear-gradient(135deg, #28a745, #20c997);
    transition: width 0.3s ease;
}

.performance-text {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.7rem;
    font-weight: bold;
    color: #000;
    z-index: 1;
}

/* Estilos para selector de jornadas */
.journey-standings-container {
    padding: 1rem 0;
}

.journey-selector {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1.5rem;
    padding: 1rem;
    background: #f8f9fa;
    border-radius: 8px;
    border: 1px solid #e9ecef;
}

.journey-selector label {
    font-weight: bold;
    color: #495057;
    margin: 0;
}

.journey-selector select {
    flex: 1;
    max-width: 200px;
}

.journey-standings th {
    background: linear-gradient(135deg, #6c757d, #868e96);
}

/* Resumen de Duelos por jornada */
.journey-matches-summary {
    margin-top: 2rem;
    padding: 1.5rem;
    background: #f8f9fa;
    border-radius: 8px;
    border: 1px solid #e9ecef;
}

.journey-matches-summary h5 {
    margin: 0 0 1rem 0;
    color: var(--primary-color);
    text-align: center;
}

.matches-list {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 0.75rem;
}

.match-summary {
    background: white;
    padding: 1rem;
    border-radius: 6px;
    border: 2px solid #e9ecef;
    transition: all 0.3s ease;
}

.match-summary.completed {
    border-color: #28a745;
    background: linear-gradient(135deg, #f8fff9, #e8f5e8);
}

.match-summary.pending {
    border-color: #ffc107;
    background: linear-gradient(135deg, #fffdf0, #fff3cd);
}

.match-summary .match-teams {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
}

.match-summary .team {
    font-weight: 500;
    color: var(--text-color);
}

.match-summary .score {
    font-weight: bold;
    color: var(--primary-color);
    font-size: 1.1rem;
}

.match-result {
    text-align: center;
    font-size: 0.85rem;
}

.match-result .winner {
    color: #28a745;
    font-weight: bold;
}

.match-result .special-points {
    color: #ffc107;
    font-size: 0.8rem;
}

.match-status.pending {
    text-align: center;
    color: #ffc107;
    font-weight: bold;
    font-style: italic;
}

/* Responsive para tablas de posición */
@media (max-width: 768px) {
    .modal-content.x-large {
        max-width: 98%;
        width: 98%;
        margin: 1%;
    }
    
    .standings-header {
        flex-direction: column;
        gap: 1rem;
        text-align: center;
    }
    
    .standings-info {
        flex-wrap: wrap;
        justify-content: center;
    }
    
    .standings-table {
        font-size: 0.8rem;
    }
    
    .standings-table th,
    .standings-table td {
        padding: 0.4rem;
    }
    
    .performance-bar {
        height: 16px;
    }
    
    .performance-text {
        font-size: 0.6rem;
    }
    
    .journey-selector {
        flex-direction: column;
        align-items: stretch;
    }
    
    .journey-selector select {
        max-width: none;
    }
    
    .matches-list {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 480px) {
    .standings-table {
        font-size: 0.7rem;
    }
    
    .participant-info {
        flex-direction: column;
        gap: 0.25rem;
        align-items: flex-start;
    }
    
    .position {
        width: 25px;
        height: 25px;
        line-height: 25px;
        font-size: 0.7rem;
    }
}
/* Estilos para la gestión de usuarios mejorada */
.header-actions {
    display: flex;
    gap: 1rem;
    align-items: center;
}

.warning-card {
    border-left: 4px solid #ffc107;
    background: linear-gradient(135deg, #fffdf0, #fff3cd);
    margin-bottom: 1.5rem;
}

.warning-card h3 {
    color: #856404;
    margin-bottom: 0.5rem;
}

.locked {
    background-color: #fff3f3 !important;
}

.locked-user-card {
    background: white;
    border: 2px solid #f8d7da;
    border-radius: 8px;
    padding: 1rem;
    margin-bottom: 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.locked-user-card .user-info {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.lock-info {
    display: flex;
    flex-direction: column;
    gap: 0.1rem;
    color: #6c757d;
    font-size: 0.8rem;
}

.password-strength {
    margin: 1rem 0;
}

.strength-bar {
    height: 8px;
    background-color: #e9ecef;
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 0.5rem;
}

.strength-fill {
    height: 100%;
    width: 0%;
    transition: all 0.3s ease;
    border-radius: 4px;
}

#password-strength-text {
    font-size: 0.8rem;
    font-weight: 500;
}

.user-main-info {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.user-main-info .badge {
    align-self: flex-start;
}

/* Mejoras responsive */
@media (max-width: 768px) {
    .header-actions {
        flex-direction: column;
        align-items: stretch;
    }
    
    .locked-user-card {
        flex-direction: column;
        align-items: stretch;
        gap: 1rem;
    }
    
    .user-actions {
        display: flex;
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .user-actions button {
        width: 100%;
        justify-content: center;
    }
}



.modal-title {
  font-weight: 600;
  font-size: 1.4rem;
}

.modal-body {
  padding: 25px;
}

.tournament-section {
  background: white;
  border-radius: 8px;
  padding: 20px;
  margin-bottom: 20px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
  border-left: 4px solid #667eea;
}

.section-title {
  font-weight: 600;
  color: #2d3748;
  margin-bottom: 15px;
  font-size: 1.1rem;
  display: flex;
  align-items: center;
}

.section-title i {
  margin-right: 8px;
  color: #667eea;
}

.participants-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 12px;
  margin: 15px 0;
}

.participant-card {
  background: #f7fafc;
  border: 1px solid #e2e8f0;
  border-radius: 6px;
  padding: 12px;
  transition: all 0.3s ease;
}

.participant-card:hover {
  background: #edf2f7;
  border-color: #cbd5e0;
  transform: translateY(-2px);
}

.participant-name {
  font-weight: 600;
  color: #2d3748;
  margin-bottom: 4px;
}

.participant-team {
  font-size: 0.85rem;
  color: #718096;
}

.btn-modern {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  border: none;
  padding: 10px 20px;
  border-radius: 6px;
  font-weight: 600;
  transition: all 0.3s ease;
  margin: 5px;
}

.btn-modern:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
  color: white;
}

.btn-secondary-modern {
  background: #e2e8f0;
  color: #4a5568;
  border: none;
  padding: 10px 20px;
  border-radius: 6px;
  font-weight: 600;
  transition: all 0.3s ease;
  margin: 5px;
}

.btn-secondary-modern:hover {
  background: #cbd5e0;
  transform: translateY(-1px);
}

.form-select-modern {
  border: 2px solid #e2e8f0;
  border-radius: 6px;
  padding: 10px;
  font-size: 14px;
  transition: border-color 0.3s ease;
  width: 100%;
}

.form-select-modern:focus {
  border-color: #667eea;
  box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
  outline: none;
}

.nav-tabs-modern {
  border-bottom: 2px solid #e2e8f0;
  margin: 20px 0;
}

.nav-tab-modern {
  padding: 12px 24px;
  background: none;
  border: none;
  color: #718096;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  border-bottom: 3px solid transparent;
  margin-right: 5px;
}

.nav-tab-modern.active {
  color: #667eea;
  border-bottom: 3px solid #667eea;
}

.nav-tab-modern:hover {
  color: #4a5568;
  background: #f7fafc;
  border-radius: 6px 6px 0 0;
}

.action-buttons {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 20px;
}

.badge-team {
  background: #edf2f7;
  color: #4a5568;
  padding: 4px 8px;
  border-radius: 4px;
  font-size: 0.75rem;
  font-weight: 600;
}

/* Estados de hover y focus mejorados */
.participant-card:focus-within {
  border-color: #667eea;
  box-shadow: 0 0 0 2px rgba(102, 126, 234, 0.2);
}

/* Responsive */
@media (max-width: 768px) {
  .participants-grid {
    grid-template-columns: 1fr;
  }
  
  .action-buttons {
    flex-direction: column;
  }
  
  .btn-modern, .btn-secondary-modern {
    width: 100%;
    margin: 5px 0;
  }
}


/* ===== RESPONSIVE HEADER & HAMBURGER MENU ===== */

/* Header principal mejorado */
.header-content {
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 2rem;
    position: relative;
}

.header-brand {
    display: flex;
    align-items: center;
    gap: 1rem;
    z-index: 1001;
}

#app-title {
    font-size: 1.5rem;
    font-weight: bold;
    margin: 0;
}

#seasonal-pokemon {
    font-size: 2rem;
}

/* Botón hamburguesa */
.nav-toggle {
    display: none;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    width: 40px;
    height: 40px;
    background: transparent;
    border: 2px solid rgba(255, 255, 255, 0.8);
    border-radius: 6px;
    cursor: pointer;
    padding: 0;
    z-index: 1001;
    transition: all 0.3s ease;
}

.nav-toggle:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 1);
}

.hamburger-line {
    width: 24px;
    height: 3px;
    background: white;
    margin: 2px 0;
    transition: all 0.3s ease;
    border-radius: 2px;
}

/* Navegación principal */
.main-nav {
    display: flex;
    align-items: center;
}

.nav-list {
    list-style: none;
    display: flex;
    gap: 1.5rem;
    align-items: center;
    margin: 0;
    padding: 0;
}

.nav-link {
    color: white;
    text-decoration: none;
    padding: 0.5rem 1rem;
    border-radius: var(--border-radius);
    transition: background-color 0.3s;
    font-weight: 500;
    white-space: nowrap;
}

.nav-link:hover {
    background-color: rgba(255, 255, 255, 0.2);
}

/* User menu en navegación */
.user-menu-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.5rem;
    border-radius: var(--border-radius);
    background: rgba(255, 255, 255, 0.1);
}

.user-info-compact {
    display: flex;
    flex-direction: column;
    gap: 0.1rem;
}

#current-user {
    font-weight: bold;
    color: #f7f3f3;
    font-size: 0.9rem;
}

.user-role {
    font-size: 0.75rem;
    color: #f7f3f3;
}

#logout-btn {
    color: white;
    text-decoration: none;
    padding: 0.4rem 0.8rem;
    border-radius: var(--border-radius);
    background: rgba(255, 255, 255, 0.2);
    transition: background-color 0.3s;
    font-size: 0.9rem;
    white-space: nowrap;
}

#logout-btn:hover {
    background-color: rgba(255, 255, 255, 0.3);
}

/* ===== MEDIA QUERIES PARA RESPONSIVE ===== */

/* Tablet */
@media (max-width: 1024px) {
    .header-content {
        padding: 1rem;
    }
    
    #app-title {
        font-size: 1.3rem;
    }
    
    #seasonal-pokemon {
        font-size: 1.8rem;
    }
    
    .nav-list {
        gap: 1rem;
    }
    
    .nav-link {
        padding: 0.4rem 0.8rem;
        font-size: 0.9rem;
    }
}

/* Móvil - Menú hamburguesa */
@media (max-width: 768px) {
    .header-content {
        padding: 0.75rem 1rem;
        flex-wrap: wrap;
    }
    
    .header-brand {
        flex: 1;
    }
    
    #app-title {
        font-size: 1.2rem;
    }
    
    #seasonal-pokemon {
        font-size: 1.5rem;
    }
    
    /* Mostrar botón hamburguesa */
    .nav-toggle {
        display: flex;
    }
    
    /* Ocultar navegación por defecto en móvil */
    .main-nav {
        position: absolute;
        top: 100%;
        left: 0;
        width: 100%;
        background: linear-gradient(135deg, var(--primary-color), var(--accent-color));
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
        transform: translateY(-10px);
        opacity: 0;
        visibility: hidden;
        transition: all 0.3s ease;
        z-index: 1000;
    }
    
    /* Menú activo (abierto) */
    .main-nav.nav-active {
        transform: translateY(0);
        opacity: 1;
        visibility: visible;
    }
    
    .nav-list {
        flex-direction: column;
        gap: 0;
        padding: 1rem 0;
        width: 100%;
    }
    
    .nav-list li {
        width: 100%;
        border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    }
    
    .nav-list li:last-child {
        border-bottom: none;
    }
    
    .nav-link {
        display: block;
        padding: 1rem 1.5rem;
        width: 100%;
        border-radius: 0;
        font-size: 1rem;
    }
    
    .nav-link:hover {
        background-color: rgba(255, 255, 255, 0.15);
    }
    
    /* User menu en móvil */
    .user-menu-item {
        flex-direction: column;
        gap: 0.5rem;
        padding: 1rem 1.5rem;
        background: rgba(255, 255, 255, 0.05);
        border-radius: 0;
    }
    
    .user-info-compact {
        align-items: center;
        text-align: center;
    }
    
    #logout-btn {
        width: 100%;
        text-align: center;
        padding: 0.75rem;
    }
    
    /* Animación del botón hamburguesa */
    .nav-toggle-active .hamburger-line:nth-child(1) {
        transform: rotate(45deg) translate(6px, 6px);
    }
    
    .nav-toggle-active .hamburger-line:nth-child(2) {
        opacity: 0;
    }
    
    .nav-toggle-active .hamburger-line:nth-child(3) {
        transform: rotate(-45deg) translate(6px, -6px);
    }
}

/* Móvil pequeño */
@media (max-width: 480px) {
    .header-content {
        padding: 0.5rem;
        display: inline-flex;
        flex-direction: row;
        justify-content: space-between;
        width: 100%;
    }
    
    .header-brand {
        gap: 0.5rem;
    }
    
    #app-title {
        font-size: 1.1rem;
    }
    
    #seasonal-pokemon {
        font-size: 1.3rem;
    }
    
    .nav-toggle {
        width: 35px;
        height: 35px;
    }
    
    .hamburger-line {
        width: 20px;
        height: 2px;
    }
    
    .nav-link {
        padding: 0.875rem 1rem;
        font-size: 0.95rem;
    }
    
    .user-menu-item {
        padding: 0.875rem 1rem;
    }
}

/* Asegurar que el contenido principal no se solape con el header */
#main-content {
    margin-top: 0;
}

/* Mejoras para el main content en móvil */
@media (max-width: 768px) {
    #main-content {
        padding: 0 1rem;
        margin: 1rem auto;
    }

    .header-content {
        padding: 0.5rem;
        display: inline-flex;
        flex-direction: row;
        justify-content: space-between;
        width: 100%;
    }
    
    .view {
        padding: 1.5rem 1rem;
        margin-bottom: 1rem;
    }
}



/* Prevenir scroll cuando el menú está abierto */
body.menu-open {
    overflow: hidden;
}

/* Mejoras de accesibilidad */
.nav-toggle:focus {
    outline: 2px solid rgba(255, 255, 255, 0.8);
    outline-offset: 2px;
}

.nav-link:focus {
    outline: 2px solid rgba(255, 255, 255, 0.8);
    outline-offset: -2px;
}

/* Estilos para la ruleta */
.roulette-config-section {
    transition: all 0.3s ease;
}

.roulette-preview-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 20px;
}

.roulette-wheel {
    width: 200px;
    height: 200px;
    border-radius: 50%;
    background: #f8f9fa;
    border: 4px solid #495057;
    position: relative;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    transition: transform 3s cubic-bezier(0.2, 0.8, 0.3, 1);
    overflow: hidden;
}

.roulette-segments {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    position: relative;
}

.roulette-segment {
    position: absolute;
    width: 100%;
    height: 100%;
    clip-path: polygon(50% 50%, 50% 0%, 100% 0%, 100% 100%, 50% 50%);
    transform-origin: center;
    display: flex;
    align-items: center;
    justify-content: center;
}

.segment-content {
    text-align: center;
    color: white;
    font-weight: bold;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.5);
    width: 80px;
    position: absolute;
    top: 10px;
    left: 60px;
    font-size: 0.7rem;
}

.roulette-pointer {
    position: absolute;
    top: -10px;
    left: 50%;
    transform: translateX(-50%);
    color: #dc3545;
    font-size: 24px;
    font-weight: bold;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.5);
    z-index: 10;
}

.roulette-item {
    border-left: 4px solid #ffc107;
    transition: all 0.3s ease;
}

.roulette-item:hover {
    border-left-color: #007bff;
    background-color: #f8f9fa;
}

.no-items {
    text-align: center;
    color: #6c757d;
    font-style: italic;
    padding: 20px;
}

/* Animación de giro */
@keyframes roulette-spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(1080deg); } /* 3 vueltas completas */
}

.roulette-wheel.spinning {
    animation: roulette-spin 3s cubic-bezier(0.2, 0.8, 0.3, 1) forwards;
}

/* Resultado de la ruleta */
.roulette-result {
    padding: 20px;
}

.result-icon {
    font-size: 4rem;
    margin-bottom: 1rem;
}

/* Responsive */
@media (max-width: 768px) {
    .roulette-wheel {
        width: 150px;
        height: 150px;
    }
    
    .segment-content {
        font-size: 0.6rem;
        width: 60px;
        left: 45px;
        top: 5px;
    }
    
    .roulette-item .row > div {
        margin-bottom: 5px;
    }
}

/* Estilos para la leyenda del campeón */
.champion-banner {
    background: linear-gradient(135deg, #ffd700, #ffed4e, #ffd700);
    border: 3px solid #b8860b;
    border-radius: 15px;
    padding: 20px;
    margin: 20px 0;
    text-align: center;
    box-shadow: 0 8px 25px rgba(255, 215, 0, 0.4);
    position: relative;
    overflow: hidden;
    animation: championGlow 2s infinite alternate;
}

.champion-banner::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: linear-gradient(45deg, transparent, rgba(255,255,255,0.3), transparent);
    transform: rotate(45deg);
    animation: championShine 3s infinite;
}

@keyframes championGlow {
    0% {
        box-shadow: 0 8px 25px rgba(255, 215, 0, 0.4);
    }
    100% {
        box-shadow: 0 12px 35px rgba(255, 215, 0, 0.7);
    }
}

@keyframes championShine {
    0% {
        transform: rotate(45deg) translateX(-100%);
    }
    100% {
        transform: rotate(45deg) translateX(100%);
    }
}

.champion-title {
    font-size: 2.5em;
    font-weight: bold;
    color: #8b4513;
    text-shadow: 2px 2px 4px rgba(139, 69, 19, 0.3);
    margin-bottom: 10px;
    font-family: 'Arial Black', sans-serif;
}

.champion-name {
    font-size: 3em;
    font-weight: bold;
    color: #d4af37;
    text-shadow: 3px 3px 6px rgba(0, 0, 0, 0.5);
    margin: 15px 0;
    font-family: 'Impact', sans-serif;
    letter-spacing: 2px;
}

.champion-subtitle {
    font-size: 1.3em;
    color: #8b4513;
    font-weight: bold;
    margin-bottom: 15px;
}

.champion-trophy {
    font-size: 4em;
    margin: 10px 0;
    animation: bounce 1s infinite alternate;
}

@keyframes bounce {
    0% {
        transform: translateY(0);
    }
    100% {
        transform: translateY(-10px);
    }
}

.champion-stats {
    background: rgba(255, 255, 255, 0.8);
    border-radius: 10px;
    padding: 15px;
    margin: 15px auto;
    max-width: 300px;
    border: 2px dashed #b8860b;
}

.champion-stat {
    display: flex;
    justify-content: space-between;
    margin: 8px 0;
    font-weight: bold;
    color: #8b4513;
}

/* ===== ESTILOS CORREGIDOS PARA PLAYOFFS Y BADGES ===== */

/* Contenedor de partidos de playoffs */
.match-row {
    display: flex;
    align-items: center;
    padding: 1rem;
    margin-bottom: 0.75rem;
    border: 2px solid #e9ecef;
    border-radius: 10px;
    background: white;
    transition: all 0.3s ease;
    min-height: 80px; /* Altura mínima consistente */
}

.match-row:hover {
    border-color: var(--accent-color);
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.match-row.playoff-match-completed {
    background: linear-gradient(135deg, #f8fff9, #e8f5e8);
    border-color: #28a745;
}

/* Columnas del partido - CORREGIDAS */
.match-row .col-md-4,
.match-row .col-md-2 {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 50px; /* Altura consistente */
}

/* Jugadores locales y visitantes */
.match-row .col-md-4:first-child {
    justify-content: flex-end;
    padding-right: 1rem;
}

.match-row .col-md-4:last-child {
    justify-content: flex-start;
    padding-left: 1rem;
}

/* Contenedor de jugador con badge */
.player-container {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    max-width: 100%;
    flex-wrap: nowrap;
}

/* Badges de ganador - CORREGIDOS */
.winner-badge {
    background: linear-gradient(135deg, #28a745, #20c997);
    color: white;
    border: 2px solid #1e7e34;
    padding: 0.3rem 0.6rem;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: bold;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
    flex-shrink: 0; /* Evita que se encoja */
    min-width: 40px; /* Ancho mínimo consistente */
    text-align: center;
    line-height: 1.2;
}

/* Badge de partido completado */
.match-completed-badge {
    background: linear-gradient(135deg, #28a745, #20c997);
    color: white;
    padding: 0.4rem 0.8rem;
    border-radius: 15px;
    font-size: 0.75rem;
    font-weight: bold;
    border: 2px solid #1e7e34;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
    flex-shrink: 0;
    min-width: 120px;
    text-align: center;
}

/* Nombres de jugadores */
.player-name {
    font-weight: 600;
    color: var(--text-color);
    font-size: 1rem;
    margin: 0;
    line-height: 1.2;
    word-break: break-word;
    min-width: 0; /* Permite que se ajuste */
}

/* Marcador */
.match-score {
    font-size: 1.5rem;
    font-weight: bold;
    color: var(--primary-color);
    text-align: center;
    margin: 0;
    line-height: 1.2;
    min-width: 80px; /* Ancho consistente para el marcador */
}

/* Separador VS */
.vs-separator {
    color: #6c757d;
    font-weight: bold;
    font-size: 1rem;
    text-align: center;
    margin: 0;
    line-height: 1.2;
}

/* Botones de acción */
.playoff-action-btn {
    padding: 0.5rem 1rem;
    font-size: 0.85rem;
    font-weight: 600;
    border: 2px solid;
    border-radius: 8px;
    transition: all 0.3s ease;
    min-width: 140px; /* Ancho consistente para botones */
    text-align: center;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.3rem;
}

.btn-update {
    background: linear-gradient(135deg, #28a745, #20c997);
    color: white;
    border-color: #1e7e34;
}

.btn-update:hover {
    background: linear-gradient(135deg, #218838, #1e7e34);
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(40, 167, 69, 0.3);
}

.btn-edit {
    background: linear-gradient(135deg, #ffc107, #fd7e14);
    color: black;
    border-color: #e0a800;
}

.btn-edit:hover {
    background: linear-gradient(135deg, #e0a800, #d39e00);
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(255, 193, 7, 0.3);
}

.btn-disabled {
    background: #6c757d;
    color: white;
    border-color: #545b62;
    opacity: 0.6;
    cursor: not-allowed;
}

.btn-disabled:hover {
    transform: none;
    box-shadow: none;
}

/* Badge de esperando jugadores */
.waiting-badge {
    background: linear-gradient(135deg, #6c757d, #868e96);
    color: white;
    padding: 0.5rem 1rem;
    border-radius: 8px;
    font-size: 0.8rem;
    font-weight: bold;
    border: 2px solid #545b62;
    min-width: 160px;
    text-align: center;
}

/* Header de la ronda de playoffs */
.playoff-round-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 1.5rem;
    background: linear-gradient(135deg, var(--accent-color), #2a75bb);
    color: white;
    border-radius: 10px 10px 0 0;
    margin-bottom: 0;
}

.playoff-round-title {
    font-size: 1.2rem;
    font-weight: bold;
    margin: 0;
}

.playoff-round-badge {
    background: rgba(255, 255, 255, 0.2);
    color: white;
    padding: 0.4rem 0.8rem;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: bold;
    border: 2px solid rgba(255, 255, 255, 0.3);
}

/* Estados responsivos */
@media (max-width: 768px) {
    .match-row {
        flex-direction: column;
        gap: 1rem;
        padding: 1rem;
        text-align: center;
    }
    
    .match-row .col-md-4:first-child,
    .match-row .col-md-4:last-child {
        justify-content: center;
        padding: 0;
    }
    
    .player-container {
        justify-content: center;
    }
    
    .playoff-action-btn,
    .waiting-badge {
        min-width: 100%;
    }
    
    .match-completed-badge {
        min-width: 100px;
        font-size: 0.7rem;
    }
}

@media (max-width: 480px) {
    .player-name {
        font-size: 0.9rem;
    }
    
    .match-score {
        font-size: 1.25rem;
    }
    
    .winner-badge {
        font-size: 0.7rem;
        padding: 0.2rem 0.4rem;
        min-width: 35px;
    }
}

/* Estilos para la sección del campeón */
.champion-section {
    background: linear-gradient(135deg, #fff3cd, #ffeaa7) !important;
    border: 2px solid #ffd43b !important;
    border-radius: 10px !important;
    padding: 12px !important;
    margin: 12px 0 !important;
    text-align: center !important;
    box-shadow: 0 4px 8px rgba(255, 212, 59, 0.3) !important;
    animation: championGlow 2s infinite alternate !important;
}

@keyframes championGlow {
    0% {
        box-shadow: 0 4px 8px rgba(255, 212, 59, 0.3);
    }
    100% {
        box-shadow: 0 6px 12px rgba(255, 212, 59, 0.5);
    }
}

.champion-section strong {
    color: #856404 !important;
    font-size: 1.1em !important;
}

.champion-section .champion-name {
    color: #d4af37 !important;
    font-weight: bold !important;
    font-size: 1.2em !important;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.1) !important;
}

.champion-section .trophy {
    font-size: 1.8em !important;
    animation: bounce 1s infinite alternate !important;
}

@keyframes bounce {
    0% {
        transform: translateY(0);
    }
    100% {
        transform: translateY(-5px);
    }
}

/* Estilos para el buscador de torneos */
#tournament-search {
    border-radius: 0 0 0 0;
}

#tournament-search:focus {
    border-color: #667eea;
    box-shadow: 0 0 0 0.2rem rgba(102, 126, 234, 0.25);
}

.card-body{
    padding: .02rem .02rem !important;
}

.input-group-text {
    background-color: #f8f9fa;
    border-right: none;
}

.input-group .form-control {
    border-left: none;
}

.input-group .btn-outline-secondary {
    border-left: none;
    border-radius: 0 0.375rem 0.375rem 0;
}

/* Efectos de búsqueda */
.card[style*="display: none"] {
    animation: fadeOut 0.3s ease-out;
}

@keyframes fadeOut {
    from { opacity: 1; }
    to { opacity: 0; }
}

.card[style*="display: block"] {
    animation: fadeIn 0.3s ease-in;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Botón flotante para volver arriba */
.scroll-to-top {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 50px;
    height: 50px;
    background: linear-gradient(135deg, var(--primary-color), var(--accent-color));
    color: white;
    border: none;
    border-radius: 50%;
    font-size: 1.5rem;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
    transition: all 0.3s ease;
    z-index: 1000;
    display: none;
    align-items: center;
    justify-content: center;
}

.scroll-to-top:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.4);
    background: linear-gradient(135deg, var(--accent-color), var(--primary-color));
}

.scroll-to-top:active {
    transform: translateY(-1px);
}

/* Efectos de animación */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.scroll-to-top.show {
    display: flex;
    animation: fadeInUp 0.3s ease-out;
}

/* Responsive */
@media (max-width: 768px) {
    .scroll-to-top {
        bottom: 20px;
        right: 20px;
        width: 45px;
        height: 45px;
        font-size: 1.3rem;
    }
}

@media (max-width: 480px) {
    .scroll-to-top {
        bottom: 15px;
        right: 15px;
        width: 40px;
        height: 40px;
        font-size: 1.2rem;
    }
}


/* Estilos para el progreso del usuario */
.progress-stat {
    padding: 10px;
}

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

.stat-label {
    font-size: 0.9em;
    color: #6c757d;
}

.stats-placeholder {
    display: flex;
    justify-content: space-around;
    margin: 20px 0;
}

/* Estilos para jornadas */
.journeys-grid {
    display: grid;
    gap: 10px;
}

.journey-card {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    background: #f8f9fa;
}

.journey-header {
    display: flex;
    align-items: center;
    gap: 10px;
}

.journey-info {
    flex: 1;
    margin: 0 15px;
}

/* Estilos para jornadas pendientes */
.pending-journeys {
    display: grid;
    gap: 8px;
}

.pending-journey-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px;
    background: #fff3cd;
    border: 1px solid #ffeaa7;
    border-radius: 5px;
}

/* Responsive */
@media (max-width: 768px) {
    .journey-card {
        flex-direction: column;
        gap: 10px;
        text-align: center;
    }
    
    .stats-placeholder {
        flex-direction: column;
        gap: 15px;
    }
}

/* Estilos para el paginador */
#tournaments-pagination {
    border-top: 1px solid #dee2e6;
    padding-top: 1rem;
}

.pagination-info {
    font-size: 0.875rem;
}

.page-size-selector {
    min-width: 140px;
}

/* Mejora visual para paginación activa */
.page-item.active .page-link {
    background-color: #007bff;
    border-color: #007bff;
}

.page-link {
    color: #007bff;
    cursor: pointer;
}

.page-link:hover {
    color: #0056b3;
}

/* Responsive */
@media (max-width: 768px) {
    #tournaments-pagination .d-flex {
        flex-direction: column;
        gap: 1rem;
        text-align: center;
    }
    
    .pagination-info {
        order: 3;
    }
}