/* Profile Show Page Styles */

/* Profile Avatar Styles */
.profile-avatar {
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 120px; /* Asegurar altura mínima para centrado */
}

.avatar-img {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid #dee2e6;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    transition: transform 0.3s ease;
}

.avatar-img:hover {
    transform: scale(1.05);
}

[data-theme="dark"] .avatar-img {
    border-color: #444;
}

.profile-name {
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--text-primary, #333);
    line-height: 1.2;
}

[data-theme="dark"] .profile-name {
    color: var(--text-primary, #f8f9fa);
}

/* Stats items */
.stat-item {
    background-color: #212529;
    color: #fff;
    padding: 0.75rem 1rem;
    border-radius: 6px;
    text-align: center;
    font-weight: 600;
    letter-spacing: 0.5px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    min-height: 50px;
}

[data-theme="dark"] .stat-item {
    background-color: #e0e0e0;
    color: #212529;
}

.stat-label {
    font-size: 0.85rem;
    font-weight: 600;
    text-transform: uppercase;
}

.stat-value {
    font-size: 1rem;
    font-weight: 700;
}

/* Filters section */
.filters-section .form-select {
    border: 1px solid #ced4da;
    border-radius: 6px;
    padding: 0.5rem 0.75rem;
    font-size: 0.9rem;
    background-color: #fff;
    color: #495057;
    transition: all 0.3s ease;
}

.filters-section .form-select:focus {
    border-color: #007bff;
    box-shadow: 0 0 0 0.2rem rgba(0, 123, 255, 0.25);
}

[data-theme="dark"] .filters-section .form-select {
    background-color: #3a3a3a;
    border-color: #555;
    color: #f8f9fa;
}

[data-theme="dark"] .filters-section .form-select:focus {
    border-color: #007bff;
}

/* Team logos - Sin círculo (ahora con margin inline) */

/* View lineup button - Solo flecha derecha */
.view-lineup-btn {
    font-size: 0.9rem;
    padding: 0.375rem 0.75rem;
    border-radius: 4px;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 40px;
}

.view-lineup-btn i {
    font-size: 1rem;
}

.view-lineup-btn:hover {
    transform: translateX(2px);
    box-shadow: 0 2px 8px rgba(0, 123, 255, 0.3);
}

/* Back button for mobile field view */
.field-back-btn {
    top: 10px;
    left: 10px;
    z-index: 1001;
    background: #888;
    color: white;
    border: none;
    border-radius: 50%;
    width: 30px;
    height: 30px;
    display: none;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

.field-back-btn i{
    color:white;
}

.field-back-btn:hover {
    background: rgba(0, 0, 0, 0.9);
    transform: scale(1.1);
}

/* Mobile animations and layout - Carousel horizontal */
@media (max-width: 767px) {
    /* Contenedor full-width para que el carousel llegue a los bordes */
    .mobile-carousel-fullwidth {
        width: 100vw;
        margin-left: calc(-50vw + 50%);
        overflow: hidden;
        position: relative;
    }

    html[data-theme="dark"] .mobile-carousel-fullwidth {
        background-color: #444 !important;
    }
    
    /* Row que contiene ambas columnas - se convierte en carousel */
    .mobile-carousel-row {
        margin: 0;
    }
    
    /* Contenedor que se mueve horizontalmente - contiene ambas columnas */
    .mobile-carousel-container {
        display: flex;
        width: 200%; /* 2 columnas = 200% */
        transition: transform 0.3s ease-in-out;
        transform: translateX(0);
    }
    
    .mobile-carousel-container.show-field {
        transform: translateX(-50%); /* Mueve para mostrar la segunda columna */
    }
    
    /* Cada columna ocupa el 50% del contenedor (que es 200%) = 100% visible */
    .mobile-carousel-item {
        width: 50%;
        &:first-of-type {
            margin-left: 1rem;
            width: calc(50% - 2rem);
        }
        &:last-of-type {
            padding: 0 1rem;
        }
        flex-shrink: 0;
        padding: 0;
    }
    
    /* Las cards dentro de las carousel items deben ocupar todo el ancho disponible */
    .mobile-carousel-item .p11-card {
        width: 100%;
        margin: 0;
    }
    
    /* En móvil, las columnas originales se ocultan y usamos el carousel */
    .results-container,
    .field-column {
        display: none;
    }
    
    /* Mostrar botón de volver en móvil */
    .field-back-btn {
        display: flex;
    }
    
    /* Avatar más pequeño en móvil pero manteniendo proporción */
    .avatar-img {
        width: 100px;
        height: 100px;
    }
    
    .profile-avatar {
        min-height: 100px;
    }
    
    /* Ajustes de botones en móvil */
    .view-lineup-btn {
        min-width: 35px;
        padding: 0.25rem 0.5rem;
    }
    
    .view-lineup-btn i {
        font-size: 0.9rem;
    }
    
    /* Comportamiento sticky también en móvil - dentro del carousel */
    .mobile-carousel-item .p11-card.sticky {
        position: fixed !important;
        top: 80px !important;
        left: 0 !important;
        right: 0 !important;
        width: 100vw !important;
        margin: 0 !important;
        z-index: 999 !important;
        border-radius: 0 !important;
        max-height: calc(100vh - 100px) !important;
        overflow-y: auto !important;
        box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15) !important;
    }
}

/* Field specific styles */
#fieldContainer {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-radius: 8px;
}

[data-theme="dark"] #fieldContainer {
    background: linear-gradient(135deg, #2a2a2a 0%, #1e1e1e 100%);
}

/* Loading styles for field */
.field-loading {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.95);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    border-radius: 8px;
}

[data-theme="dark"] .field-loading {
    background: rgba(42, 42, 42, 0.95);
}

.field-loading-spinner {
    text-align: center;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #007bff;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 10px;
}

.loading-text {
    color: #666;
    font-size: 0.9rem;
    font-weight: 500;
}

[data-theme="dark"] .loading-text {
    color: #bbb;
}

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

/* Campo styles integration */
.campo-vacio {
    width: 100%;
    height: auto;
    display: block;
}

.campo-alineacion {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

.player-on-field {
    position: absolute;
    display: flex;
    flex-direction: column;
    align-items: center;
    cursor: default;
    z-index: 10;
    transform: translate(-50%, -50%);
}

.player-on-field .player-image {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 2px solid #fff;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
    object-fit: cover;
    margin-bottom: 2px;
}

.player-on-field .player-name {
    background: rgba(0, 0, 0, 0.8);
    color: #fff;
    padding: 2px 6px;
    border-radius: 3px;
    font-size: 0.7rem;
    font-weight: 600;
    text-align: center;
    white-space: nowrap;
    max-width: 80px;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Responsive Design */
@media (max-width: 992px) {
    .profile-name {
        font-size: 1.5rem;
        text-align: center;
        margin-bottom: 1rem;
    }
    
    .stat-item {
        flex-direction: column;
        gap: 0.25rem;
        text-align: center;
        padding: 0.5rem;
    }
    
    .stat-label,
    .stat-value {
        font-size: 0.85rem;
    }
}

@media (max-width: 768px) {
    .profile-name {
        font-size: 1.3rem;
    }
    
    .player-on-field .player-image {
        width: 30px;
        height: 30px;
    }
    
    .player-on-field .player-name {
        font-size: 0.6rem;
        padding: 1px 4px;
        max-width: 60px;
    }
}

/* Desktop field sticky behavior - Mejorado */
@media (min-width: 768px) {
    .field-column.sticky {
        position: fixed !important;
        top: 80px !important;
        z-index: 999 !important;
        max-height: calc(100vh - 100px) !important;
        overflow-y: auto !important;
        transition: box-shadow 0.3s ease;
    }
    
    .field-column.sticky .p11-card {
        box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
        transition: box-shadow 0.3s ease;
    }
    
    /* Asegurar que el contenido no se desfase */
    .field-column .p11-card {
        transition: box-shadow 0.3s ease;
        border-radius: 8px;
    }
    
    /* Prevenir saltos de layout */
    .field-column {
        transition: none; /* Evitar transiciones que puedan causar saltos */
    }
}

/* Dark theme specific adjustments */
[data-theme="dark"] .player-on-field .player-image {
    border-color: #555;
}

[data-theme="dark"] .player-on-field .player-name {
    background: rgba(255, 255, 255, 0.1);
    color: #f8f9fa;
}

[data-theme="dark"] .field-back-btn {
    background: rgba(255, 255, 255, 0.8);
    color: #333;
}

[data-theme="dark"] .field-back-btn:hover {
    background: rgba(255, 255, 255, 0.9);
}

[data-theme="dark"] .field-column.sticky .p11-card {
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
} 