/* =========================================
   VARIABLES GLOBALES (Estilo Dribbble / UI Kit 2026)
   ========================================= */
:root {
    --bg-color: #0a0b10; /* Negro profundo azulado */
    --card-bg: #1a1c23; /* Gris sólido de las tarjetas */
    --primary-color: #00e5ff; /* Color neón principal */
    --primary-gradient: linear-gradient(135deg, var(--primary-color) 0%, #0076ff 100%);
    --text-main: #ffffff;
    --text-muted: #8b8d98;
}

* { 
    margin: 0; 
    padding: 0; 
    box-sizing: border-box; 
    font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Display', 'Segoe UI', Roboto, sans-serif; 
    -webkit-tap-highlight-color: transparent; 
}

/* =========================================
   ESTRUCTURA BASE Y PANTALLAS (¡Vuelve a funcionar!)
   ========================================= */
html, body { 
    background-color: var(--bg-color); 
    color: var(--text-main);
    width: 100vw;
    max-width: 100vw;
    min-height: 100vh;
    overflow-x: hidden; 
    overflow-y: auto; 
    position: relative;
}

body.amoled { background-color: #000000; }
body.amoled .card { background-color: #0d0e12; }

/* REGLA VITAL: Oculta y muestra las pantallas */
.pantalla { display: none; padding: 20px; max-width: 600px; margin: 0 auto; padding-bottom: 50px; }
.pantalla.activa { display: block; animation: aparecer 0.3s ease; }
@keyframes aparecer { from { opacity: 0; transform: translateY(15px); } to { opacity: 1; transform: translateY(0); } }

/* =========================================
   SISTEMA DE TARJETAS (Neo-Dark Flat)
   ========================================= */
.card { 
    background: var(--card-bg); 
    border: none; /* Sin bordes */
    border-radius: 28px; /* Curvas súper redondeadas y modernas */
    padding: 24px; 
    margin-bottom: 20px; 
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.4); /* Sombra amplia para que floten */
    max-width: 100%; 
    overflow-x: hidden;
}

.row { display: flex; flex-wrap: wrap; width: 100%; gap: 12px; }
.col { flex: 1; display: flex; flex-direction: column; }

/* =========================================
   MENÚ LATERAL (SIDEBAR)
   ========================================= */
.sidebar-overlay {
    position: fixed; top: 0; left: 0; width: 100vw; height: 100vh;
    background: rgba(0,0,0,0.8); backdrop-filter: blur(4px);
    z-index: 9998; display: none; opacity: 0; transition: opacity 0.3s ease;
}
.sidebar-overlay.activo { display: block; opacity: 1; }

.sidebar-menu {
    position: fixed; top: 0; left: -85vw; width: 85vw; max-width: 350px; 
    height: 100vh; height: 100dvh; background: var(--bg-color); 
    border-right: 1px solid rgba(255,255,255,0.02); z-index: 9999; 
    display: flex; flex-direction: column; padding: 30px 20px 40px 20px; 
    transition: left 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 10px 0 40px rgba(0,0,0,0.8);
}
.sidebar-menu.activo { left: 0; }

.sidebar-header {
    display: flex; justify-content: space-between; align-items: flex-start;
    padding-bottom: 25px; border-bottom: 1px solid rgba(255,255,255,0.05); margin-bottom: 25px;
}
.sidebar-links { display: flex; flex-direction: column; gap: 8px; }

.sidebar-btn {
    background: transparent; border: none; color: var(--text-muted);
    text-align: left; padding: 18px 20px; border-radius: 16px; font-size: 17px;
    cursor: pointer; transition: all 0.2s ease; display: flex; align-items: center; gap: 15px; font-weight: 500;
}
.sidebar-btn:hover { background: rgba(255, 255, 255, 0.05); }

.sidebar-btn.activo {
    background: #1a1c23; color: var(--primary-color); font-weight: bold;
    border-left: 4px solid var(--primary-color); 
    border-top-left-radius: 4px; border-bottom-left-radius: 4px;
}

/* =========================================
   INPUTS Y BOTONES GLOBALES
   ========================================= */
input, select { 
    width: 100%; 
    padding: 16px; 
    margin-top: 8px; 
    margin-bottom: 16px; 
    background: #12141a; /* Más oscuro para que se hunda */
    border: 2px solid transparent; 
    color: var(--text-main); 
    border-radius: 16px; 
    font-size: 16px; 
    transition: all 0.3s ease;
    max-width: 100%;
}
input:disabled { opacity: 0.5; }

input:focus, select:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 4px rgba(0, 229, 255, 0.15);
}

label { 
    font-size: 12px; 
    font-weight: 600;
    color: var(--text-muted); 
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.btn-principal { 
    width: 100%; 
    background: var(--primary-gradient); /* Botón con degradado */
    color: #ffffff; 
    font-weight: 700; 
    padding: 18px; 
    border: none; 
    border-radius: 20px; /* Curvas gordas */
    font-size: 16px; 
    cursor: pointer; 
    box-shadow: 0 8px 24px rgba(0, 229, 255, 0.3); /* Brillo del color */
    transition: transform 0.2s ease, box-shadow 0.2s ease; 
}
.btn-principal:disabled { background: #2a2c33; color: #555; cursor: not-allowed; box-shadow: none; }
.btn-principal:active { transform: scale(0.96); box-shadow: 0 4px 12px rgba(0, 229, 255, 0.2); }
.btn-interactivo:active { transform: scale(0.96); }

/* =========================================
   CALENDARIO Y CABECERA
   ========================================= */
.calendario-premium { 
    display: flex; justify-content: space-between; align-items: center; 
    background: var(--card-bg); padding: 12px 15px; border-radius: 20px; 
    margin-bottom: 24px; box-shadow: 0 8px 24px rgba(0,0,0,0.3);
}
.btn-fecha { background: transparent; border: none; color: var(--primary-color); cursor: pointer; display: flex; align-items: center; justify-content: center; width: 40px; height: 40px; }
.btn-fecha svg { width: 24px; height: 24px; }
.fecha-display-container { position: relative; display: flex; flex-direction: column; align-items: center; flex: 1; }
#fecha-texto-bonito { font-weight: bold; font-size: 16px; }
.date-picker-oculto { position: absolute; top: 0; left: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; margin: 0; }

/* =========================================
   SELECTOR DE EJERCICIOS Y MODALES
   ========================================= */
.ejercicio-selector-box { background: #12141a; border: 2px dashed #2a2c33; padding: 18px; border-radius: 20px; display: flex; justify-content: space-between; align-items: center; cursor: pointer; margin-bottom: 15px; transition: all 0.3s; }
.ejercicio-selector-box.seleccionado { border-style: solid; border-color: var(--primary-color); background: rgba(0, 229, 255, 0.05); }

.btn-musculo { background: #12141a; border: none; border-radius: 20px; padding: 15px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; color: white; cursor: pointer; font-size: 14px; transition: transform 0.2s; }
.btn-musculo:active { transform: scale(0.95); }
.btn-musculo span { font-size: 30px; }

.lista-limpia { list-style: none; padding: 0; margin: 0; }
.item-lista { padding: 16px 0; border-bottom: 1px solid rgba(255,255,255,0.03); display: flex; justify-content: space-between; align-items: center; }
.item-lista.clicable { cursor: pointer; }
.item-lista.clicable:hover { background: rgba(255,255,255,0.02); }

/* Modales */
.modal-oculto { display: none; position: fixed; top: 0; left: 0; width: 100vw; height: 100vh; background: rgba(0,0,0,0.85); z-index: 10000; justify-content: center; align-items: center; padding: 20px; }
.modal-card { width: 100%; max-width: 400px; max-height: 90vh; overflow-y: auto; position: relative; background: var(--card-bg); border-radius: 28px; padding: 24px; box-shadow: 0 20px 60px rgba(0,0,0,0.6); }
.cerrar-modal { position: absolute; top: 15px; right: 20px; font-size: 28px; color: var(--text-muted); cursor: pointer; }

/* =========================================
   TARJETAS DE ENTRENAMIENTO Y SERIES
   ========================================= */
.ejercicio-card { background: #12141a; border-radius: 24px; overflow: hidden; margin-bottom: 20px; box-shadow: 0 8px 24px rgba(0,0,0,0.2); }
.ejercicio-card-header { background: rgba(255,255,255,0.02); padding: 16px 20px; font-weight: bold; display: flex; justify-content: space-between; align-items: center; border-bottom: 1px solid rgba(255,255,255,0.02); }
.serie-row { display: flex; justify-content: space-between; align-items: center; padding: 14px 20px; border-bottom: 1px solid rgba(255,255,255,0.02); }
.serie-row:last-child { border-bottom: none; }
.serie-calentamiento { background: rgba(255, 202, 40, 0.04); }

.serie-num { background: #2a2c33; color: white; width: 28px; height: 28px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 13px; font-weight: bold; margin-right: 12px; }
.serie-info { font-size: 15px; display: flex; align-items: center; flex-wrap: wrap; }
.etiqueta-rm { background: rgba(0, 229, 255, 0.15); color: var(--primary-color); padding: 4px 8px; border-radius: 8px; font-size: 11px; margin-left: 8px; font-weight: bold; }
.etiqueta-dropset { background: rgba(255, 82, 82, 0.15); color: #ff5252; padding: 4px 8px; border-radius: 8px; font-size: 11px; margin-left: 8px; font-weight: bold; }
.etiqueta-superserie { background: rgba(41, 121, 255, 0.15); color: #2979FF; padding: 4px 8px; border-radius: 8px; font-size: 11px; margin-left: 8px; font-weight: bold; }

.btn-opcion-serie { display: flex; align-items: center; gap: 8px; background: #1a1c23; padding: 10px 16px; border-radius: 20px; border: none; cursor: pointer; font-size: 13px; }
.btn-opcion-serie input { margin: 0; width: auto; }

/* =========================================
   TEMPORIZADOR Y ACORDEÓN
   ========================================= */
.temporizador-oculto { display: none !important; }
#temporizador-banner { 
    background: var(--primary-gradient); 
    border-radius: 24px; padding: 18px; margin-bottom: 24px; display: flex; 
    justify-content: space-between; align-items: center; box-shadow: 0 8px 30px rgba(0, 229, 255, 0.25); color: #000; font-weight: bold;
}
.timer-controls { display: flex; gap: 8px; flex-wrap: wrap; width: 100%; margin-top: 10px; }
.timer-controls button { flex: 1; background: rgba(0,0,0,0.2); color: #000; border: none; padding: 10px 0; border-radius: 12px; font-size: 14px; font-weight: bold; cursor: pointer; transition: all 0.2s; }
.timer-controls button:active { background: rgba(0,0,0,0.4); }
.btn-saltar { background: rgba(0,0,0,0.3); color: #000; border: none; padding: 8px 12px; border-radius: 12px; cursor: pointer; font-size: 13px; font-weight: bold; }

.acordeon-btn { width: 100%; background: #12141a; color: white; border: none; padding: 18px 20px; text-align: left; font-size: 15px; cursor: pointer; display: flex; justify-content: space-between; align-items: center; font-weight: bold; border-radius: 20px; }
.acordeon-content { max-height: 0; overflow: hidden; transition: max-height 0.3s ease-out; padding: 0 15px; }
.acordeon-content.abierto { max-height: 1000px; transition: max-height 0.5s ease-in; }
.rutinas-botones { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 12px; }
.btn-rutina { background: #2a2c33; color: white; border: none; padding: 10px 16px; border-radius: 20px; font-size: 13px; cursor: pointer; font-weight: 600; }

/* =========================================
   LOGROS, ESTADÍSTICAS Y MISCELÁNEA
   ========================================= */
.logros-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 12px; }
.logro-item { background: #12141a; border-radius: 20px; padding: 20px 10px; text-align: center; opacity: 0.4; filter: grayscale(100%); transition: all 0.3s; }
.logro-item.desbloqueado { opacity: 1; filter: grayscale(0%); background: rgba(0, 229, 255, 0.05); }
.logro-icono { font-size: 34px; margin-bottom: 8px; }
.logro-info h4 { font-size: 14px; margin: 0 0 4px 0; color: white; }
.logro-info p { font-size: 12px; color: var(--text-muted); margin: 0; }

.empty-state { text-align: center; padding: 50px 20px; color: var(--text-muted); }
.empty-state .icon { font-size: 48px; margin-bottom: 15px; display: block; }
canvas, img { max-width: 100% !important; }

/* Switch de configuración */
.switch { position: relative; display: inline-block; width: 52px; height: 30px; }
.switch input { opacity: 0; width: 0; height: 0; }
.slider { position: absolute; cursor: pointer; top: 0; left: 0; right: 0; bottom: 0; background-color: #2a2c33; transition: .4s; border-radius: 34px; }
.slider:before { position: absolute; content: ""; height: 22px; width: 22px; left: 4px; bottom: 4px; background-color: white; transition: .4s; border-radius: 50%; box-shadow: 0 2px 5px rgba(0,0,0,0.2); }
input:checked + .slider { background-color: var(--primary-color); }
input:checked + .slider:before { transform: translateX(22px); }
.temas-container { display: flex; gap: 15px; justify-content: center; }
.color-circulo { width: 36px; height: 36px; border-radius: 50%; cursor: pointer; border: 2px solid #fff; box-shadow: 0 4px 12px rgba(0,0,0,0.4); }

/* Notificaciones Toast */
#toast-notificacion { 
    visibility: hidden; min-width: 250px; background-color: #ffffff; color: #000000; font-weight: bold; text-align: center; 
    border-radius: 30px; padding: 14px 24px; position: fixed; z-index: 10001; left: 50%; 
    transform: translateX(-50%); bottom: 30px; font-size: 15px; box-shadow: 0 10px 30px rgba(0,0,0,0.5); 
    opacity: 0; transition: opacity 0.3s, bottom 0.3s; 
}
#toast-notificacion.mostrar { visibility: visible; opacity: 1; bottom: 50px; }

.btn-crear-ejercicio { width: 100%; background: transparent; color: var(--primary-color); border: 2px dashed var(--primary-color); padding: 16px; border-radius: 20px; margin-top: 15px; cursor: pointer; font-weight: bold; }
.btn-volver { background: #2a2c33; color: white; border: none; padding: 12px 20px; border-radius: 16px; cursor: pointer; margin-bottom: 20px; font-size: 14px; font-weight: bold; }

/* =========================================
   MAPA DE RECUPERACIÓN PRO (SVG)
   ========================================= */
#contenedor-mapa {
    background-color: transparent;
    padding: 10px 0 20px 0;
    max-width: 100%;
    overflow-x: auto;
    text-align: center;
}

svg path {
    fill: #1a1c23; /* Mismo color que la tarjeta */
    stroke: #2a2c33; /* Gris un poco más claro para separar los músculos */
    stroke-width: 1.5;
    stroke-linejoin: round;
    opacity: 0.85;
    transition: all 0.4s ease;
}

svg path:hover {
    opacity: 1;
    filter: drop-shadow(0px 0px 10px rgba(0, 229, 255, 0.4));
    cursor: pointer;
}
/* =========================================
   DISEÑO HISTORIA EXPORTABLE (9:16)
   ========================================= */
.lienzo-story {
    width: 100%;
    aspect-ratio: 9/16;
    border-radius: 16px;
    position: relative;
    overflow: hidden;
    border: 1px solid rgba(255,255,255,0.1);
    background: #000;
}

.story-bg {
    position: absolute; top: 0; left: 0; width: 100%; height: 100%;
    background: linear-gradient(135deg, #1a1c23 0%, #0a0b10 100%);
    background-size: cover; 
    background-position: center;
}

.story-overlay {
    position: absolute; top: 0; left: 0; width: 100%; height: 100%;
    background: linear-gradient(to bottom, rgba(0,0,0,0.1) 0%, rgba(0,0,0,0.85) 100%);
}

.story-content {
    position: relative; z-index: 2; 
    display: flex; flex-direction: column; justify-content: space-between; 
    height: 100%; padding: 24px;
}

.story-header { display: flex; justify-content: space-between; align-items: center; }
.story-brand { color: var(--primary-color); font-weight: 900; letter-spacing: 1px; font-size: 13px; text-shadow: 0 2px 4px rgba(0,0,0,0.5); }
.story-date { font-size: 13px; color: rgba(255,255,255,0.8); }

.story-body { margin-top: auto; margin-bottom: 20px; }
.story-timer { font-size: 16px; font-weight: bold; background: rgba(0,0,0,0.6); padding: 8px 16px; border-radius: 20px; display: inline-block; border: 1px solid rgba(255,255,255,0.1); backdrop-filter: blur(10px); margin-bottom: 10px; }
.story-title { font-size: 46px; font-weight: 900; text-transform: uppercase; line-height: 1; text-shadow: 0 4px 12px rgba(0,0,0,0.6); }

.story-pr-box { background: var(--primary-gradient); color: #000; padding: 14px; border-radius: 16px; font-weight: 900; font-size: 14px; text-align: center; box-shadow: 0 8px 20px rgba(0, 229, 255, 0.3); margin-bottom: 12px; }

.story-stats-row { display: flex; gap: 10px; }
.story-stat { flex: 1; background: rgba(0,0,0,0.5); padding: 12px; border-radius: 16px; backdrop-filter: blur(10px); border: 1px solid rgba(255,255,255,0.1); }
.story-stat span { display: block; font-size: 10px; color: var(--text-muted); text-transform: uppercase; font-weight: 700; letter-spacing: 0.5px; }
.story-stat strong { display: block; font-size: 20px; color: white; margin-top: 4px; }