/* RESET Y BASE */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: 'Segoe UI', sans-serif;
}

body {
    background-color: #121212;
    color: #e0e0e0;
    display: flex;
    justify-content: center;
    min-height: 100vh;
    padding: 20px;
}

.container {
    width: 100%;
    max-width: 400px;
    text-align: center;
    padding-bottom: 50px;
}

.hidden {
    display: none !important;
}

/* INPUTS Y BOTONES */
input,
select {
    width: 100%;
    padding: 12px;
    margin: 8px 0;
    border-radius: 8px;
    border: 1px solid #333;
    background-color: #1e1e1e;
    color: white;
}

button {
    width: 100%;
    padding: 12px;
    border: none;
    border-radius: 8px;
    font-weight: bold;
    cursor: pointer;
    margin-top: 10px;
}


#submit-btn {
    background-color: #ff4b4b;
    color: white;
}

.btn-small {
    width: auto;
    padding: 5px 15px;
    background-color: #333;
    color: #ccc;
    font-size: 0.8rem;
}

.btn-action {
    background: linear-gradient(45deg, #ff4b4b, #ff914d);
    color: white;
    font-size: 1.1rem;
    margin-top: 15px;
}

.btn-secondary {
    background-color: #2c2c2c;
    color: white;
    border: 1px solid #444;
}

/* TARJETAS */
.card {
    background-color: #1e1e1e;
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.5);
}

.main-card {
    border: 1px solid #333;
}

.team-summary-card {
    border: 1px solid #444;
    background: #252525;
}

/* ESTADÍSTICAS */
.stats-row {
    display: flex;
    justify-content: space-around;
    margin-bottom: 15px;
}

.stat-item {
    display: flex;
    flex-direction: column;
}

.big-number {
    font-size: 2.5rem;
    font-weight: bold;
    color: #fff;
}

.label {
    font-size: 0.8rem;
    color: #888;
}

.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.custom-file-upload {
    display: inline-block;
    padding: 8px 12px;
    cursor: pointer;
    background-color: #333;
    border-radius: 5px;
    font-size: 0.9rem;
    margin-top: 10px;
}

/* LISTA DE EQUIPOS (DASHBOARD) */

.team-item-accent {
    width: 6px;
    /* Grosor elegante */
    height: 75px;
    /* Altura proporcional */
    background: #b8b4b4;
    /* Blanco puro */
    margin-right: 18px;
    /* Separación del texto */
    flex-shrink: 2;
    /* Que no se deforme */
}

.team-content-wrapper {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
}

/* Estilo del texto "Esta semana" */
.label-lowercase {
    font-size: 0.75rem;
    color: #888;
    text-transform: none;
    /* Forzamos minúsculas */
    margin-top: 2px;
}

.join-team-box {
    display: flex;
    gap: 5px;
    margin-top: 8px;
    margin-bottom: 15px;
}

.join-team-box input {
    margin: 0;
}

.join-team-box button {
    margin: 0;
    width: 40%;
}

.team-item {
    display: flex;
    align-items: center;
    background: #1a1a1a;
    /* Fondo oscuro profundo */
    border-radius: 0px 15px 15px 0px;
    /* Redondeo suave */
    padding: 0px 20px 0px 0px;
    /* Espaciado interno generoso */
    border: 1px solid rgba(255, 255, 255, 0.05);
    /* Borde casi invisible */
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
    cursor: pointer;
    transition: transform 0.2s, background 0.2s;
    margin-bottom: 8px;
}

.team-item:active {
    background-color: #333;
}

.team-item:hover {
    background: #222;
    transform: translateY(-2px);
}

.team-name {
    font-weight: bold;
    font-size: 1.1rem;
}

.team-score {
    font-weight: bold;
    font-size: 0.9rem;
}

/* LISTA DE MIEMBROS (DETALLE) */
.member-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 0;
    border-bottom: 1px solid #333;
}

.member-info {
    text-align: left;
}

.member-name {
    font-weight: bold;
    display: block;
}

.member-streak {
    font-size: 0.75rem;
    color: #ff914d;
}

.member-stats {
    text-align: right;
    font-size: 1.2rem;
    font-weight: bold;
    color: #888;
}

/* COLORES DE ESTADO (SEMÁFORO) */
.status-red {
    color: #ff4b4b !important;
    border-color: #ff4b4b !important;
}

/* Rojo */
.status-yellow {
    color: #ffeb3b !important;
    border-color: #ffeb3b !important;
}

/* Amarillo */
.status-green {
    color: #4caf50 !important;
    border-color: #4caf50 !important;
}

/* Verde */

.link-text {
    color: #888;
    margin-top: 15px;
    cursor: pointer;
    text-decoration: underline;
    font-size: 0.9rem;
}

/* MODAL */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.8);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    background-color: rgba(0, 0, 0, 0.85);
    /* Fondo más oscuro para resaltar el popup */
    backdrop-filter: blur(5px);
    /* Efecto de desenfoque al fondo */
}

.modal-content {
    background-color: #222;
    padding: 25px;
    border-radius: 12px;
    width: 90%;
    max-width: 300px;
    text-align: center;
    border: 1px solid #444;
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.7);
}

.modal-content h3 {
    color: white;
    margin-bottom: 10px;
}

#modal-close-btn {
    background-color: #ff4b4b;
    color: white;
    width: 100%;
}

/* AJUSTES HEADER Y TUERCA */
.user-info-row {
    display: flex;
    align-items: center;
    gap: 10px;
    /* Espacio entre nombre y tuerca */
}

.gear-icon {
    font-size: 1.5rem;
    cursor: pointer;
    transition: transform 0.3s ease;
    filter: grayscale(100%);
}

.gear-icon:hover {
    transform: rotate(90deg);
    filter: none;
    /* Recupera color o brillo al pasar el mouse */
}

/* BOTONES DEL MODAL LADO A LADO */
.modal-buttons-row {
    display: flex;
    gap: 10px;
    justify-content: center;
}

.modal-buttons-row button {
    width: 48%;
    /* Para que ocupen mitad y mitad */
    margin-top: 0;
}

/* ESTILOS DE CABECERA DE EQUIPO */
.team-identity-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-bottom: 20px;
}

.team-image-wrapper {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    overflow: hidden;
    border: 2px solid #ff914d;
    margin-bottom: 10px;
    background-color: #333;
}

.team-image-wrapper img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    /* Para que la foto no se deforme */
}

.team-title-row {
    display: flex;
    align-items: center;
    gap: 10px;
}

.small-gear {
    font-size: 1.2rem;
    /* Un poco más pequeña que la del perfil */
    color: #888;
}

/* Agrega esto a tu archivo CSS */
.member-name-link {
    color: inherit;
    /* Hereda el color del contenedor padre */
    text-decoration: none;
    /* Quita el subrayado típico de los enlaces */
    font-weight: bold;
    /* Mantiene la negrita que tenían antes */
    font-size: 1.1em;
    /* Haz el nombre ligeramente más grande */
    cursor: pointer;
    /* Asegura que el cursor indique que es clicable */
    display: inline;
    /* Asegura que no rompa el flujo */
}

.member-info .member-total-trainings {
    display: block;
    /* Fuerza el salto de línea */
    font-size: 0.9em;
    font-weight: normal;
    color: #aaa;
    /* Un color más suave */
    margin-top: 2px;
}

/* --- Estilos para user-profile.html --- */
.profile-container {
    max-width: 400px;
    /* Hacemos la tarjeta más estrecha */
    margin: 40px auto;
    padding: 20px;
    background-color: #363636;
    /* Color de la tarjeta gris oscuro */
    border-radius: 12px;
    box-shadow: 0 6px 15px rgba(0, 0, 0, 0.4);
    color: #f5f5f5;
    text-align: center;
    /* Centramos el contenido dentro de la tarjeta */
}

.profile-header-info {
    padding-bottom: 15px;
    margin-bottom: 15px;
    border-bottom: 2px solid #555;
    /* Línea de separación */
}

.profile-header-info h2 {
    font-size: 2em;
    color: #ff914d;
    /* Naranja para el nombre */
}

/* Redondeamos la foto de perfil */
.profile-photo {
    width: 90px;
    height: 90px;
    border-radius: 50%;
    object-fit: cover;
    margin: 10px auto;
    border: 3px solid #4caf50;
}

.email-display {
    font-size: 0.9em;
    color: #aaa;
    margin-bottom: 15px;
}

/* Tarjetas de estadísticas (Racha y Total) */
.stats-card-group {
    display: flex;
    justify-content: space-around;
    gap: 10px;
    padding: 10px 0;
    margin-bottom: 20px;
    border-bottom: 1px solid #444;
}

.stats-card p {
    font-size: 1.3em;
    font-weight: bold;
}

.stats-card:first-child p {
    color: #4caf50;
    /* Verde para la Racha */
}

.stats-card:last-child p {
    color: #ff914d;
    /* Naranja para los totales */
}

.stats-card h4 {
    font-size: 1em;
    color: #ddd;
    margin-bottom: 5px;
}

.stats-card p {
    font-size: 1.5em;
    font-weight: bold;
    color: #4caf50;
}

/* Sección de progreso */
.progress-section {
    padding: 20px 0;
}

.progress-section h3 {
    color: #fff;
    border-bottom: 1px dashed #555;
    padding-bottom: 8px;
    margin-bottom: 15px;
}

.weekly-count {
    font-weight: bold;
    color: #ff914d;
}

.info-footer {
    font-size: 0.9em;
    color: #aaa;
    padding-top: 15px;
    border-top: 1px solid #444;
}

/* --- Estilos para la nueva cabecera de perfil --- */

/* Contenedor principal de la cabecera */
.profile-header-container {
    display: flex !important;
    /* Permite alinear elementos en una fila */
    justify-content: space-between !important;
    /* Espacia los botones de acción */
    align-items: center;
    /* Centra verticalmente los elementos */
    background-color: #1e1e1e;
    /* Color oscuro similar al fondo del dashboard */
    padding: 10px 15px;
    border-bottom: 1px solid #333;
    position: sticky;
    /* Fija la cabecera en la parte superior */
    top: 0;
    z-index: 1000;
    /* Asegura que esté por encima de otros elementos */
}

/* Espacio donde va el logo, centrado en el medio */
.header-title-section {
    flex-grow: 1;
    /* Permite que ocupe el espacio central */
    text-align: center;
}

/* Reducimos el logo en la cabecera */
.profile-header-container .logo img {
    height: 40px !important;
    /* Haz el logo más pequeño para la cabecera */
    margin: 0;
    padding: 0;
}

/* Estilo para los botones de acción */
.header-action-btn {
    padding: 8px 12px;
    background-color: #3a3a3a;
    color: #f5f5f5;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-weight: bold;
    font-size: 0.9em;
    transition: background-color 0.2s;
}

.header-action-btn:hover {
    background-color: #555;
}

/* Las secciones de acción deben tener espacio reservado */
.header-logo-section,
.header-actions-section {
    flex-basis: auto;
    /* Dejar que el contenido defina el tamaño */
    min-width: 100px;
    /* Asegura un mínimo de espacio */
}

.header-logo-section {
    text-align: left;
}

.header-actions-section {
    text-align: right;
}

/* Asegurar que la sección principal no tenga padding superior */
main.container {
    padding-top: 0 !important;
}

/* Ocultar el logo y los botones sueltos que estaban antes */
/* (Si todavía aparecen en el cuerpo principal, esto los ocultará) */
main .logo,
main button {
    display: none !important;
}

.racha-dinamica {
    color: #4caf50;
}