/* ==========================================================================
   ESTILOS ATHLETIC PRO - RUNNA INSPIRED (MITJA BCN 2027)
   Diseñado para iPhone PWA, fluidez táctil y cero rebote elástico.
   ========================================================================== */

:root {
    --brand-coral: #FF5A36;
    --brand-coral-dark: #E04320;
    --brand-teal: #0D9488;
    --brand-dark: #0F172A;
    --card-surface: #FFFFFF;
    --card-border: #E2E8F0;
    --text-primary: #0F172A;
    --text-secondary: #64748B;
    --runna-blue: #2563EB;
    --runna-green: #059669;
    --runna-purple: #7C3AED;
    --runna-amber: #D97706;
}

/* Bloqueo total de rubber-banding y elastic bounce en iOS Safari */
html, body {
    margin: 0;
    padding: 0;
    width: 100%;
    height: 100%;
    height: 100dvh;
    position: fixed;
    overflow: hidden;
    overscroll-behavior: none !important;
    overscroll-behavior-y: none !important;
    -webkit-overscroll-behavior: none !important;
    font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    background-color: #F8FAFC;
    color: var(--text-primary);
    -webkit-font-smoothing: antialiased;
    -webkit-tap-highlight-color: transparent;
    user-select: none;
    -webkit-user-select: none;
    touch-action: pan-y;
}

/* Ocultar scrollbars manteniendo scroll fluido */
.no-scrollbar::-webkit-scrollbar {
    display: none;
}
.no-scrollbar {
    -ms-overflow-style: none;
    scrollbar-width: none;
}

/* ==========================================================================
   CONTENEDOR RUNNA (Móvil vs PC Frame)
   ========================================================================== */
.iphone-frame {
    max-width: 430px;
    margin: 0 auto;
    width: 100%;
    height: 100%;
    height: 100dvh;
    display: flex;
    flex-direction: column;
    background: #FFFFFF;
    position: relative;
    overflow: hidden;
    overscroll-behavior: none !important;
}

@media (min-width: 1024px) {
    .iphone-frame {
        margin: 14px auto;
        height: 860px;
        max-height: 94vh;
        border-radius: 44px;
        border: 11px solid #1E293B;
        box-shadow: 0 25px 65px -15px rgba(15, 23, 42, 0.25);
    }
}

.wide-frame {
    max-width: 820px;
    margin: 14px auto;
    height: 92vh;
    height: 92dvh;
    border-radius: 28px;
    border: 1px solid #CBD5E1;
    box-shadow: 0 20px 50px -10px rgba(15, 23, 42, 0.15);
    display: flex;
    flex-direction: column;
    background: #FFFFFF;
    overflow: hidden;
}

/* Safe Area Insets iOS */
header {
    flex-shrink: 0 !important;
    padding-top: max(env(safe-area-inset-top), 8px) !important;
}

nav {
    flex-shrink: 0 !important;
    padding-bottom: max(env(safe-area-inset-bottom), 6px) !important;
}

/* ==========================================================================
   TARJETAS ATHLETIC RUNNA
   ========================================================================== */
.runna-card {
    background: #FFFFFF;
    border-radius: 18px;
    border: 1px solid #E2E8F0;
    box-shadow: 0 2px 10px -2px rgba(15, 23, 42, 0.04), 0 1px 3px rgba(15, 23, 42, 0.02);
    transition: transform 0.12s ease, box-shadow 0.12s ease;
    flex-shrink: 0;
}

/* Tarjeta de Día de Descanso (Rest Day) con borde punteado suave */
.runna-rest-card {
    background: #F8FAFC;
    border-radius: 18px;
    border: 1.5px dashed #CBD5E1;
    flex-shrink: 0;
}

/* Destacado HOY (Borde enérgico y sombra atlética) */
.runna-today-card {
    background: #FFFFFF;
    border-radius: 18px;
    border: 2px solid #FF5A36;
    box-shadow: 0 6px 20px -4px rgba(255, 90, 54, 0.18);
    position: relative;
    overflow: hidden;
}

/* Tarjeta pasada completada */
.runna-past-card {
    background: #FAFAFC;
    border-radius: 16px;
    border: 1px solid #E2E8F0;
    opacity: 0.94;
}

/* ==========================================================================
   BOTONES Y ACCIONES TÁCTILES
   ========================================================================== */
.touch-btn {
    min-height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    user-select: none;
    -webkit-user-select: none;
    touch-action: manipulation;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
}

input, textarea, select {
    user-select: text !important;
    -webkit-user-select: text !important;
    touch-action: auto !important;
}

.touch-btn:active {
    transform: scale(0.98);
}

/* Pastillas de tipos de sesión Runna */
.pill-series { background: #EFF6FF; color: #1D4ED8; border: 1px solid #BFDBFE; }
.pill-gym { background: #FFFBEB; color: #B45309; border: 1px solid #FDE68A; }
.pill-easyrun { background: #ECFDF5; color: #047857; border: 1px solid #A7F3D0; }
.pill-longrun { background: #F5F3FF; color: #6D28D9; border: 1px solid #DDD6FE; }
.pill-carrera { background: #FFF1F2; color: #BE123C; border: 1px solid #FECDD3; }
.pill-rest { background: #F1F5F9; color: #475569; border: 1px solid #E2E8F0; }

/* Drag and Drop visual feedback */
.drag-over {
    border: 2px dashed #FF5A36 !important;
    background-color: #FFF7ED !important;
}

.dragging {
    opacity: 0.5;
    transform: scale(0.96);
}

/* Ondas de audio */
@keyframes wave-bounce {
    0%, 100% { height: 6px; }
    50% { height: 26px; }
}

.wave-bar {
    display: inline-block;
    width: 4px;
    background-color: #FF5A36;
    border-radius: 9999px;
    margin: 0 2px;
}

.recording .wave-bar:nth-child(1) { animation: wave-bounce 0.7s infinite ease-in-out 0.1s; }
.recording .wave-bar:nth-child(2) { animation: wave-bounce 0.7s infinite ease-in-out 0.3s; }
.recording .wave-bar:nth-child(3) { animation: wave-bounce 0.7s infinite ease-in-out 0.5s; }
.recording .wave-bar:nth-child(4) { animation: wave-bounce 0.7s infinite ease-in-out 0.2s; }
.recording .wave-bar:nth-child(5) { animation: wave-bounce 0.7s infinite ease-in-out 0.4s; }

/* Animación de apertura de modales */
@keyframes modalSlideUp {
    from { transform: translateY(100%); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

.modal-animate-up {
    animation: modalSlideUp 0.24s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

/* Indicador de sincronización en la nube */
@keyframes syncPulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.4; }
}

.sync-pulsing {
    animation: syncPulse 1.2s infinite ease-in-out;
}
