/* Variables CSS - Paleta Elegante y Minimalista */
:root {
    --primary-color: #1e40af;        /* Azul suave principal */
    --secondary-color: #64748b;      /* Gris azulado secundario */
    --accent-color: #3b82f6;         /* Azul suave para acentos */
    --accent-hover: #2563eb;         /* Azul hover suave */
    --accent-light: #dbeafe;         /* Azul muy claro para fondos */
    --text-primary: #1f2937;         /* Negro suave para texto principal */
    --text-secondary: #6b7280;       /* Gris para texto secundario */
    --text-muted: #9ca3af;           /* Gris claro para texto muted */
    --background-light: #ffffff;      /* Blanco puro para fondo */
    --background-dark: #f8fafc;       /* Gris muy claro para fondos */
    --background-card: #ffffff;       /* Blanco para tarjetas */
    --border-color: #e2e8f0;         /* Gris muy claro para bordes */
    --success-color: #059669;         /* Verde suave para éxito */
    --warning-color: #d97706;         /* Naranja suave para warning */
    --danger-color: #dc2626;          /* Rojo suave para errores */
    --info-color: #0284c7;           /* Azul info suave */
    --sidebar-width: 250px;
    --sidebar-collapsed-width: 60px;
}

/* Estilos para fotos de perfil */
.profile-picture-wrapper {
    position: relative;
    display: inline-block;
}

.profile-picture-wrapper.profile-picture-loading::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    z-index: 10;
}

.profile-picture-wrapper.profile-picture-loading::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 30px;
    height: 30px;
    border: 3px solid var(--accent-light);
    border-top: 3px solid var(--accent-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    z-index: 11;
}

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

.profile-picture {
    width: 150px;
    height: 150px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid var(--border-color);
    transition: all 0.3s ease;
}

.profile-picture-placeholder {
    width: 150px;
    height: 150px;
    border-radius: 50%;
    background: var(--background-dark);
    border: 3px solid var(--border-color);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    font-size: 3rem;
    transition: all 0.3s ease;
}

.profile-picture-placeholder:hover {
    background: var(--accent-light);
    border-color: var(--accent-color);
    color: var(--accent-color);
}

/* Avatar con iniciales */
.initials-avatar {
    width: 100%;
    height: 100%;
    background: var(--accent-color);
    color: var(--background-light);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 3rem;
    font-weight: 700;
    border-radius: 50%;
    text-transform: uppercase;
    letter-spacing: 2px;
    transition: all 0.3s ease;
}

.initials-avatar:hover {
    background: var(--accent-hover);
}

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

body {
    font-family: 'Inter', 'Segoe UI', -apple-system, BlinkMacSystemFont, sans-serif;
    background-color: var(--background-light);
    color: var(--text-primary);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    line-height: 1.6;
    overflow-x: hidden;
}

/* Layout principal */
.main-container {
    display: flex;
    min-height: 100vh;
}

/* Sidebar */
.sidebar {
    width: var(--sidebar-width);
    background: var(--background-light);
    color: var(--text-primary);
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    z-index: 1000;
    transition: all 0.3s ease;
    overflow-y: auto;
    border-right: 1px solid var(--border-color);
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.03);
}

.sidebar-header {
    padding: 1.5rem 1.5rem;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: var(--background-light);
}

.logo {
    display: flex;
    align-items: center;
    font-size: 1.3rem;
    font-weight: 600;
    color: var(--text-primary);
}

.logo i {
    font-size: 1.8rem;
    margin-right: 0.75rem;
    color: var(--accent-color);
}

.logo-link {
    display: flex;
    align-items: center;
    text-decoration: none;
    color: inherit;
    transition: opacity 0.3s ease;
}

.logo-link:hover {
    opacity: 0.8;
    text-decoration: none;
    color: inherit;
}

.logo-img {
    width: 180px;
    height: 80px;
    object-fit: contain;
    border-radius: 4px;
}

.sidebar .nav-link {
    color: var(--text-secondary);
    padding: 1rem 1.5rem;
    display: flex;
    align-items: center;
    transition: all 0.3s ease;
    border-radius: 0;
    font-weight: 500;
    margin: 0.25rem 0.5rem;
    border-radius: 10px;
}

.sidebar .nav-link:hover {
    background-color: var(--accent-light);
    color: var(--accent-color);
    transform: translateX(3px);
}

.sidebar .nav-link.active {
    background-color: var(--accent-color);
    color: var(--background-light);
    font-weight: 600;
}

.sidebar .nav-link i {
    width: 24px;
    margin-right: 1rem;
    font-size: 1.2rem;
    text-align: center;
}

/* Contenido principal */
.main-content {
    flex: 1;
    margin-left: var(--sidebar-width);
    padding: 2rem;
    transition: margin-left 0.3s ease;
    background-color: var(--background-light);
    min-height: 100vh;
    overflow-x: hidden;
    width: calc(100vw - var(--sidebar-width));
}

/* Overlay para móvil */
.sidebar-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 999;
    display: none;
}

/* Botón toggle para móvil */
.sidebar-toggle-mobile {
    position: fixed;
    top: 1rem;
    left: 1rem;
    z-index: 1001;
    border-radius: 12px;
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: var(--accent-color);
    color: var(--background-light);
    border: none;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    transition: all 0.3s ease;
}

.sidebar-toggle-mobile:hover {
    background-color: var(--accent-hover);
    transform: scale(1.05);
}

/* Página de login y registro */
.auth-container {
    height: 100vh;
    width: 100vw;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--background-light);
    padding: 0;
    margin: 0;
    overflow: hidden;
    position: fixed;
    top: 0;
    left: 0;
}

.auth-card {
    background: var(--background-light);
    border-radius: 0;
    box-shadow: none;
    overflow: hidden;
    width: 100%;
    height: 100vh;
    border: none;
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 0;
}

.auth-left {
    background: var(--background-dark);
    color: var(--text-primary);
    padding: 4rem 3rem;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    position: relative;
    overflow: hidden;
    height: 100vh;
    border-right: 1px solid var(--border-color);
    grid-column: 1;
}

.auth-left h1 {
    font-size: 2.5rem;
    margin-bottom: 1rem;
    font-weight: 700;
    color: var(--text-primary);
    position: relative;
    z-index: 1;
}

.auth-left p {
    font-size: 1.1rem;
    opacity: 0.9;
    margin-bottom: 2rem;
    color: var(--text-secondary);
    position: relative;
    z-index: 1;
}

.auth-left .features {
    list-style: none;
    padding: 0;
    position: relative;
    z-index: 1;
}

.auth-left .features li {
    padding: 0.75rem 0;
    display: flex;
    align-items: center;
    font-weight: 500;
}

.auth-left .features i {
    margin-right: 0.75rem;
    color: var(--accent-color);
    font-size: 1.1rem;
}

.auth-logo {
    width: 160px;
    height: 60px;
    object-fit: contain;
    border-radius: 8px;
    margin-bottom: 1rem;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
}

.auth-logo:hover {
    transform: scale(1.05);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.15);
}

.auth-right {
    padding: 2rem 3rem;
    background-color: var(--background-light);
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100vh;
    grid-column: 2;
    overflow: hidden;
}

/* Para la página de registro, necesitamos que el contenido empiece desde arriba */
.auth-right.register {
    align-items: flex-start;
    padding-top: 1rem;
    overflow-y: auto;
}

.auth-form {
    width: 100%;
    max-width: 100%;
}

/* Solo para registro necesitamos padding-top */
.auth-right.register .auth-form {
    padding-top: 1rem;
    max-height: none;
    overflow-y: visible;
    padding-right: 0.5rem;
}

/* Ajustes específicos para móvil - formulario centrado */
@media (max-width: 991.98px) {
    .auth-right.register {
        align-items: center;
        padding-top: 2rem;
        overflow-y: auto;
    }
    
    .auth-right.register .auth-form {
        padding-top: 0;
        padding-right: 0;
        max-height: calc(100vh - 4rem);
        overflow-y: auto;
    }
}

.auth-form h2 {
    color: var(--text-primary);
    margin-bottom: 2rem;
    text-align: center;
    font-weight: 600;
    font-size: 1.8rem;
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
    font-size: 0.95rem;
}

.form-control {
    border: 2px solid var(--border-color);
    border-radius: 8px;
    padding: 0.875rem 1rem;
    font-size: 1rem;
    transition: all 0.3s ease;
    background-color: var(--background-light);
    color: var(--text-primary);
}

.form-control:focus {
    border-color: var(--accent-color);
    box-shadow: 0 0 0 0.2rem rgba(37, 99, 235, 0.25);
    background-color: var(--background-light);
}

.form-control::placeholder {
    color: var(--text-muted);
}

.btn-primary {
    background: var(--accent-color);
    border: none;
    border-radius: 8px;
    padding: 0.5rem 1.5rem;
    font-weight: 600;
    font-size: 0.9rem;
    transition: all 0.3s ease;
    color: var(--background-light);
    box-shadow: 0 2px 8px rgba(37, 99, 235, 0.2);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3);
    background: var(--accent-hover);
}

.btn-outline-primary {
    border: 2px solid var(--accent-color);
    color: var(--accent-color);
    border-radius: 8px;
    padding: 0.5rem 1.5rem;
    font-weight: 600;
    font-size: 0.9rem;
    transition: all 0.3s ease;
    background-color: transparent;
}

/* Asegurar la misma altura para botones de filtros */
.btn-equal-height {
    padding-top: 0.5rem !important;
    padding-bottom: 0.5rem !important;
}

.btn-outline-primary:hover {
    background-color: var(--accent-color);
    color: var(--background-light);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3);
}

.auth-links {
    text-align: center;
    margin-top: 2rem;
}

.auth-links a {
    color: var(--accent-color);
    text-decoration: none;
    font-weight: 600;
    transition: all 0.3s ease;
}

.auth-links a:hover {
    color: var(--accent-hover);
    text-decoration: underline;
}

/* Footer */
.footer {
    background-color: var(--background-light) !important;
    color: var(--text-primary);
    margin-top: auto;
    border-top: 1px solid var(--border-color);
}

.footer span {
    color: #000000 !important;
}

/* Responsive Design */
@media (max-width: 991.98px) {
    .sidebar {
        width: var(--sidebar-collapsed-width);
        transform: translateX(0);
    }
    
    .sidebar-header {
        padding: 1rem 0.5rem;
        justify-content: center;
    }
    
    .logo-text {
        display: none;
    }
    
    .logo i {
        margin-right: 0;
        font-size: 1.5rem;
    }
    
    .logo-img {
        width: 40px;
        height: 40px;
        margin-right: 0;
    }
    
    .sidebar .nav-link {
        padding: 1rem 0.5rem;
        margin: 0.25rem 0.5rem;
        justify-content: center;
    }
    
    .sidebar .nav-link span {
        display: none;
    }
    
    .sidebar .nav-link i {
        margin-right: 0;
        font-size: 1.3rem;
    }
    
    .sidebar-toggle-mobile {
        display: none;
    }
    
    .sidebar-overlay {
        display: none;
    }
    
    .main-content {
        margin-left: var(--sidebar-collapsed-width);
        padding: 1rem;
        width: calc(100vw - var(--sidebar-collapsed-width));
        overflow-x: hidden;
    }
    
    .footer {
        margin-left: var(--sidebar-collapsed-width);
        width: calc(100vw - var(--sidebar-collapsed-width));
    }
    
    .auth-card {
        grid-template-columns: 1fr;
        grid-template-rows: 1fr;
        height: 100vh;
    }
    
    .auth-left {
        display: none; /* Ocultar bloque informativo en tablet */
    }
    
    .auth-right {
        padding: 2rem 1.5rem;
        height: 100vh;
        grid-column: 1;
        grid-row: 1;
        overflow: hidden;
        max-height: none;
        align-items: center;
        justify-content: center;
    }
}

@media (max-width: 767.98px) {
    /* Colocar icono al lado del texto en KPIs de torneos (móvil) */
    .tournament-stats-row .card-body .d-flex {
        flex-direction: row !important;
        align-items: center !important;
        gap: 0.5rem;
    }
    .tournament-stats-row .card-body .d-flex .stat-item {
        display: flex;
        flex-direction: column;
        justify-content: center;
    }
    .sidebar {
        width: var(--sidebar-collapsed-width);
    }
    
    .main-content {
        margin-left: var(--sidebar-collapsed-width);
        padding: 1rem 0.5rem 0.5rem 0.5rem;
        width: calc(100vw - var(--sidebar-collapsed-width));
        overflow-x: hidden;
    }
    
    .footer {
        margin-left: var(--sidebar-collapsed-width);
        width: calc(100vw - var(--sidebar-collapsed-width));
    }
    
    .auth-container {
        padding: 0;
        height: 100vh;
        overflow: hidden;
    }
    
    .auth-card {
        margin: 0;
        height: 100vh;
        grid-template-columns: 1fr;
        grid-template-rows: 1fr;
    }
    
    .auth-left {
        display: none; /* Ocultar bloque informativo en móvil */
    }
    
    .auth-right {
        padding: 1.5rem 1rem;
        height: 100vh;
        grid-column: 1;
        grid-row: 1;
        overflow: hidden;
        max-height: none;
        align-items: center;
        justify-content: center;
    }
    
    /* Ajustes específicos para registro en móvil */
    .auth-right.register {
        align-items: flex-start;
        padding-top: 1rem;
        overflow-y: auto;
    }
    
    .auth-right.register .auth-form {
        padding-top: 0;
        padding-right: 0;
        max-height: calc(100vh - 2rem);
        overflow-y: auto;
    }
}

@media (max-width: 575.98px) {
    .sidebar {
        width: var(--sidebar-collapsed-width);
    }
    
    .main-content {
        margin-left: var(--sidebar-collapsed-width);
        padding: 1rem 0.5rem 0.5rem 0.5rem;
        width: calc(100vw - var(--sidebar-collapsed-width));
        overflow-x: hidden;
    }
    
    .footer {
        margin-left: 0px;
        width: 390px;
    }
    
    .auth-left {
        display: none; /* Ocultar bloque informativo en pantallas muy pequeñas */
    }
    
    .auth-right {
        padding: 1rem 0.75rem;
        height: 100vh;
        grid-column: 1;
        grid-row: 1;
        overflow: hidden;
        max-height: none;
        align-items: center;
        justify-content: center;
    }
    
    /* Ajustes específicos para registro en pantallas muy pequeñas */
    .auth-right.register {
        align-items: flex-start;
        padding-top: 0.5rem;
        overflow-y: auto;
    }
    
    .auth-right.register .auth-form {
        padding-top: 0;
        padding-right: 0;
        max-height: calc(100vh - 1rem);
        overflow-y: auto;
    }
    
    .btn-primary,
    .btn-outline-primary {
        width: 100%;
    }
}

/* Animaciones */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.auth-card {
    animation: fadeInUp 0.6s ease-out;
}

/* Estadísticas en dashboard */
.stat-item h3 {
    font-size: 2rem;
    font-weight: bold;
    margin-bottom: 0.25rem;
}

.stat-item small {
    font-size: 0.875rem;
    opacity: 0.8;
}

/* Cards de estadísticas - Estilo elegante y suave */
.card.bg-primary,
.card.bg-success,
.card.bg-warning,
.card.bg-info {
    border: none;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    border-radius: 16px;
    overflow: hidden;
    background: var(--background-card) !important;
    border: 1px solid var(--border-color);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.card.bg-primary {
    border-left: 4px solid var(--primary-color);
    color: var(--text-primary) !important;
}

.card.bg-primary .stat-item h3 {
    color: var(--primary-color);
}

.card.bg-primary i {
    color: var(--primary-color);
    opacity: 0.7;
}

.card.bg-success {
    border-left: 4px solid var(--success-color);
    color: var(--text-primary) !important;
}

.card.bg-success .stat-item h3 {
    color: var(--success-color);
}

.card.bg-success i {
    color: var(--success-color);
    opacity: 0.7;
}

.card.bg-warning {
    border-left: 4px solid var(--warning-color);
    color: var(--text-primary) !important;
}

.card.bg-warning .stat-item h3 {
    color: var(--warning-color);
}

.card.bg-warning i {
    color: var(--warning-color);
    opacity: 0.7;
}

.card.bg-info {
    border-left: 4px solid var(--info-color);
    color: var(--text-primary) !important;
}

.card.bg-info .stat-item h3 {
    color: var(--info-color);
}

.card.bg-info i {
    color: var(--info-color);
    opacity: 0.7;
}

.card.bg-primary:hover,
.card.bg-success:hover,
.card.bg-warning:hover,
.card.bg-info:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

/* Botones de acciones rápidas - Estilo elegante */
.btn-outline-primary,
.btn-outline-success,
.btn-outline-info,
.btn-outline-secondary {
    transition: all 0.3s ease;
    border-width: 2px;
    border-radius: 12px;
    font-weight: 500;
    padding: 0.75rem 1rem;
    background-color: var(--background-card);
    border-color: var(--border-color);
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.btn-outline-primary {
    border-color: var(--accent-color);
    color: var(--accent-color);
}

.btn-outline-primary:hover {
    background-color: var(--accent-light);
    color: var(--accent-color);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.15);
    border-color: var(--accent-color);
}

.btn-outline-success {
    border-color: var(--success-color);
    color: var(--success-color);
}

.btn-outline-success:hover {
    background-color: rgba(5, 150, 105, 0.1);
    color: var(--success-color);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(5, 150, 105, 0.15);
    border-color: var(--success-color);
}

.btn-outline-info {
    border-color: var(--info-color);
    color: var(--info-color);
}

.btn-outline-info:hover {
    background-color: rgba(2, 132, 199, 0.1);
    color: var(--info-color);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(2, 132, 199, 0.15);
    border-color: var(--info-color);
}

.btn-outline-secondary {
    border-color: var(--text-muted);
    color: var(--text-muted);
}

.btn-outline-secondary:hover {
    background-color: rgba(156, 163, 175, 0.1);
    color: var(--text-secondary);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(156, 163, 175, 0.15);
    border-color: var(--text-secondary);
}

/* Mejoras para responsive en dashboard */
@media (max-width: 991.98px) {
    .main-content {
        padding: 1rem;
    }
    
    .card-body {
        padding: 1rem;
    }
    
    .stat-item h3 {
        font-size: 1.5rem;
    }
    
    /* Asegurar que no haya scroll horizontal */
    .container-fluid {
        padding-left: 0.5rem;
        padding-right: 0.5rem;
        max-width: 100%;
        overflow-x: hidden;
    }
    
    .row {
        margin-left: 0;
        margin-right: 0;
    }
    
    .col-12, .col-xl-3, .col-md-6, .col-lg-3 {
        padding-left: 0.25rem;
        padding-right: 0.25rem;
    }
}

@media (max-width: 767.98px) {
    /* Colocar icono al lado del texto en KPIs del dashboard (móvil) */
    .dashboard-stats-row .card-body .d-flex {
        flex-direction: row !important;
        align-items: center !important;
        gap: 0.5rem;
    }
    .dashboard-stats-row .card-body .d-flex .stat-item {
        display: flex;
        flex-direction: column;
        justify-content: center;
    }

    .main-content {
        padding: 1rem 0.5rem 0.5rem 0.5rem;
    }
    
    .card-body {
        padding: 0.75rem;
    }
    
    .btn-outline-primary,
    .btn-outline-success,
    .btn-outline-info,
    .btn-outline-secondary {
        padding: 0.5rem 0.75rem;
        font-size: 0.85rem;
    }
    
    .btn-outline-primary i,
    .btn-outline-success i,
    .btn-outline-info i,
    .btn-outline-secondary i {
        font-size: 1.5rem !important;
    }
    
    /* Ajustes adicionales para móvil */
    .container-fluid {
        padding-left: 0.25rem;
        padding-right: 0.25rem;
    }
    
    .d-flex.justify-content-between {
        flex-direction: column;
        align-items: flex-start !important;
    }
    
    .text-end {
        text-align: left !important;
        margin-top: 0.5rem;
    }

    /* Mantener icono al lado del texto en stats de clubs (vista móvil) */
    .club-stats-row .card-body .d-flex.club-stat-item {
        flex-direction: row !important;
        align-items: center !important;
        gap: 0.5rem;
    }
    .club-stats-row .card-body .d-flex.club-stat-item .stat-item {
        display: flex;
        flex-direction: column;
        justify-content: center;
    }
}

@media (max-width: 767.98px) {
    /* Mantener icono al lado del texto en stats de entrenos (vista móvil) */
    .training-stats-row .card-body .d-flex.justify-content-between {
        flex-direction: row !important;
        align-items: center !important;
        gap: 0.5rem;
    }
    .training-stats-row .card-body .d-flex.justify-content-between .stat-item {
        display: flex;
        flex-direction: column;
        justify-content: center;
    }
}

/* Cards generales - Estilo elegante */
.card {
    border: 1px solid var(--border-color);
    border-radius: 16px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
    transition: all 0.3s ease;
    background-color: var(--background-card);
}

.card:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    transform: translateY(-1px);
}

.card-header {
    background-color: var(--background-card);
    border-bottom: 1px solid var(--border-color);
    border-radius: 16px 16px 0 0 !important;
    font-weight: 500;
    color: var(--text-primary);
    padding: 1.25rem 1.5rem;
}

/* Alertas personalizadas */
.alert {
    border-radius: 8px;
    border: none;
    font-weight: 500;
}

.alert-success {
    background-color: rgba(16, 185, 129, 0.1);
    color: var(--success-color);
    border-left: 4px solid var(--success-color);
}

.alert-danger {
    background-color: rgba(239, 68, 68, 0.1);
    color: var(--danger-color);
    border-left: 4px solid var(--danger-color);
}

.alert-warning {
    background-color: rgba(245, 158, 11, 0.1);
    color: var(--warning-color);
    border-left: 4px solid var(--warning-color);
}

.alert-info {
    background-color: rgba(37, 99, 235, 0.1);
    color: var(--accent-color);
    border-left: 4px solid var(--accent-color);
}

/* Formularios mejorados */
.form-check-input:checked {
    background-color: var(--accent-color);
    border-color: var(--accent-color);
}

.form-check-input:focus {
    border-color: var(--accent-color);
    box-shadow: 0 0 0 0.2rem rgba(37, 99, 235, 0.25);
}

/* Utilidades */
.text-primary {
    color: var(--text-primary) !important;
}

.bg-primary {
    background-color: var(--text-primary) !important;
}

.border-primary {
    border-color: var(--text-primary) !important;
}

.text-accent {
    color: var(--accent-color) !important;
}

.bg-accent {
    background-color: var(--accent-color) !important;
}

/* Animaciones suaves */
@keyframes slideInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.auth-card {
    animation: slideInUp 0.8s ease-out;
}

/* Mejoras tipográficas */
h1, h2, h3, h4, h5, h6 {
    font-weight: 600;
    color: var(--text-primary);
}

h1 {
    font-size: 2.5rem;
}

h2 {
    font-size: 2rem;
}

h3 {
    font-size: 1.75rem;
}

/* Scrollbar personalizado */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: var(--background-light);
}

::-webkit-scrollbar-thumb {
    background: var(--text-secondary);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--text-muted);
}

/* Ocultar scrollbar horizontal */
::-webkit-scrollbar:horizontal {
    display: none;
}

/* Para Firefox */
html {
    scrollbar-width: thin;
    scrollbar-color: var(--text-secondary) var(--background-light);
}

/* Ocultar scrollbar horizontal en Firefox */
body {
    overflow-x: hidden;
}

/* Estilos específicos para estadísticas */
#heatmapTrainingContainer {
    width: fit-content;
    max-width: 100%;
    margin: 0 auto;
}

/* Ajustar el card del heatmap para que se ajuste al contenido */
.heatmap-card {
    width: fit-content;
    max-width: 100%;
    height: fit-content;
}

.heatmap-card-body {
    width: fit-content;
    max-width: 100%;
    margin: 0 auto;
    padding: 1rem;
}

.heatmap-wrapper {
    display: grid;
    grid-template-columns: 40px repeat(31, 18px);
    grid-template-rows: 24px repeat(12, 18px);
    gap: 2px;
    margin-top: 1rem;
    position: relative;
    width: fit-content;
    overflow: hidden;
}

.heatmap-days-header {
    grid-column: 2 / -1;
    grid-row: 1;
    display: grid;
    grid-template-columns: repeat(31, 18px);
    gap: 2px;
    height: 24px;
}

.heatmap-day-header-label {
    font-size: 11px;
    color: var(--text-secondary);
    white-space: nowrap;
    font-weight: 500;
    width: 18px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.heatmap-content-wrapper {
    grid-column: 1 / -1;
    grid-row: 2 / -1;
    display: contents;
}

.heatmap-months-sidebar {
    grid-column: 1;
    grid-row: 2 / -1;
    display: grid;
    grid-template-rows: repeat(12, 18px);
    gap: 2px;
    width: 40px;
}

.heatmap-month-sidebar-label {
    font-size: 12px;
    color: var(--text-secondary);
    line-height: 18px;
    height: 18px;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    padding-right: 6px;
    font-weight: 500;
}

.heatmap-grid-monthly {
    grid-column: 2 / -1;
    grid-row: 2 / -1;
    display: grid;
    grid-template-columns: repeat(31, 18px);
    grid-template-rows: repeat(12, 18px);
    gap: 2px;
}

.heatmap-day {
    width: 18px;
    height: 18px;
    border-radius: 2px;
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
}

.heatmap-day:hover {
    transform: scale(1.2);
    z-index: 10;
}

.heatmap-legend-item {
    width: 10px;
    height: 10px;
    border-radius: 1px;
    display: inline-block;
}

.module-item {
    padding: 0.5rem;
    margin: 0.25rem 0;
    background-color: var(--background-dark);
    border-radius: 8px;
    cursor: move;
    display: flex;
    align-items: center;
    transition: all 0.2s ease;
}

.module-item:hover {
    background-color: var(--accent-light);
}

.module-item i {
    color: var(--text-muted);
}

/* Estilos para tooltips del heatmap */
.heatmap-tooltip {
    position: absolute;
    background-color: var(--text-primary);
    color: var(--background-light);
    padding: 0.5rem;
    border-radius: 4px;
    font-size: 0.875rem;
    pointer-events: none;
    z-index: 1000;
    white-space: nowrap;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

/* Mejoras para las tarjetas KPI */
.stat-item .badge {
    font-size: 0.75rem;
    padding: 0.25rem 0.5rem;
}

/* Estilos para la tabla de partidas */
.table th {
    background-color: var(--background-dark);
    border-bottom: 2px solid var(--border-color);
    font-weight: 600;
    color: var(--text-primary);
}

.table th:hover {
    background-color: var(--accent-light);
    cursor: pointer;
}

.table td {
    vertical-align: middle;
}

/* Estilos para los filtros */
.form-select:focus,
.form-control:focus {
    border-color: var(--accent-color);
    box-shadow: 0 0 0 0.2rem rgba(37, 99, 235, 0.25);
}

/* Estilos para los tabs */
.nav-tabs .nav-link {
    border: none;
    color: var(--text-secondary);
    font-weight: 500;
    padding: 0.75rem 1rem;
    border-radius: 8px 8px 0 0;
    transition: all 0.3s ease;
}

.nav-tabs .nav-link:hover {
    border-color: transparent;
    color: var(--accent-color);
    background-color: var(--accent-light);
}

.nav-tabs .nav-link.active {
    color: var(--accent-color);
    background-color: var(--background-light);
    border-bottom: 2px solid var(--accent-color);
}

/* Estilos para los gráficos */
.chart-container {
    position: relative;
    height: 300px;
}

/* Estilos para el modal de métricas */
.modal-content {
    border: none;
    border-radius: 16px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.1);
}

.modal-header {
    border-bottom: 1px solid var(--border-color);
    background-color: var(--background-light);
    border-radius: 16px 16px 0 0;
}

.modal-body {
    padding: 2rem;
}

.modal-footer {
    border-top: 1px solid var(--border-color);
    background-color: var(--background-light);
    border-radius: 0 0 16px 16px;
}

/* Responsive para estadísticas */
@media (max-width: 991.98px) {
    .heatmap-wrapper {
        grid-template-columns: 35px repeat(31, 14px);
        grid-template-rows: 20px repeat(12, 14px);
    }
    
    .heatmap-grid-monthly {
        grid-template-columns: repeat(31, 14px);
        grid-template-rows: repeat(12, 14px);
    }
    
    .heatmap-days-header {
        grid-template-columns: repeat(31, 14px);
        height: 20px;
    }
    
    .heatmap-day-header-label {
        width: 14px;
        height: 20px;
        font-size: 10px;
    }
    
    .heatmap-day {
        width: 14px;
        height: 14px;
    }
    
    .heatmap-month-sidebar-label {
        font-size: 11px;
        height: 14px;
        line-height: 14px;
    }
    
    .heatmap-months-sidebar {
        width: 35px;
        grid-template-rows: repeat(12, 14px);
    }
    
    .d-flex.gap-2.flex-wrap {
        flex-direction: column;
        gap: 0.5rem !important;
    }
    
    .d-flex.gap-2.flex-wrap > * {
        width: 100%;
    }
}

@media (max-width: 767.98px) {
    .heatmap-wrapper {
        grid-template-columns: 30px repeat(31, 12px);
        grid-template-rows: 18px repeat(12, 12px);
        gap: 1px;
    }
    
    .heatmap-grid-monthly {
        grid-template-columns: repeat(31, 12px);
        grid-template-rows: repeat(12, 12px);
        gap: 1px;
    }
    
    .heatmap-days-header {
        grid-template-columns: repeat(31, 12px);
        gap: 1px;
        height: 18px;
    }
    
    .heatmap-day-header-label {
        width: 12px;
        height: 18px;
        font-size: 9px;
    }
    
    .heatmap-day {
        width: 12px;
        height: 12px;
    }
    
    .heatmap-months-sidebar {
        width: 30px;
        grid-template-rows: repeat(12, 12px);
        gap: 1px;
    }
    
    .heatmap-month-sidebar-label {
        font-size: 10px;
        height: 12px;
        line-height: 12px;
    }
}

/* Mejoras de usabilidad en móviles para el heatmap:
   - Permitir scroll horizontal si excede el ancho de pantalla
   - Evitar que se corte el contenido vertical (hover/tooltip) */
@media (max-width: 991.98px) {
    .heatmap-wrapper {
        max-width: 100%;
        overflow-x: auto;
        overflow-y: visible;
        -webkit-overflow-scrolling: touch;
    }
}

/* Ajustes de switches en móvil para evitar desbordes de línea y solapamientos */
@media (max-width: 767.98px) {
    .form-check.form-switch {
        display: flex;
        align-items: center;
        gap: 0.5rem;
        max-width: 100%;
        flex-wrap: wrap;
    }
    .form-check.form-switch .form-check-input {
        flex-shrink: 0;
        margin-right: 0.25rem;
    }
    .form-check.form-switch .form-check-label {
        font-size: 0.95rem;
        white-space: normal;
        word-break: break-word;
        line-height: 1.2;
    }
}

/* Botón de refresco de competiciones: compactar en móvil para no desbordar */
@media (max-width: 767.98px) {
    #refreshCompetitionsBtn {
        padding: 0.375rem 0.375rem !important;
        min-width: 32px !important;
        min-height: 32px !important;
        width: 32px !important;
        height: 32px !important;
        display: inline-flex !important;
        align-items: center !important;
        justify-content: center !important;
        flex-shrink: 0 !important;
    }
    #refreshCompetitionsBtn .bi {
        font-size: 0.9rem !important;
        line-height: 1 !important;
        margin: 0 !important;
    }
    
    /* Ajustar input-group de búsqueda de competiciones en móvil */
    .card-header .d-flex.gap-2 {
        flex-wrap: wrap !important;
        gap: 0.5rem !important;
    }
    
    .card-header .input-group[style*="width: 300px"] {
        width: calc(100% - 40px) !important;
        max-width: 100% !important;
        flex: 1 1 auto !important;
        min-width: 0 !important;
    }
}

/* Controles de cabecera apilados en móvil (select + switch) */
@media (max-width: 767.98px) {
    .header-controls {
        flex-direction: column !important;
        align-items: stretch !important;
        gap: 0.5rem !important;
        width: 100%;
    }
    .header-controls .form-select {
        width: 100% !important; /* Sobrescribe el width inline auto */
    }
    .header-controls .form-check.form-switch {
        width: 100%;
        justify-content: flex-start;
    }
}

/* Estilos específicos para la página de perfil */
.profile-picture-container {
    position: relative;
    display: inline-block;
}

.profile-picture-wrapper {
    width: 150px;
    height: 150px;
    margin: 0 auto;
    position: relative;
    border-radius: 50%;
    overflow: hidden;
    border: 4px solid var(--border-color);
    transition: all 0.3s ease;
}

.profile-picture-wrapper:hover {
    border-color: var(--accent-color);
    transform: scale(1.05);
}

.profile-picture {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: all 0.3s ease;
}

.profile-picture-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background-color: var(--background-dark);
    color: var(--text-muted);
    font-size: 3rem;
    transition: all 0.3s ease;
}

.profile-picture-placeholder:hover {
    background-color: var(--accent-light);
    color: var(--accent-color);
}

.profile-picture-actions {
    margin-top: 1rem;
}

/* Estados de edición del perfil */
.profile-form-disabled .form-control,
.profile-form-disabled .form-select {
    background-color: var(--background-dark);
    border-color: var(--border-color);
    color: var(--text-muted);
    cursor: not-allowed;
}

.profile-form-enabled .form-control,
.profile-form-enabled .form-select {
    background-color: var(--background-light);
    border-color: var(--accent-color);
    color: var(--text-primary);
}

/* Animaciones para los campos del formulario */
.form-control:focus,
.form-select:focus {
    border-color: var(--accent-color);
    box-shadow: 0 0 0 0.2rem rgba(37, 99, 235, 0.25);
    transform: translateY(-1px);
}

/* Estadísticas del perfil */
.stat-item {
    padding: 0.5rem;
    border-radius: 8px;
    transition: all 0.3s ease;
}

.stat-item:hover {
    background-color: var(--background-dark);
    transform: translateY(-2px);
}

.stat-item h4 {
    font-weight: 700;
    margin-bottom: 0.25rem;
}

.stat-item small {
    font-size: 0.75rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Botones de acción del perfil */
#profileActions {
    animation: slideInUp 0.3s ease-out;
}

/* Toast personalizado para el perfil */
.toast {
    border: none;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.toast-header {
    background-color: var(--background-light);
    border-bottom: 1px solid var(--border-color);
    border-radius: 12px 12px 0 0;
}

.toast-body {
    background-color: var(--background-light);
    border-radius: 0 0 12px 12px;
}

/* Responsive para perfil */
@media (max-width: 991.98px) {
    .profile-picture-wrapper {
        width: 120px;
        height: 120px;
    }
    
    .profile-picture-placeholder {
        font-size: 2.5rem;
    }
    
    .initials-avatar {
        font-size: 2.5rem;
    }
    
    .stat-item h4 {
        font-size: 1.5rem;
    }
}

@media (max-width: 767.98px) {
    .profile-picture-wrapper {
        width: 100px;
        height: 100px;
    }
    
    .profile-picture-placeholder {
        font-size: 2rem;
    }
    
    .initials-avatar {
        font-size: 2rem;
    }
    
    .profile-picture-actions {
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .profile-picture-actions .btn {
        width: 100%;
    }
    
    .stat-item h4 {
        font-size: 1.25rem;
    }
    
    .card-body {
        padding: 1rem;
    }
}

/* Animación de carga para la subida de fotos */
.profile-picture-loading {
    position: relative;
}

.profile-picture-loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    margin: -10px 0 0 -10px;
    border: 2px solid var(--accent-color);
    border-top: 2px solid transparent;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

/* Efecto hover para las tarjetas del perfil */
.card:hover .profile-picture-wrapper {
    border-color: var(--accent-color);
}

/* Estilos para el modo de edición */
.profile-edit-mode .card-header {
    background-color: var(--accent-light);
    border-bottom-color: var(--accent-color);
}

.profile-edit-mode .card-title {
    color: var(--accent-color);
}

/* Indicador de campos requeridos */
.form-label::after {
    content: '';
}

.form-label.required::after {
    content: ' *';
    color: var(--danger-color);
    font-weight: bold;
}

/* Mejoras en la accesibilidad */
.form-control:focus,
.form-select:focus {
    outline: 2px solid var(--accent-color);
    outline-offset: 2px;
}

/* Estilos para botones de diferentes tamaños */
.btn-sm {
    padding: 0.375rem 0.75rem;
    font-size: 0.8rem;
    border-radius: 6px;
}

.btn-lg {
    padding: 0.75rem 2rem;
    font-size: 1rem;
    border-radius: 10px;
}

.btn-xl {
    padding: 1rem 2.5rem;
    font-size: 1.1rem;
    border-radius: 12px;
}

/* Botones secundarios y otros colores */
.btn-secondary {
    background-color: var(--secondary-color);
    border-color: var(--secondary-color);
    color: var(--background-light);
    padding: 0.5rem 1.5rem;
    font-size: 0.9rem;
    border-radius: 8px;
    font-weight: 600;
    transition: all 0.3s ease;
}

.btn-secondary:hover {
    background-color: var(--text-secondary);
    border-color: var(--text-secondary);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(100, 116, 139, 0.3);
}

.btn-success {
    background-color: var(--success-color);
    border-color: var(--success-color);
    color: var(--background-light);
    padding: 0.5rem 1.5rem;
    font-size: 0.9rem;
    border-radius: 8px;
    font-weight: 600;
    transition: all 0.3s ease;
}

.btn-success:hover {
    background-color: #047857;
    border-color: #047857;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(5, 150, 105, 0.3);
}

.btn-danger {
    background-color: var(--danger-color);
    border-color: var(--danger-color);
    color: var(--background-light);
    padding: 0.5rem 1.5rem;
    font-size: 0.9rem;
    border-radius: 8px;
    font-weight: 600;
    transition: all 0.3s ease;
}

.btn-danger:hover {
    background-color: #b91c1c;
    border-color: #b91c1c;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(220, 38, 38, 0.3);
}

.btn-info {
    background-color: var(--info-color);
    border-color: var(--info-color);
    color: var(--background-light);
    padding: 0.5rem 1.5rem;
    font-size: 0.9rem;
    border-radius: 8px;
    font-weight: 600;
    transition: all 0.3s ease;
}

.btn-info:hover {
    background-color: #0369a1;
    border-color: #0369a1;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(2, 132, 199, 0.3);
}

.btn-warning {
    background-color: var(--warning-color);
    border-color: var(--warning-color);
    color: var(--background-light);
    padding: 0.5rem 1.5rem;
    font-size: 0.9rem;
    border-radius: 8px;
    font-weight: 600;
    transition: all 0.3s ease;
}

.btn-warning:hover {
    background-color: #b45309;
    border-color: #b45309;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(217, 119, 6, 0.3);
}

/* Estilos para el botón de subida de archivo personalizado */
.btn-file {
    position: relative;
    overflow: hidden;
    display: inline-block;
}

.btn-file input[type=file] {
    position: absolute;
    left: -9999px;
    opacity: 0;
}

/* Efectos de transición suaves */
.card {
    transition: all 0.3s ease;
}

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

/* Estilos para los badges de estadísticas */
.stat-badge {
    display: inline-block;
    padding: 0.25rem 0.5rem;
    font-size: 0.75rem;
    font-weight: 600;
    border-radius: 6px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.stat-badge-primary {
    background-color: var(--accent-light);
    color: var(--accent-color);
}

.stat-badge-success {
    background-color: rgba(5, 150, 105, 0.1);
    color: var(--success-color);
}

.stat-badge-warning {
    background-color: rgba(217, 119, 6, 0.1);
    color: var(--warning-color);
}

.stat-badge-info {
    background-color: rgba(2, 132, 199, 0.1);
    color: var(--info-color);
}

.stat-badge-danger {
    background-color: rgba(220, 38, 38, 0.1);
    color: var(--danger-color);
}

/* Estilos para el componente de búsqueda de participantes */
.participant-search-container {
    position: relative;
    z-index: 1000;
}

.participant-search-input {
    border: 2px solid var(--border-color);
    border-radius: 12px;
    padding: 12px 45px 12px 16px;
    font-size: 16px;
    transition: all 0.3s ease;
    background: var(--background-light);
}

.participant-search-input:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(30, 64, 175, 0.1);
    outline: none;
}

.participant-search-icon {
    position: absolute;
    right: 16px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    pointer-events: none;
}

.search-results-container {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--background-light);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
    z-index: 9999;
    max-height: 400px;
    overflow-y: auto;
    margin-top: 8px;
    width: 100%;
}

.search-result-card {
    border: 1px solid var(--border-color);
    border-radius: 8px;
    transition: all 0.2s ease;
    background: var(--background-card);
    position: relative;
    z-index: 10000;
}

.search-result-card[onclick] {
    cursor: pointer;
}

.search-result-card:hover {
    border-color: var(--primary-color);
    box-shadow: 0 4px 12px rgba(30, 64, 175, 0.1);
    transform: translateY(-1px);
}

.search-result-card.selected {
    border-color: var(--success-color);
    background: rgba(5, 150, 105, 0.05);
}

.participant-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid var(--border-color);
}

.participant-avatar-placeholder {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--secondary-color);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 18px;
}

.selected-participants-container {
    background: var(--background-dark);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 16px;
    min-height: 80px;
}

.selected-participant-item {
    background: var(--background-light);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 12px;
    margin-bottom: 8px;
    transition: all 0.2s ease;
}

.selected-participant-item:hover {
    border-color: var(--danger-color);
    background: rgba(220, 38, 38, 0.02);
}

.selected-participant-avatar {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    object-fit: cover;
    border: 1px solid var(--border-color);
}

.selected-participant-avatar-placeholder {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: var(--secondary-color);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 14px;
}

.team-members-list {
    max-height: 120px;
    overflow-y: auto;
    background: var(--background-dark);
    border-radius: 6px;
    padding: 8px;
}

.team-member-item {
    padding: 4px 8px;
    border-radius: 4px;
    margin-bottom: 2px;
    font-size: 13px;
}

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

.badge-competition {
    font-size: 11px;
    padding: 2px 6px;
}

.btn-select-participant {
    border-radius: 6px;
    padding: 6px 12px;
    font-size: 13px;
    font-weight: 500;
    transition: all 0.2s ease;
}

.btn-select-participant:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.btn-clear-all {
    border-radius: 6px;
    padding: 6px 12px;
    font-size: 13px;
    transition: all 0.2s ease;
}

.btn-clear-all:hover {
    background: var(--danger-color);
    border-color: var(--danger-color);
    color: white;
}

.no-participants-message {
    text-align: center;
    padding: 24px;
    color: var(--text-muted);
    font-style: italic;
}

.loading-spinner {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid var(--border-color);
    border-radius: 50%;
    border-top-color: var(--primary-color);
    animation: spin 1s ease-in-out infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Animaciones suaves */
.search-result-card,
.selected-participant-item {
    animation: fadeInUp 0.3s ease-out;
}

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

/* Responsive para el componente de búsqueda */
@media (max-width: 768px) {
    .participant-search-input {
        font-size: 16px; /* Evita zoom en iOS */
    }
    
    .search-results-container {
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        width: 100%;
        max-height: 50vh;
        border-radius: 12px;
        margin-top: 8px;
        z-index: 9999;
    }
    
    .participant-search-container {
        overflow: visible;
    }
    
    #playerSelectionBody > .mb-4:first-of-type {
        overflow: visible;
    }
    
    .search-result-card {
        margin-bottom: 8px;
    }
    
    .selected-participant-item {
        padding: 8px;
    }
    
    .selected-participant-avatar,
    .selected-participant-avatar-placeholder {
        width: 24px;
        height: 24px;
        font-size: 12px;
    }
}

/* Estilos para la gestión automática de pistas */
.btn-group .btn-check:checked + .btn {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
    color: white;
    box-shadow: 0 0 0 0.2rem rgba(30, 64, 175, 0.25);
}

.btn-group .btn {
    transition: all 0.3s ease;
    border-radius: 8px;
    font-weight: 500;
}

.btn-group .btn:hover {
    background-color: var(--accent-light);
    border-color: var(--accent-color);
    color: var(--primary-color);
}

#createCourtsBtn {
    background: linear-gradient(135deg, var(--primary-color), var(--accent-color));
    border: none;
    border-radius: 10px;
    font-weight: 600;
    padding: 12px 24px;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(30, 64, 175, 0.2);
}

#createCourtsBtn:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(30, 64, 175, 0.3);
    background: linear-gradient(135deg, var(--accent-hover), var(--primary-color));
}

#createCourtsBtn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

/* Estilos para las tarjetas de pistas */
.court-card {
    border: 2px solid var(--border-color);
    border-radius: 12px;
    transition: all 0.3s ease;
    background: var(--background-card);
}

.court-card:hover {
    border-color: var(--accent-color);
    box-shadow: 0 4px 15px rgba(59, 130, 246, 0.1);
    transform: translateY(-2px);
}

.court-card.border-primary {
    border-color: var(--primary-color);
    background: linear-gradient(135deg, rgba(30, 64, 175, 0.05), rgba(59, 130, 246, 0.05));
}

/* Estilos para los badges de estado de pistas */
.badge.bg-primary {
    background: linear-gradient(135deg, var(--primary-color), var(--accent-color)) !important;
    border-radius: 20px;
    padding: 6px 12px;
    font-weight: 500;
}

/* Estilos consistentes para badges de provincias */
.badge.bg-danger {
    border-radius: 20px;
    padding: 6px 12px;
    font-weight: 500;
}

.badge.bg-success {
    border-radius: 20px;
    padding: 6px 12px;
    font-weight: 500;
}

.badge.bg-secondary {
    border-radius: 20px;
    padding: 6px 12px;
    font-weight: 500;
}

/* Estilos para los botones de acción de pistas */
.btn-sm.btn-outline-primary {
    border-radius: 8px;
    font-weight: 500;
    transition: all 0.3s ease;
}

.btn-sm.btn-outline-primary:hover {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(30, 64, 175, 0.2);
}

/* Animación para las pistas creadas automáticamente */
.court-card.newly-created {
    animation: pulse 0.6s ease-in-out;
}

@keyframes pulse {
    0% {
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(30, 64, 175, 0.7);
    }
    70% {
        transform: scale(1.05);
        box-shadow: 0 0 0 10px rgba(30, 64, 175, 0);
    }
    100% {
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(30, 64, 175, 0);
    }
}

/* Mejoras generales de espaciado superior en móviles */
@media (max-width: 767.98px) {
    /* Asegurar espacio superior adecuado en todas las páginas */
    .main-content .container-fluid {
        padding-top: 0.5rem;
    }
    
    /* Mejorar espaciado en las primeras filas de contenido */
    .main-content .row:first-child {
        margin-top: 0.5rem;
    }
    
    /* Espaciado adicional para el header del dashboard */
    .main-content .row.mb-4:first-child {
        margin-top: 1rem;
    }
    
    /* Mejorar espaciado en tarjetas principales */
    .main-content .card:first-child {
        margin-top: 0.5rem;
    }
    
    /* Corregir botones de perfil en móviles */
    .profile-picture-actions .btn {
        min-width: 120px !important;
        padding: 0.5rem 0.75rem !important;
        font-size: 0.85rem !important;
        border-radius: 8px !important;
        font-weight: 500 !important;
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        gap: 0.25rem !important;
    }
    
    .profile-picture-actions .btn i {
        font-size: 0.9rem !important;
        margin: 0 !important;
    }
    
    .profile-picture-actions {
        flex-direction: column !important;
        gap: 0.75rem !important;
        align-items: center !important;
    }
    
    .profile-picture-actions .btn {
        width: 100% !important;
        max-width: 200px !important;
    }
    
    /* Corregir botones de documentos de federación en móviles */
    .d-flex.flex-wrap.gap-2 .btn {
        padding: 0.5rem 0.75rem !important;
        font-size: 0.85rem !important;
        border-radius: 8px !important;
        font-weight: 500 !important;
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        gap: 0.25rem !important;
        min-height: 36px !important;
        flex: 1 !important;
        min-width: 0 !important;
    }
    
    .d-flex.flex-wrap.gap-2 .btn i {
        font-size: 0.9rem !important;
        margin: 0 !important;
    }
    
    .d-flex.flex-wrap.gap-2 {
        gap: 0.75rem !important;
    }
    
    /* En móviles, hacer que los botones se apilen si hay muchos */
    @media (max-width: 480px) {
        .d-flex.flex-wrap.gap-2 {
            flex-direction: column !important;
        }
        
        .d-flex.flex-wrap.gap-2 .btn {
            width: 100% !important;
            flex: none !important;
        }
    }
    
    /* Mejorar header del perfil en móviles */
    .card-header .d-flex.justify-content-between.align-items-center {
        flex-direction: column !important;
        align-items: stretch !important;
        gap: 0.85rem !important;
        padding: 1.25rem 1rem !important;
    }
    
    /* Lápiz de edición arriba a la derecha */
    .card-header .btn-link {
        align-self: flex-end !important;
        order: 1 !important;
        margin-bottom: 0.25rem !important;
    }
    
    /* Título debajo del lápiz */
    .card-header .card-title {
        margin-bottom: 0 !important;
        width: 100% !important;
        order: 1 !important;
    }

    /* Botón de acción principal (como el de Afegir Menor) */
    .card-header .btn-primary {
        order: 2 !important;
        width: 100% !important;
        margin-top: 0.25rem;
        justify-content: center !important;
    }
    
    /* Corregir botones con solo iconos en móviles */
    .btn.btn-sm.btn-outline-secondary {
        min-width: 36px !important;
        min-height: 36px !important;
        padding: 0.375rem !important;
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        border-radius: 8px !important;
    }
    
    .btn.btn-sm.btn-outline-secondary i {
        font-size: 1rem !important;
        margin: 0 !important;
    }
    
    /* Específico para botones con icono de candado */
    .btn.btn-sm.btn-outline-secondary:disabled {
        width: 36px !important;
        height: 31px !important; /* Misma altura que form-control-sm */
        padding: 0 !important;
        border-radius: 0.375rem !important; /* Misma border-radius que form-control-sm */
    }
    
    /* Asegurar alineación en input-group */
    .input-group .btn.btn-sm.btn-outline-secondary:disabled {
        height: 31px !important;
        border-top-left-radius: 0 !important;
        border-bottom-left-radius: 0 !important;
    }
    
    /* Mejorar estética del input-group en móviles */
    .input-group {
        max-width: 100% !important;
        border-radius: 10px !important;
        overflow: hidden !important;
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08) !important;
        border: 1px solid var(--border-color) !important;
    }
    
    .input-group .form-control {
        border: none !important;
        border-radius: 0 !important;
        background-color: #f8f9fa !important;
        font-size: 0.9rem !important;
        padding: 0.5rem 0.75rem !important;
        height: 40px !important;
    }
    
    .input-group .form-control:focus {
        box-shadow: none !important;
        background-color: #ffffff !important;
        border-color: var(--accent-color) !important;
    }
    
    .input-group .btn {
        border: none !important;
        background-color: #e9ecef !important;
        color: #6c757d !important;
        height: 40px !important;
        width: 40px !important;
        border-radius: 0 !important;
        transition: all 0.2s ease !important;
    }
    
    .input-group .btn:hover {
        background-color: #dee2e6 !important;
        color: #495057 !important;
    }
    
    .input-group .btn i {
        font-size: 1.1rem !important;
    }
    
    /* Mejorar el aspecto cuando está deshabilitado */
    .input-group .btn:disabled {
        background-color: #f8f9fa !important;
        color: #adb5bd !important;
        cursor: not-allowed !important;
    }
    
    .input-group .btn:disabled:hover {
        background-color: #f8f9fa !important;
        color: #adb5bd !important;
    }
    
    /* Corregir alineación de texto en botones con iconos */
    .btn {
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        gap: 0.5rem !important;
        padding: 0.5rem 1rem !important;
        font-size: 0.9rem !important;
        font-weight: 500 !important;
        border-radius: 8px !important;
        line-height: 1.4 !important;
    }
    
    .btn i {
        font-size: 1rem !important;
        margin: 0 !important;
        flex-shrink: 0 !important;
    }
    
    .btn.btn-sm {
        padding: 0.375rem 0.75rem !important;
        font-size: 0.85rem !important;
        gap: 0.375rem !important;
    }
    
    .btn.btn-sm i {
        font-size: 0.9rem !important;
    }
}

/* Forzar ocultar elementos marcados como solo-escritorio en móviles */
@media (max-width: 767.98px) {
    .hide-on-mobile,
    button.hide-on-mobile,
    .btn.hide-on-mobile {
        display: none !important;
    }
}

/* Asegurar que elementos con hide-on-mobile se oculten también en dispositivos móviles reales */
@media screen and (max-width: 768px) {
    .hide-on-mobile,
    button.hide-on-mobile,
    .btn.hide-on-mobile {
        display: none !important;
    }
}

/* Reglas específicas para asegurar que los iconos de Bootstrap se muestren correctamente */
.bi {
    font-family: "bootstrap-icons" !important;
    font-style: normal !important;
    font-variant: normal !important;
    text-transform: none !important;
    line-height: 1 !important;
    -webkit-font-smoothing: antialiased !important;
    -moz-osx-font-smoothing: grayscale !important;
}

/* Asegurar que los iconos de Bootstrap en botones se muestren correctamente */
.btn .bi {
    display: inline-block !important;
    font-size: inherit !important;
    margin-right: 0.25rem !important;
    vertical-align: middle !important;
}

.btn .bi.me-1 {
    margin-right: 0.25rem !important;
    margin-left: 0 !important;
}

.btn .bi.me-2 {
    margin-right: 0.5rem !important;
    margin-left: 0 !important;
}

/* Específico para el icono de Excel */
.bi-file-excel {
    color: #198754 !important; /* Color verde para Excel */
}

.btn-success .bi-file-excel {
    color: inherit !important;
}

/* ========================================
   TOASTS UNIFICADOS - DISEÑO MODERNO
   ======================================== */
:root {
  --pf-bg: #ffffff;
  --pf-text: #0f172a;
  --pf-muted: #64748b;
  --pf-shadow: 0 8px 24px rgba(15, 23, 42, .08);
  --pf-radius: 14px;

  --pf-success: #22c55e;
  --pf-danger:  #ef4444;
  --pf-warning: #f59e0b;
  --pf-info:    #0ea5e9;
  --pf-neutral: #94a3b8;
}

/* Contenedor fijo */
.toast-stack {
  position: fixed;
  top: 1.25rem;
  right: 1.25rem;
  z-index: 1090;
  display: flex;
  flex-direction: column;
  gap: .5rem;
  width: min(420px, calc(100vw - 2.5rem));
}

/* Toast base */
.toast.pf-toast {
  background: var(--pf-bg);
  color: var(--pf-text);
  border: 1px solid rgba(15, 23, 42, .06);
  border-radius: var(--pf-radius);
  box-shadow: var(--pf-shadow);
  overflow: hidden;
  padding-left: .25rem;
  position: relative;
}

.pf-accent {
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 4px;
}

.pf-toast .toast-body {
  display: grid;
  grid-template-columns: 28px 1fr auto;
  gap: .75rem;
  align-items: start;
  padding: .9rem 1rem;
}

.pf-title {
  font-weight: 600;
  line-height: 1.2;
}

.pf-message {
  color: var(--pf-muted);
  margin: .125rem 0 0;
  font-size: .95rem;
}

.pf-close {
  border: 0;
  background: transparent;
  color: var(--pf-muted);
  cursor: pointer;
  padding: 0;
  font-size: 1.25rem;
  line-height: 1;
  opacity: 0.7;
  transition: opacity 0.2s ease, color 0.2s ease;
}

.pf-close:hover { 
  color: var(--pf-text); 
  opacity: 1;
}

/* Variantes */
.pf-success .pf-accent { background: var(--pf-success); }
.pf-danger  .pf-accent { background: var(--pf-danger);  }
.pf-warning .pf-accent { background: var(--pf-warning); }
.pf-info    .pf-accent { background: var(--pf-info);    }
.pf-neutral .pf-accent { background: var(--pf-neutral); }

.pf-success .pf-icon { color: var(--pf-success); }
.pf-danger  .pf-icon { color: var(--pf-danger);  }
.pf-warning .pf-icon { color: var(--pf-warning); }
.pf-info    .pf-icon { color: var(--pf-info);    }
.pf-neutral .pf-icon { color: var(--pf-neutral); }

/* Animaciones */
@keyframes slideInRight {
  from {
    transform: translateX(100%);
    opacity: 0;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}

@keyframes slideOutRight {
  from {
    transform: translateX(0);
    opacity: 1;
  }
  to {
    transform: translateX(100%);
    opacity: 0;
  }
}

.toast.pf-toast.show {
  animation: slideInRight 0.3s ease-out;
}

.toast.pf-toast.hiding {
  animation: slideOutRight 0.3s ease-in;
}

/* Responsive */
@media (max-width: 767.98px) {
  .toast-stack {
    top: 1rem;
    right: 1rem;
    left: 1rem;
    width: auto;
  }
}

/* Estilos específicos para el bloque de suplentes */
.suplentes-card {
    transition: transform 0.2s ease-in-out, box-shadow 0.2s ease-in-out;
}

.suplentes-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.suplentes-position-badge {
    font-size: 0.75rem;
    font-weight: 600;
    padding: 0.25rem 0.5rem;
    border-radius: 50px;
    background: linear-gradient(135deg, var(--primary-color), var(--accent-color));
    color: white;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.suplentes-profile-image {
    border: 3px solid var(--accent-light);
    transition: border-color 0.2s ease-in-out;
}

.suplentes-card:hover .suplentes-profile-image {
    border-color: var(--accent-color);
}

.suplentes-category-badge {
    background: linear-gradient(135deg, var(--secondary-color), #94a3b8);
    color: white;
    font-size: 0.75rem;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
}

.suplentes-stats-number {
    font-size: 1.25rem;
    font-weight: 700;
    line-height: 1;
}

.suplentes-club-badge {
    background-color: var(--background-dark);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
    font-size: 0.75rem;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
}

.suplentes-info-alert {
    background: linear-gradient(135deg, var(--accent-light), #e0f2fe);
    border: 1px solid var(--accent-color);
    color: var(--text-primary);
}

/* Responsive adjustments para suplentes */
@media (max-width: 768px) {
    .suplentes-card .card-body {
        padding: 1rem;
    }
    
    .suplentes-profile-image {
        width: 60px !important;
        height: 60px !important;
    }
    
    .suplentes-stats-number {
        font-size: 1rem;
    }
}

/* ========================================
   APARTADO MENORES A CARGO (PERFIL)
   ======================================== */
.minors-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1.25rem;
}

.minor-card {
    border: 1px solid var(--border-color);
    border-radius: 14px;
    padding: 1.25rem;
    background: var(--background-card);
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

.minor-card:hover {
    border-color: var(--accent-color);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05);
    transform: translateY(-2px);
}

@media (max-width: 767.98px) {
    .minors-grid {
        grid-template-columns: 1fr;
        gap: 0.75rem;
    }

    .minor-card {
        flex-direction: row;
        text-align: left;
        padding: 0.75rem 1rem;
        align-items: center;
    }

    .minor-card .profile-picture-wrapper {
        width: 50px !important;
        height: 50px !important;
        margin: 0 1rem 0 0 !important;
    }

    .minor-card .minor-info {
        flex: 1;
    }

    .minor-card .minor-actions {
        margin-top: 0 !important;
        width: auto !important;
    }
}

/* Estilos para botones de competiciones de parejas mixtas en móviles */
@media (max-width: 991.98px) {
    .parelles-mixtes-buttons {
        display: flex;
        flex-direction: column;
        align-items: stretch;
    }
    
    .parelles-mixtes-buttons .btn {
        width: 100%;
        margin-left: 0 !important;
        margin-right: 0 !important;
    }
    
    /* Estilos para botones de acciones en parejas mixtas (Volver, Descargar PDF, Eliminar) */
    .parelles-mixtes-actions {
        flex-direction: column;
        gap: 0.75rem;
    }
    
    .parelles-mixtes-actions > a,
    .parelles-mixtes-actions > div {
        width: 100%;
    }
    
    .parelles-mixtes-buttons-group {
        display: flex;
        flex-direction: column;
        gap: 0.75rem;
        width: 100%;
    }
    
    .parelles-mixtes-buttons-group .btn {
        width: 100%;
        margin-left: 0 !important;
        margin-right: 0 !important;
    }
}