/* Estilos para el sistema de retos diarios */

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

/* ===================================
   HEADER Y NAVEGACIÓN
   =================================== */

.challenge-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);
}

/* Pestañas de navegación */
.challenge-tabs {
    padding: 1rem;
}

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

.tab-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 0.75rem 0.5rem;
    border-radius: 12px;
    transition: all 0.3s ease;
    background: rgba(255, 255, 255, 0.05);
    border: 2px solid rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.9);
}

.tab-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: #667eea;
    color: rgba(255, 255, 255, 0.9);
}

.tab-btn.active {
    background: rgba(102, 126, 234, 0.2);
    border-color: #667eea;
    color: #667eea;
}

.tab-icon {
    font-size: 1.25rem;
    margin-bottom: 0.25rem;
}

.tab-text {
    font-size: 0.75rem;
    font-weight: 500;
}

/* ===================================
   RETO COMPLETADO
   =================================== */

.completed-challenge {
    padding: 2rem;
    text-align: center;
}

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

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

.completion-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 */
}

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

.challenge-summary {
    margin-bottom: 2rem;
}

.challenge-card {
    display: flex;
    align-items: center;
    padding: 1.5rem;
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.05);
    border: 2px solid rgba(34, 197, 94, 0.3);
}

.challenge-card.completed {
    background: rgba(34, 197, 94, 0.1);
}

.challenge-icon {
    font-size: 3rem;
    margin-right: 1.5rem;
}

.challenge-info {
    flex: 1;
}

.challenge-name {
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: rgba(255, 255, 255, 0.9);
}

.challenge-description {
    font-size: 1rem;
    opacity: 0.8;
    margin-bottom: 0.5rem;
    line-height: 1.4;
}

.challenge-target {
    font-size: 0.875rem;
    color: #22c55e;
    font-weight: 600;
}

.challenge-points {
    text-align: center;
    padding: 0.75rem;
    background: rgba(102, 126, 234, 0.2);
    border-radius: 12px;
}

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

.points-label {
    font-size: 0.75rem;
    opacity: 0.8;
}

.next-challenge-info {
    padding: 1.5rem;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 12px;
}

.countdown-timer {
    font-size: 1.25rem;
    font-weight: 600;
    color: #667eea;
    margin-top: 0.5rem;
}

/* ===================================
   RETO ACTIVO
   =================================== */

.active-challenge {
    padding: 1.5rem;
}

.challenge-info-card {
    margin-bottom: 1.5rem;
}

.challenge-header-info {
    display: flex;
    align-items: flex-start;
    margin-bottom: 1rem;
}

.challenge-icon-large {
    font-size: 4rem;
    margin-right: 1.5rem;
    flex-shrink: 0;
}

.challenge-details {
    flex: 1;
}

.challenge-name {
    font-size: 1.75rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    color: rgba(255, 255, 255, 0.9);
}

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

.challenge-category {
    display: flex;
    gap: 0.5rem;
}

.category-tag,
.difficulty-tag {
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
}

.category-tag.cardio {
    background: rgba(239, 68, 68, 0.2);
    color: #ef4444;
}

.category-tag.strength {
    background: rgba(59, 130, 246, 0.2);
    color: #3b82f6;
}

.category-tag.endurance {
    background: rgba(245, 158, 11, 0.2);
    color: #f59e0b;
}

.difficulty-tag.beginner {
    background: rgba(34, 197, 94, 0.2);
    color: #22c55e;
}

.difficulty-tag.intermediate {
    background: rgba(245, 158, 11, 0.2);
    color: #f59e0b;
}

.difficulty-tag.advanced {
    background: rgba(239, 68, 68, 0.2);
    color: #ef4444;
}

.challenge-target-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 12px;
}

.target-display,
.points-display {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.target-label {
    font-size: 0.875rem;
    opacity: 0.8;
}

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

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

.points-text {
    font-size: 1rem;
    font-weight: 600;
    color: #667eea;
}

/* Progreso del reto */
.challenge-progress {
    margin-bottom: 1.5rem;
    padding: 1rem;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 12px;
}

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

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

.progress-timer {
    font-size: 1.25rem;
    font-weight: 700;
    color: #667eea;
}

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

.progress-bar-container {
    flex: 1;
}

.progress-bar {
    width: 100%;
    height: 12px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 6px;
    overflow: hidden;
    margin-bottom: 0.5rem;
}

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

.progress-text {
    text-align: center;
    font-size: 1rem;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.9);
}

.rep-counter {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
}

.rep-btn {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    font-weight: 700;
}

.current-reps {
    font-size: 2rem;
    font-weight: 700;
    color: #667eea;
    min-width: 60px;
    text-align: center;
}

/* Instrucciones */
.challenge-instructions {
    margin-bottom: 1.5rem;
}

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

.instructions-list {
    margin: 0;
    padding-left: 1.25rem;
    margin-bottom: 1rem;
}

.instruction-item {
    font-size: 0.875rem;
    line-height: 1.5;
    margin-bottom: 0.5rem;
    opacity: 0.8;
}

.challenge-tip {
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
    padding: 0.75rem;
    background: rgba(245, 158, 11, 0.1);
    border-radius: 8px;
    border-left: 3px solid #f59e0b;
}

.tip-icon {
    font-size: 1rem;
    flex-shrink: 0;
}

.tip-text {
    font-size: 0.875rem;
    line-height: 1.4;
    color: rgba(255, 255, 255, 0.9);
}

/* Controles */
.challenge-controls {
    margin-top: 1.5rem;
}

.active-controls {
    display: grid;
    grid-template-columns: 1fr 2fr 1fr;
    gap: 0.75rem;
}

/* ===================================
   ESTADÍSTICAS DEL USUARIO
   =================================== */

.user-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.75rem;
    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;
}

/* ===================================
   SELECTOR DE DIFICULTAD
   =================================== */

.difficulty-selector {
    padding: 1.5rem;
}

.difficulty-options {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
}

.difficulty-option {
    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);
    text-align: center;
}

.difficulty-option:hover {
    border-color: #667eea;
    background: rgba(102, 126, 234, 0.1);
}

.difficulty-option.selected {
    border-color: #667eea;
    background: rgba(102, 126, 234, 0.2);
}

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

.difficulty-name {
    font-weight: 600;
    text-transform: capitalize;
    color: rgba(255, 255, 255, 0.9);
}

.difficulty-points {
    font-size: 0.75rem;
    background: rgba(102, 126, 234, 0.3);
    color: #667eea;
    padding: 0.25rem 0.5rem;
    border-radius: 12px;
    font-weight: 600;
}

.difficulty-target {
    font-size: 0.875rem;
    opacity: 0.8;
}

/* ===================================
   PRÓXIMOS RETOS
   =================================== */

.upcoming-challenges {
    padding: 1.5rem;
}

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

.upcoming-item {
    display: grid;
    grid-template-columns: auto 1fr auto;
    gap: 1rem;
    align-items: center;
    padding: 0.75rem;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 8px;
}

.upcoming-date {
    font-size: 0.75rem;
    opacity: 0.8;
    text-transform: uppercase;
    font-weight: 600;
    min-width: 60px;
}

.upcoming-challenge {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

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

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

.upcoming-category {
    text-align: right;
}

/* ===================================
   VISTAS PLACEHOLDER
   =================================== */

.placeholder-content {
    text-align: center;
    padding: 4rem 2rem;
}

.placeholder-content .page-title {
    margin-bottom: 1rem;
}

.placeholder-content p {
    font-size: 1.125rem;
    opacity: 0.6;
}

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

@media (max-width: 768px) {
    .challenges-container {
        padding: 0.5rem;
    }
    
    .page-title {
        font-size: 1.75rem;
    }
    
    .tabs-nav {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.75rem;
    }
    
    .tab-btn {
        padding: 1rem 0.75rem;
    }
    
    .tab-text {
        font-size: 0.875rem;
    }
    
    .challenge-header-info {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }
    
    .challenge-icon-large {
        margin-right: 0;
        margin-bottom: 1rem;
    }
    
    .challenge-target-info {
        flex-direction: column;
        gap: 1rem;
    }
    
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .difficulty-options {
        grid-template-columns: 1fr;
    }
    
    .active-controls {
        grid-template-columns: 1fr;
    }
    
    .upcoming-item {
        grid-template-columns: 1fr;
        text-align: center;
        gap: 0.5rem;
    }
}

@media (max-width: 480px) {
    .challenge-card {
        flex-direction: column;
        text-align: center;
        gap: 1rem;
    }
    
    .challenge-icon {
        margin-right: 0;
        margin-bottom: 0.5rem;
    }
    
    .rep-counter {
        flex-direction: column;
        gap: 0.75rem;
    }
    
    .current-reps {
        font-size: 1.75rem;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
    }
    
    .completion-icon {
        font-size: 3rem;
    }
    
    .completion-title {
        font-size: 1.75rem;
    }
}

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

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

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

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

.rep-btn:active {
    animation: pulse 0.3s ease;
}

/* Mejoras de accesibilidad */
@media (prefers-reduced-motion: reduce) {
    .tab-btn,
    .difficulty-option,
    .rep-btn,
    .glass-fade-in {
        transition: none;
        animation: none;
    }
}

/* Alto contraste */
@media (prefers-contrast: high) {
    .tab-btn,
    .difficulty-option,
    .challenge-card {
        border-color: rgba(255, 255, 255, 0.3);
    }
    
    .tab-btn:hover,
    .difficulty-option:hover {
        border-color: #ffffff;
    }
    
    .page-title,
    .completion-title {
        color: #ffffff;
    }
}