/* Estilos para el sistema completo de entrenamientos */

.workouts-container {
    padding: 1rem;
    max-width: 800px;
    margin: 0 auto;
}

/* ===================================
   SELECCIÓN DE ENTRENAMIENTOS
   =================================== */

.workout-selection {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

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

.page-title {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    color: #667eea; /* Fallback */
}

.page-subtitle {
    font-size: 1.125rem;
    opacity: 0.8;
}

.section-title {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 0.8rem;
    color: rgba(255, 255, 255, 0.9);
}

/* Planes activos */
.active-plans {
    padding: 1.5rem;
}

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

/* Tipos de entrenamiento */
.workout-types {
    padding: 1.5rem;
}

.workout-type-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem;
}

.workout-type-card {
    padding: 2rem;
    border-radius: 16px;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: center;
    border: 2px solid rgba(255, 255, 255, 0.1);
    position: relative;
    overflow: hidden;
}

.workout-type-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(255,255,255,0.1), rgba(255,255,255,0.05));
    opacity: 0;
    transition: opacity 0.3s ease;
}

.workout-type-card:hover::before {
    opacity: 1;
}

.workout-type-card:hover {
    transform: translateY(-4px);
    border-color: #667eea;
    box-shadow: 0 8px 32px rgba(0,0,0,0.2);
}

.type-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
}

.type-title {
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 0.75rem;
    color: rgba(255, 255, 255, 0.9);
}

.type-description {
    font-size: 1rem;
    opacity: 0.8;
    margin-bottom: 1.5rem;
    line-height: 1.5;
}

.type-features {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.feature-tag {
    background: rgba(102, 126, 234, 0.2);
    color: #667eea;
    padding: 0.5rem 1rem;
    border-radius: 20px;
    font-size: 0.875rem;
    font-weight: 500;
}

/* Entrenamiento rápido */
.quick-workout {
    padding: 1.5rem;
}

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

.quick-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 1rem;
    text-align: center;
    transition: all 0.3s ease;
    border-radius: 12px;
    min-height: 80px;
}

.quick-btn:hover {
    transform: translateY(-2px);
}

.quick-icon {
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
}

.quick-text {
    font-size: 0.875rem;
    font-weight: 500;
}

/* Estadísticas rápidas */
.workout-stats {
    padding: 1.5rem;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1rem;
}

.stat-item {
    text-align: center;
}

.stat-value {
    font-size: 1.5rem;
    font-weight: 700;
    color: #667eea;
    margin-bottom: 0.25rem;
}

.stat-label {
    font-size: 0.75rem;
    opacity: 0.8;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* ===================================
   PLANIFICACIÓN DE GYM
   =================================== */

.gym-planning {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.planning-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1rem;
}

/* Grupos musculares */
.muscle-groups {
    padding: 1.5rem;
}

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

.muscle-group-card {
    padding: 1rem;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: center;
    border: 2px solid rgba(255, 255, 255, 0.1);
    background: rgba(255, 255, 255, 0.05);
    position: relative;
}

.muscle-group-card:hover {
    transform: translateY(-2px);
    border-color: var(--group-color, #667eea);
}

.muscle-group-card.selected {
    border-color: var(--group-color, #667eea);
    background: rgba(102, 126, 234, 0.1);
}

.group-icon {
    font-size: 2rem;
    margin-bottom: 0.5rem;
}

.group-name {
    font-weight: 600;
    margin-bottom: 0.25rem;
    color: rgba(255, 255, 255, 0.9);
}

.group-exercises-count {
    font-size: 0.75rem;
    opacity: 0.7;
}

/* Configuración del entrenamiento */
.workout-config {
    padding: 1.5rem;
}

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

.config-item {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.config-label {
    font-size: 0.875rem;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.9);
}

.toggle-container {
    position: relative;
    display: inline-block;
    width: 50px;
    height: 24px;
}

.toggle-container input {
    opacity: 0;
    width: 0;
    height: 0;
}

.toggle-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(255, 255, 255, 0.2);
    transition: 0.3s;
    border-radius: 24px;
}

.toggle-slider:before {
    position: absolute;
    content: "";
    height: 20px;
    width: 20px;
    left: 2px;
    bottom: 2px;
    background-color: white;
    transition: 0.3s;
    border-radius: 50%;
}

input:checked + .toggle-slider {
    background-color: #667eea;
}

input:checked + .toggle-slider:before {
    transform: translateX(26px);
}

/* Ejercicios seleccionados */
.selected-exercises {
    padding: 1.5rem;
}

.exercises-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.exercise-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 8px;
}

.exercise-info {
    flex: 1;
}

.exercise-name {
    font-weight: 600;
    margin-bottom: 0.25rem;
    color: rgba(255, 255, 255, 0.9);
}

.exercise-muscle {
    font-size: 0.75rem;
    opacity: 0.7;
    text-transform: uppercase;
}

.exercise-config {
    display: flex;
    gap: 1rem;
    font-size: 0.875rem;
    opacity: 0.8;
}

/* ===================================
   PLANIFICACIÓN DE CROSSFIT
   =================================== */

.crossfit-planning {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

/* Tipos de WOD */
.wod-types {
    padding: 1.5rem;
}

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

.wod-type-card {
    display: flex;
    align-items: center;
    padding: 1rem;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    border: 2px solid rgba(255, 255, 255, 0.1);
    background: rgba(255, 255, 255, 0.05);
}

.wod-type-card:hover {
    transform: translateY(-2px);
    border-color: #667eea;
}

.wod-type-icon {
    font-size: 2rem;
    margin-right: 1rem;
}

.wod-type-content {
    flex: 1;
}

.wod-type-name {
    font-weight: 600;
    margin-bottom: 0.25rem;
    color: rgba(255, 255, 255, 0.9);
}

.wod-type-description {
    font-size: 0.875rem;
    opacity: 0.8;
    line-height: 1.4;
}

/* WODs destacados */
.featured-wods {
    padding: 1.5rem;
}

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

.wod-card {
    padding: 1rem;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    border: 2px solid rgba(255, 255, 255, 0.1);
    background: rgba(255, 255, 255, 0.05);
}

.wod-card:hover {
    transform: translateY(-2px);
    border-color: #667eea;
}

.wod-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 0.75rem;
}

.wod-name {
    font-weight: 600;
    color: rgba(255, 255, 255, 0.9);
}

.wod-type {
    font-size: 0.75rem;
    padding: 0.25rem 0.5rem;
    border-radius: 12px;
    font-weight: 600;
    text-transform: uppercase;
}

.wod-type.amrap {
    background: rgba(34, 197, 94, 0.2);
    color: #22c55e;
}

.wod-type.emom {
    background: rgba(59, 130, 246, 0.2);
    color: #3b82f6;
}

.wod-type.for_time {
    background: rgba(239, 68, 68, 0.2);
    color: #ef4444;
}

.wod-type.tabata {
    background: rgba(245, 158, 11, 0.2);
    color: #f59e0b;
}

.wod-description {
    font-size: 0.875rem;
    opacity: 0.8;
    margin-bottom: 0.75rem;
    line-height: 1.4;
}

.wod-details {
    display: flex;
    gap: 1rem;
    margin-bottom: 0.75rem;
    font-size: 0.75rem;
    opacity: 0.8;
}

.wod-difficulty.beginner {
    color: #22c55e;
}

.wod-difficulty.intermediate {
    color: #f59e0b;
}

.wod-difficulty.advanced {
    color: #ef4444;
}

.wod-exercises {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.exercise-tag {
    background: rgba(102, 126, 234, 0.2);
    color: #667eea;
    padding: 0.25rem 0.5rem;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 500;
}

.more-exercises {
    background: rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.9);
    padding: 0.25rem 0.5rem;
    border-radius: 12px;
    font-size: 0.75rem;
}

/* ===================================
   ENTRENAMIENTO ACTIVO
   =================================== */

.active-gym-workout {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

/* Header del entrenamiento */
.workout-header {
    padding: 1rem;
}

.workout-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.control-btn {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.control-btn:hover {
    transform: scale(1.1);
}

.control-icon {
    font-size: 1.25rem;
}

.workout-time {
    text-align: center;
}

.time-label {
    display: block;
    font-size: 0.75rem;
    opacity: 0.8;
    margin-bottom: 0.25rem;
}

.time-value {
    font-size: 1.5rem;
    font-weight: 700;
    color: #667eea;
}

/* Progreso del entrenamiento */
.workout-progress {
    padding: 1rem;
}

.progress-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
    font-size: 0.875rem;
}

.progress-percentage {
    font-weight: 600;
    color: #667eea;
}

.progress-bar {
    width: 100%;
    height: 8px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 4px;
    transition: width 0.3s ease;
}

/* Ejercicio actual */
.current-exercise {
    padding: 1.5rem;
}

.exercise-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 1rem;
}

.exercise-name {
    font-size: 1.5rem;
    font-weight: 700;
    color: rgba(255, 255, 255, 0.9);
}

.info-btn {
    font-size: 0.75rem;
}

.exercise-details {
    margin-bottom: 1.5rem;
}

.target-info {
    display: flex;
    gap: 1rem;
    font-size: 0.875rem;
    opacity: 0.8;
}

/* Tracker de series */
.sets-tracker {
    margin-bottom: 1.5rem;
}

.sets-title {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 1rem;
    color: rgba(255, 255, 255, 0.9);
}

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

.set-item {
    padding: 0.75rem 0.5rem;
    border-radius: 8px;
    text-align: center;
    border: 2px solid rgba(255, 255, 255, 0.1);
    transition: all 0.3s ease;
}

.set-item.completed {
    border-color: #22c55e;
    background: rgba(34, 197, 94, 0.1);
}

.set-item.current {
    border-color: #667eea;
    background: rgba(102, 126, 234, 0.1);
}

.set-number {
    font-weight: 600;
    margin-bottom: 0.25rem;
    color: rgba(255, 255, 255, 0.9);
}

.set-data {
    display: flex;
    flex-direction: column;
    gap: 0.125rem;
}

.set-weight,
.set-reps {
    font-size: 0.75rem;
    opacity: 0.8;
}

.set-pending {
    opacity: 0.5;
    font-size: 0.875rem;
}

/* Input de serie actual */
.current-set-input {
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    padding-top: 1rem;
}

.input-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    margin-bottom: 1rem;
}

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

.input-label {
    font-size: 0.875rem;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.9);
}

/* Timer de descanso */
.rest-timer {
    padding: 1.5rem;
    text-align: center;
}

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

.rest-title {
    font-size: 1.25rem;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.9);
}

.rest-display {
    margin-bottom: 1.5rem;
}

.rest-time {
    font-size: 3rem;
    font-weight: 700;
    color: #f59e0b;
    margin-bottom: 1rem;
}

.rest-progress {
    width: 100%;
    height: 8px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
    overflow: hidden;
}

.rest-progress-fill {
    height: 100%;
    background: #f59e0b;
    border-radius: 4px;
    transition: width 1s linear;
}

.rest-controls {
    display: flex;
    gap: 1rem;
    justify-content: center;
}

/* Navegación de ejercicios */
.exercise-navigation {
    display: flex;
    gap: 1rem;
    justify-content: space-between;
}

.exercise-navigation .glass-button {
    flex: 1;
}

/* ===================================
   GESTIÓN DE PLANES
   =================================== */

.plan-management {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.management-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1rem;
}

/* Planes activos - gestión */
.active-plans-management {
    padding: 1.5rem;
}

.plans-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.plan-item {
    padding: 1rem;
    border-radius: 12px;
    border: 2px solid rgba(255, 255, 255, 0.1);
}

.plan-info {
    margin-bottom: 1rem;
}

.plan-name {
    font-weight: 600;
    margin-bottom: 0.25rem;
    color: rgba(255, 255, 255, 0.9);
}

.plan-description {
    font-size: 0.875rem;
    opacity: 0.8;
    margin-bottom: 0.75rem;
}

.plan-progress {
    margin-bottom: 1rem;
}

.progress-text {
    font-size: 0.875rem;
    margin-bottom: 0.5rem;
    opacity: 0.8;
}

.plan-actions {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.plan-action-btn {
    padding: 0.5rem 1rem;
    border-radius: 8px;
    font-size: 0.875rem;
    font-weight: 500;
    transition: all 0.3s ease;
    border: 1px solid rgba(255, 255, 255, 0.2);
    background: rgba(255, 255, 255, 0.05);
}

.continue-btn {
    background: rgba(34, 197, 94, 0.2);
    border-color: #22c55e;
    color: #22c55e;
}

.restart-btn {
    background: rgba(59, 130, 246, 0.2);
    border-color: #3b82f6;
    color: #3b82f6;
}

.close-btn {
    background: rgba(239, 68, 68, 0.2);
    border-color: #ef4444;
    color: #ef4444;
}

.plan-action-btn:hover {
    transform: translateY(-1px);
    opacity: 0.9;
}

/* Estados vacíos */
.empty-state {
    text-align: center;
    padding: 2rem;
    opacity: 0.6;
}

.empty-state p {
    margin: 0.5rem 0;
}

/* ===================================
   RESPONSIVE
   =================================== */

@media (max-width: 768px) {
    .workouts-container {
        padding: 0.5rem;
    }
    
    .page-title {
        font-size: 1.75rem;
    }
    
    .workout-type-grid {
        grid-template-columns: 1fr;
    }
    
    .muscle-group-grid {
        grid-template-columns: repeat(3, 1fr);
    }
    
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .config-grid {
        grid-template-columns: 1fr;
    }
    
    .wod-type-grid {
        grid-template-columns: 1fr;
    }
    
    .wods-list {
        grid-template-columns: 1fr;
    }
    
    .input-row {
        grid-template-columns: 1fr;
    }
    
    .sets-grid {
        grid-template-columns: repeat(4, 1fr);
    }
    
    .plan-actions {
        flex-direction: column;
    }
    
    .exercise-navigation {
        flex-direction: column;
    }
}

@media (max-width: 480px) {
    .workout-controls {
        flex-direction: column;
        gap: 1rem;
    }
    
    .control-btn {
        width: 45px;
        height: 45px;
    }
    
    .muscle-group-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .sets-grid {
        grid-template-columns: repeat(3, 1fr);
    }
    
    .rest-time {
        font-size: 2.5rem;
    }
    
    .quick-options {
        grid-template-columns: 1fr;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
    }
}

/* ===================================
   ANIMACIONES
   =================================== */

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

.glass-fade-in {
    animation: slideInUp 0.6s ease-out;
}

/* Estados hover y active */
.workout-type-card:active,
.muscle-group-card:active,
.wod-card:active {
    transform: translateY(-2px) scale(0.98);
}

/* Mejoras de accesibilidad */
@media (prefers-reduced-motion: reduce) {
    .workout-type-card,
    .muscle-group-card,
    .wod-card,
    .quick-btn,
    .control-btn,
    .glass-fade-in {
        transition: none;
        animation: none;
    }
}

/* Alto contraste */
@media (prefers-contrast: high) {
    .workout-type-card,
    .muscle-group-card,
    .wod-card {
        border-color: rgba(255, 255, 255, 0.3);
    }
    
    .workout-type-card:hover,
    .muscle-group-card:hover,
    .wod-card:hover {
        border-color: #ffffff;
    }
    
    .page-title {
        color: #ffffff;
    }
}