/* =============================================
   FITROUTINE - ESTILOS PROFESIONALES v2
   Nueva paleta: Negro carbón + Naranja energía + Blanco
   ============================================= */

@import url('https://fonts.googleapis.com/css2?family=Barlow+Condensed:wght@400;600;700;800&family=DM+Sans:ital,opsz,wght@0,9..40,300;0,9..40,400;0,9..40,500;0,9..40,600&display=swap');

/* === VARIABLES === */
:root {
    /* Paleta principal: oscuro profesional + naranja energético */
    --primary: #F97316;           /* Naranja energía */
    --primary-dark: #EA6A0A;
    --primary-light: #FBA94C;
    --primary-glow: rgba(249, 115, 22, 0.25);

    /* Fondos oscuros con profundidad */
    --bg-base: #0C0C0E;
    --bg-surface: #141418;
    --bg-card: #1A1A20;
    --bg-card-hover: #1F1F27;
    --bg-glass: rgba(20, 20, 24, 0.85);
    --border: rgba(255, 255, 255, 0.08);
    --border-active: rgba(249, 115, 22, 0.5);

    /* Textos */
    --text-primary: #F5F5F7;
    --text-secondary: #9999AA;
    --text-muted: #55555F;

    /* Estados */
    --success: #22C55E;
    --warning: #EAB308;
    --danger: #EF4444;
    --info: #3B82F6;

    /* Sombras */
    --shadow-sm: 0 2px 8px rgba(0,0,0,0.3);
    --shadow-md: 0 4px 20px rgba(0,0,0,0.4);
    --shadow-lg: 0 8px 40px rgba(0,0,0,0.5);
    --shadow-orange: 0 0 30px rgba(249, 115, 22, 0.35);

    /* Bordes */
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 18px;
    --radius-xl: 24px;

    /* Tipografía */
    --font-display: 'Barlow Condensed', sans-serif;
    --font-body: 'DM Sans', sans-serif;

    /* Transiciones */
    --ease: cubic-bezier(0.4, 0, 0.2, 1);
    --t-fast: 0.15s;
    --t-base: 0.25s;
    --t-slow: 0.4s;

    --header-height: 68px;
    --max-width: 1320px;
}

/* === RESET === */
*, *::before, *::after {
    margin: 0; padding: 0;
    box-sizing: border-box;
}

html { font-size: 16px; scroll-behavior: smooth; }

body {
    font-family: var(--font-body);
    background: var(--bg-base);
    color: var(--text-primary);
    line-height: 1.65;
    min-height: 100vh;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    display: flex;
    flex-direction: column;
}

#mainContent {
    flex: 1;
}

/* Ruido de fondo sutil */
body::before {
    content: '';
    position: fixed;
    inset: 0;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)' opacity='0.03'/%3E%3C/svg%3E");
    pointer-events: none;
    z-index: 0;
}

/* === SCROLLBAR === */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: var(--bg-surface); }
::-webkit-scrollbar-thumb { background: var(--primary); border-radius: 3px; }

/* === TIPOGRAFÍA === */
h1, h2, h3, h4 {
    font-family: var(--font-display);
    font-weight: 700;
    line-height: 1.15;
    letter-spacing: 0.3px;
    color: var(--text-primary);
    margin-bottom: 0.75rem;
}

h1 { font-size: clamp(2.8rem, 6vw, 4.5rem); font-weight: 800; }
h2 { font-size: clamp(1.8rem, 4vw, 2.8rem); }
h3 { font-size: clamp(1.2rem, 2.5vw, 1.6rem); }

p { color: var(--text-secondary); margin-bottom: 0.75rem; }
a { color: var(--primary-light); text-decoration: none; transition: color var(--t-fast) var(--ease); }
a:hover { color: var(--primary); }

.container {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 2rem;
}

/* === HEADER === */
header {
    background: var(--bg-glass);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    border-bottom: 1px solid var(--border);
    position: fixed;
    top: 0; left: 0; right: 0;
    height: var(--header-height);
    z-index: 1000;
    transition: background var(--t-base) var(--ease), box-shadow var(--t-base) var(--ease);
}

header.scrolled {
    background: rgba(12, 12, 14, 0.96);
    box-shadow: 0 4px 24px rgba(0,0,0,0.5);
}

.nav-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: var(--header-height);
    gap: 1rem;
}

.logo {
    font-family: var(--font-display);
    font-size: 1.7rem;
    font-weight: 800;
    color: var(--text-primary);
    letter-spacing: -0.5px;
    cursor: pointer;
    transition: color var(--t-fast) var(--ease);
    user-select: none;
}

.logo:hover { color: var(--primary); }
.logo-dot { color: var(--primary); }

.nav-links {
    display: flex;
    list-style: none;
    align-items: center;
    gap: 0.25rem;
    flex: 1;
    justify-content: center;
}

.nav-actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-left: auto;
}

.nav-item {
    color: var(--text-secondary);
    padding: 0.5rem 1rem;
    border-radius: var(--radius-sm);
    font-size: 0.92rem;
    font-weight: 500;
    transition: all var(--t-fast) var(--ease);
    position: relative;
}

.nav-item:hover, .nav-item.active {
    color: var(--text-primary);
    background: rgba(255,255,255,0.06);
}

.nav-item.active::after {
    content: '';
    position: absolute;
    bottom: -2px; left: 50%;
    transform: translateX(-50%);
    width: 20px; height: 2px;
    background: var(--primary);
    border-radius: 2px;
}

/* === BOTONES === */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    padding: 0.6rem 1.4rem;
    border: none;
    border-radius: var(--radius-sm);
    font-family: var(--font-body);
    font-weight: 600;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all var(--t-fast) var(--ease);
    text-decoration: none;
    white-space: nowrap;
    position: relative;
    overflow: hidden;
}

.btn-primary {
    background: var(--primary);
    color: #fff;
}

.btn-primary:hover {
    background: var(--primary-dark);
    transform: translateY(-1px);
    box-shadow: var(--shadow-orange);
    color: #fff;
}

.btn-ghost, .btn-outline {
    background: transparent;
    border: 1.5px solid var(--border);
    color: var(--text-secondary);
}

.btn-ghost:hover, .btn-outline:hover {
    border-color: rgba(255,255,255,0.2);
    color: var(--text-primary);
    background: rgba(255,255,255,0.05);
}

.btn-lg {
    padding: 0.85rem 2rem;
    font-size: 1rem;
    border-radius: var(--radius-md);
}

.btn-sm {
    padding: 0.4rem 0.9rem;
    font-size: 0.82rem;
}

.btn:active { transform: translateY(0) scale(0.98); }
.full-width { width: 100%; }

/* === SECCIONES === */
.section {
    display: none;
    padding-top: calc(var(--header-height) + 3rem);
    padding-bottom: 5rem;
    animation: fadeUp 0.35s var(--ease) both;
}

.section.active { display: block; }

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

.page-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    margin-bottom: 2.5rem;
    flex-wrap: wrap;
    gap: 1rem;
}

.page-header h2 { margin-bottom: 0.25rem; }
.page-header p { margin-bottom: 0; }

/* === HOME: HERO === */
.hero {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4rem;
    align-items: center;
    min-height: calc(100vh - var(--header-height));
    padding-top: calc(var(--header-height) + 2rem);
    padding-bottom: 3rem;
}

.hero-badge {
    display: inline-block;
    background: rgba(249, 115, 22, 0.12);
    border: 1px solid rgba(249, 115, 22, 0.3);
    color: var(--primary-light);
    padding: 0.35rem 1rem;
    border-radius: 100px;
    font-size: 0.85rem;
    font-weight: 500;
    margin-bottom: 1.5rem;
    letter-spacing: 0.3px;
}

.hero-text h1 {
    line-height: 1.0;
    margin-bottom: 1.25rem;
}

.highlight { color: var(--primary); }

.hero-text p {
    font-size: 1.1rem;
    max-width: 480px;
    margin-bottom: 2rem;
    color: var(--text-secondary);
}

.hero-cta {
    display: flex;
    gap: 1rem;
    margin-bottom: 2.5rem;
    flex-wrap: wrap;
}

.hero-stats {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

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

.stat-num {
    font-family: var(--font-display);
    font-size: 1.6rem;
    font-weight: 800;
    color: var(--text-primary);
    line-height: 1;
}

.stat-label {
    font-size: 0.78rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.8px;
    margin-top: 0.2rem;
}

.stat-divider {
    width: 1px;
    height: 32px;
    background: var(--border);
}

/* Hero visual */
.hero-visual {
    position: relative;
    height: 480px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.hero-big-circle {
    width: 340px;
    height: 340px;
    border-radius: 50%;
    background: radial-gradient(circle at 40% 40%, rgba(249,115,22,0.18), rgba(249,115,22,0.04) 60%, transparent 80%);
    border: 1px solid rgba(249,115,22,0.15);
    position: absolute;
}

.hero-card-float {
    position: absolute;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 0.9rem 1.2rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    box-shadow: var(--shadow-md);
    backdrop-filter: blur(10px);
    min-width: 200px;
}

.card-1 { top: 60px; right: 20px; animation: floatA 5s ease-in-out infinite; }
.card-2 { bottom: 80px; left: 10px; animation: floatB 6s ease-in-out infinite; }
.card-3 { top: 50%; left: -20px; transform: translateY(-50%); animation: floatA 7s ease-in-out infinite 1s; }

@keyframes floatA {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-12px); }
}
@keyframes floatB {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(10px); }
}

.hcard-icon { font-size: 1.4rem; }
.hcard-title { font-size: 0.88rem; font-weight: 600; color: var(--text-primary); }
.hcard-sub { font-size: 0.75rem; color: var(--text-muted); margin-top: 0.1rem; }
.hcard-check { color: var(--success); font-weight: 700; font-size: 1.1rem; margin-left: auto; }

.mini-bar {
    width: 100px;
    height: 5px;
    background: var(--border);
    border-radius: 3px;
    margin-top: 0.4rem;
    overflow: hidden;
}
.mini-bar span {
    display: block;
    height: 100%;
    width: 68%;
    background: linear-gradient(90deg, var(--primary), var(--primary-light));
    border-radius: 3px;
}

/* === HOME: FEATURES === */
.features-section {
    padding-bottom: 5rem;
}

.section-header {
    text-align: center;
    margin-bottom: 3rem;
}

.section-header h2 { margin-bottom: 0.5rem; }
.section-header p { color: var(--text-secondary); }

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

.feature-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 2rem 1.75rem;
    cursor: pointer;
    transition: all var(--t-base) var(--ease);
    position: relative;
    overflow: hidden;
}

.feature-card::before {
    content: '';
    position: absolute;
    bottom: 0; left: 0; right: 0;
    height: 3px;
    background: var(--primary);
    transform: scaleX(0);
    transform-origin: left;
    transition: transform var(--t-base) var(--ease);
}

.feature-card:hover {
    background: var(--bg-card-hover);
    border-color: var(--border-active);
    transform: translateY(-4px);
    box-shadow: var(--shadow-orange);
}

.feature-card:hover::before { transform: scaleX(1); }

.feature-icon {
    font-size: 2.2rem;
    margin-bottom: 1.25rem;
    display: block;
}

.feature-card h3 {
    font-size: 1.15rem;
    margin-bottom: 0.6rem;
    color: var(--text-primary);
}

.feature-card p {
    font-size: 0.9rem;
    color: var(--text-muted);
    margin-bottom: 0;
    line-height: 1.6;
}

.feature-arrow {
    display: block;
    margin-top: 1.25rem;
    color: var(--primary);
    font-size: 1.1rem;
    transition: transform var(--t-fast) var(--ease);
}

.feature-card:hover .feature-arrow { transform: translateX(5px); }

/* === RUTINAS === */
.card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 2rem;
}

.form-card {
    margin-bottom: 2rem;
    animation: fadeUp 0.25s var(--ease) both;
}

.routine-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 1.5rem 1.75rem;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    transition: all var(--t-base) var(--ease);
}

.routine-card:hover {
    background: var(--bg-card-hover);
    border-color: var(--border-active);
    box-shadow: var(--shadow-sm);
}

.routine-info {
    display: flex;
    align-items: center;
    gap: 1.25rem;
}

.routine-icon {
    font-size: 1.8rem;
    width: 52px; height: 52px;
    background: rgba(249,115,22,0.1);
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.routine-info h3 { font-size: 1.05rem; margin-bottom: 0.4rem; }

.routine-meta {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    flex-wrap: wrap;
}

.meta-item {
    font-size: 0.8rem;
    color: var(--text-muted);
}

.meta-item::before {
    content: '·';
    margin-right: 0.4rem;
    color: var(--text-muted);
}

.routine-actions { display: flex; gap: 0.6rem; }

/* === FORMULARIOS === */
.form-group { margin-bottom: 1.25rem; }

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

.form-label {
    display: block;
    margin-bottom: 0.4rem;
    font-size: 0.87rem;
    font-weight: 500;
    color: var(--text-secondary);
}

.form-input {
    width: 100%;
    padding: 0.7rem 1rem;
    background: var(--bg-surface);
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-family: var(--font-body);
    font-size: 0.95rem;
    transition: border-color var(--t-fast) var(--ease), box-shadow var(--t-fast) var(--ease);
    appearance: none;
}

.form-input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-glow);
    background: var(--bg-card);
}

.form-input::placeholder { color: var(--text-muted); }
textarea.form-input { resize: vertical; min-height: 80px; }

.form-actions {
    display: flex;
    justify-content: flex-end;
    gap: 0.75rem;
    margin-top: 1.5rem;
    padding-top: 1.25rem;
    border-top: 1px solid var(--border);
}

/* === TAGS === */
.tag {
    display: inline-block;
    padding: 0.2rem 0.65rem;
    border-radius: 100px;
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.3px;
}

.tag-beginner {
    background: rgba(34, 197, 94, 0.12);
    color: var(--success);
    border: 1px solid rgba(34, 197, 94, 0.25);
}

.tag-intermediate {
    background: rgba(234, 179, 8, 0.12);
    color: var(--warning);
    border: 1px solid rgba(234, 179, 8, 0.25);
}

.tag-advanced {
    background: rgba(239, 68, 68, 0.12);
    color: var(--danger);
    border: 1px solid rgba(239, 68, 68, 0.25);
}

/* === EJERCICIOS === */
.filter-bar {
    display: flex;
    gap: 0.6rem;
    margin-bottom: 2rem;
    flex-wrap: wrap;
}

.filter-btn {
    padding: 0.45rem 1.1rem;
    background: var(--bg-card);
    border: 1.5px solid var(--border);
    border-radius: 100px;
    color: var(--text-secondary);
    font-family: var(--font-body);
    font-size: 0.87rem;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--t-fast) var(--ease);
}

.filter-btn:hover, .filter-btn.active {
    background: var(--primary);
    border-color: var(--primary);
    color: #fff;
}

.exercise-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.5rem;
}

.exercise-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    transition: all var(--t-base) var(--ease);
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.exercise-card:hover {
    background: var(--bg-card-hover);
    border-color: var(--border-active);
    transform: translateY(-3px);
    box-shadow: var(--shadow-md);
}

.exercise-card[style*="display: none"] { display: none !important; }

.exercise-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.exercise-card h3 {
    font-size: 1.05rem;
    margin-bottom: 0;
}

.exercise-card p {
    font-size: 0.88rem;
    color: var(--text-muted);
    margin-bottom: 0;
    line-height: 1.55;
}

.exercise-details {
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
    font-size: 0.82rem;
    color: var(--text-secondary);
    padding-top: 0.5rem;
    border-top: 1px solid var(--border);
    margin-top: auto;
}

.muscle-badge {
    padding: 0.2rem 0.65rem;
    border-radius: 100px;
    font-size: 0.73rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.badge-pecho { background: rgba(249,115,22,0.15); color: var(--primary-light); }
.badge-espalda { background: rgba(59,130,246,0.15); color: #60A5FA; }
.badge-piernas { background: rgba(34,197,94,0.15); color: #4ADE80; }
.badge-hombros { background: rgba(168,85,247,0.15); color: #C084FC; }
.badge-brazos { background: rgba(234,179,8,0.15); color: #FDE047; }
.badge-core { background: rgba(239,68,68,0.15); color: #F87171; }

/* === CALCULADORA === */
.calculator-layout {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
    align-items: start;
}

.calc-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-xl);
    padding: 2.25rem;
    display: flex;
    flex-direction: column;
    gap: 0;
}

.calc-icon { font-size: 2.5rem; margin-bottom: 1rem; }
.calc-card h3 { margin-bottom: 1.75rem; }

.calc-result {
    margin-top: 1.5rem;
    padding: 1.5rem;
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    text-align: center;
    animation: fadeUp 0.3s var(--ease) both;
}

.result-value {
    font-family: var(--font-display);
    font-size: 3rem;
    font-weight: 800;
    color: var(--primary);
    line-height: 1;
    margin-bottom: 0.4rem;
}

.result-label {
    font-size: 0.9rem;
    color: var(--text-secondary);
    font-weight: 500;
}

/* BMI Scale */
.bmi-scale { margin-top: 1.25rem; }

.bmi-bar {
    position: relative;
    height: 8px;
    background: linear-gradient(90deg, #3B82F6 0%, #22C55E 30%, #EAB308 60%, #EF4444 100%);
    border-radius: 4px;
    margin-bottom: 0.5rem;
}

.bmi-marker {
    position: absolute;
    top: -3px;
    width: 14px; height: 14px;
    background: #fff;
    border: 2px solid var(--primary);
    border-radius: 50%;
    transform: translateX(-50%);
    transition: left 0.5s var(--ease);
}

.bmi-labels {
    display: flex;
    justify-content: space-between;
    font-size: 0.72rem;
    color: var(--text-muted);
}

/* Calories */
.calories-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.75rem;
}

.calorie-item {
    padding: 0.75rem;
    background: var(--bg-card);
    border-radius: var(--radius-sm);
    text-align: center;
}

.calorie-item.highlight-item {
    background: rgba(249,115,22,0.12);
    border: 1px solid rgba(249,115,22,0.25);
}

.calorie-num {
    display: block;
    font-family: var(--font-display);
    font-size: 1.4rem;
    font-weight: 800;
    color: var(--text-primary);
    line-height: 1;
}

.highlight-item .calorie-num { color: var(--primary); }

.calorie-label {
    display: block;
    font-size: 0.72rem;
    color: var(--text-muted);
    margin-top: 0.3rem;
}

/* === HISTORIAL === */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.25rem;
    margin-bottom: 2.5rem;
}

.stat-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 1.5rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    transition: all var(--t-fast) var(--ease);
}

.stat-card:hover {
    border-color: var(--border-active);
    background: var(--bg-card-hover);
}

.stat-icon { font-size: 1.8rem; }
.stat-info { display: flex; flex-direction: column; }
.stat-big {
    font-family: var(--font-display);
    font-size: 1.6rem;
    font-weight: 800;
    color: var(--text-primary);
    line-height: 1;
}
.stat-desc { font-size: 0.8rem; color: var(--text-muted); margin-top: 0.2rem; }

/* === TABLA === */
.table-container {
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    overflow: hidden;
}

table {
    width: 100%;
    border-collapse: collapse;
}

thead { background: var(--bg-surface); }

th {
    padding: 1rem 1.25rem;
    text-align: left;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.8px;
    border-bottom: 1px solid var(--border);
}

td {
    padding: 1rem 1.25rem;
    border-bottom: 1px solid var(--border);
    color: var(--text-secondary);
    font-size: 0.92rem;
}

tbody tr:last-child td { border-bottom: none; }

tbody tr {
    background: var(--bg-card);
    transition: background var(--t-fast) var(--ease);
}

tbody tr:hover { background: var(--bg-card-hover); }

.routine-tag {
    display: inline-block;
    background: rgba(249,115,22,0.1);
    color: var(--primary-light);
    padding: 0.2rem 0.7rem;
    border-radius: 100px;
    font-size: 0.82rem;
    font-weight: 500;
}

.note-cell {
    color: var(--text-muted);
    font-size: 0.85rem;
    font-style: italic;
    max-width: 250px;
}

/* === MODALES === */
.modal {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.75);
    backdrop-filter: blur(8px);
    z-index: 2000;
    align-items: center;
    justify-content: center;
}

.modal.active { display: flex; }

.modal-content {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-xl);
    width: 90%;
    max-width: 440px;
    position: relative;
    animation: modalIn 0.3s var(--ease) both;
    overflow: hidden;
}

@keyframes modalIn {
    from { opacity: 0; transform: translateY(-20px) scale(0.96); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

.modal-close {
    position: absolute;
    top: 1.1rem; right: 1.1rem;
    background: rgba(255,255,255,0.06);
    border: none;
    color: var(--text-secondary);
    width: 32px; height: 32px;
    border-radius: 50%;
    font-size: 1.2rem;
    cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    transition: all var(--t-fast) var(--ease);
}

.modal-close:hover {
    background: rgba(255,255,255,0.12);
    color: var(--text-primary);
    transform: rotate(90deg);
}

.modal-header {
    padding: 2.25rem 2.25rem 0;
    border-bottom: 1px solid var(--border);
    padding-bottom: 1.5rem;
    margin-bottom: 1.75rem;
}

.modal-header h2 { margin-bottom: 0.35rem; font-size: 1.4rem; }
.modal-header p { margin-bottom: 0; font-size: 0.9rem; }

.modal-body { padding: 0 2.25rem 2.25rem; }

.modal-switch {
    text-align: center;
    font-size: 0.87rem;
    color: var(--text-muted);
    margin-top: 1.25rem;
    margin-bottom: 0;
}

.modal-switch a { color: var(--primary-light); font-weight: 500; }
.modal-switch a:hover { color: var(--primary); }

/* === BURGER MENU === */
.burger-menu {
    display: none;
    flex-direction: column;
    gap: 5px;
    cursor: pointer;
    padding: 8px;
    background: none;
    border: none;
}

.burger-menu span {
    width: 22px; height: 2px;
    background: var(--text-secondary);
    border-radius: 2px;
    transition: all var(--t-fast) var(--ease);
    display: block;
}

.burger-menu.active span:nth-child(1) { transform: rotate(45deg) translate(5px, 5px); }
.burger-menu.active span:nth-child(2) { opacity: 0; }
.burger-menu.active span:nth-child(3) { transform: rotate(-45deg) translate(5px, -5px); }

/* === FOOTER === */
footer {
    background: var(--bg-surface);
    border-top: 1px solid var(--border);
    padding: 1.5rem 0;
}

.footer-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

.footer-logo {
    font-family: var(--font-display);
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--text-secondary);
}

footer p {
    margin-bottom: 0;
    font-size: 0.85rem;
    color: var(--text-muted);
}

/* === TOAST === */
.toast-container {
    position: fixed;
    bottom: 2rem; right: 2rem;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    z-index: 3000;
}

.toast {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 0.85rem 1.25rem;
    font-size: 0.9rem;
    color: var(--text-primary);
    box-shadow: var(--shadow-lg);
    animation: toastIn 0.3s var(--ease) both;
    max-width: 320px;
    display: flex;
    align-items: center;
    gap: 0.6rem;
}

.toast-success { border-left: 3px solid var(--success); }
.toast-error { border-left: 3px solid var(--danger); }
.toast-info { border-left: 3px solid var(--primary); }

@keyframes toastIn {
    from { opacity: 0; transform: translateX(20px); }
    to { opacity: 1; transform: translateX(0); }
}

/* === ACORDEÓN INSTRUCCIONES === */
.instructions-panel {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.4s cubic-bezier(0.4, 0, 0.2, 1),
                opacity 0.3s ease,
                margin-top 0.3s ease;
    opacity: 0;
    margin-top: 0;
}

.instructions-panel.open {
    max-height: 1000px;
    opacity: 1;
    margin-top: 1rem;
}

.instructions-list {
    list-style: none;
    padding: 0;
    margin: 0 0 1rem 0;
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
}

.instructions-list li {
    display: flex;
    gap: 0.75rem;
    font-size: 0.88rem;
    color: var(--text-secondary);
    line-height: 1.55;
    padding: 0.6rem 0.75rem;
    background: var(--bg-surface);
    border-radius: var(--radius-sm);
    counter-increment: step-counter;
}

.instructions-list li::before {
    content: counter(step-counter);
    counter-increment: none;
    min-width: 22px;
    height: 22px;
    background: var(--primary);
    color: #fff;
    border-radius: 50%;
    font-size: 0.72rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    margin-top: 1px;
}

.instructions-list {
    counter-reset: step-counter;
}

.instructions-tip {
    font-size: 0.85rem;
    color: var(--text-secondary);
    background: rgba(249, 115, 22, 0.08);
    border: 1px solid rgba(249, 115, 22, 0.2);
    border-radius: var(--radius-sm);
    padding: 0.75rem 1rem;
    line-height: 1.5;
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
}

.instructions-tip strong { color: var(--primary-light); }

.instructions-tip svg {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
    margin-top: 2px;
    stroke: var(--primary);
}

/* Botón con flecha rotatoria */
.btn-instructions {
    margin-top: 0.75rem;
    justify-content: space-between !important;
}

.btn-instructions.active {
    border-color: var(--primary);
    color: var(--primary-light);
}

/* === EMPTY STATE === */
.empty-state {
    text-align: center;
    padding: 4rem 2rem;
    color: var(--text-muted);
}

.empty-icon { font-size: 3rem; display: block; margin-bottom: 1rem; }
.empty-state h3 { color: var(--text-secondary); margin-bottom: 0.5rem; }
.empty-state p { margin-bottom: 1.5rem; }

.nav-actions-mobile {
    display: none;
}
/* === RESPONSIVE === */
@media (max-width: 1024px) {
    .calculator-layout { grid-template-columns: 1fr; }
    .hero { grid-template-columns: 1fr; min-height: auto; text-align: center; }
    .hero-visual { display: none; }
    .hero-stats { justify-content: center; }
    .hero-cta { justify-content: center; }
    .hero-text p { margin-left: auto; margin-right: auto; }
    .contact-layout { grid-template-columns: 1fr; }
    

    /* Menú hamburguesa desde tablet */
    :root { --header-height: 60px; }

    .nav-links {
        position: fixed;
        top: var(--header-height); left: 0; right: 0;
        background: rgba(12,12,14,0.97);
        backdrop-filter: blur(20px);
        flex-direction: column;
        padding: 1rem;
        gap: 0.25rem;
        transform: translateY(-110%);
        transition: transform var(--t-base) var(--ease);
        border-bottom: 1px solid var(--border);
        z-index: 999;
        max-height: calc(100vh - var(--header-height));
        overflow-y: auto;
    }

    .nav-links.open { transform: translateY(0); }
    .nav-links li { width: 100%; }
    .nav-links .nav-item { width: 100%; text-align: center; padding: 0.75rem; display: block; }
    .nav-links #authButtons { display: flex; flex-direction: row; justify-content: center; gap: 0.5rem; padding: 0.5rem 0; }
    .nav-links #profileMenu.visible { display: flex !important; justify-content: center; }
    .nav-links .theme-toggle { margin: 0.25rem auto; display: flex; }
    .burger-menu { display: flex; }
    .nav-actions { display: none; }
    .nav-actions-mobile { width: 100%; }
    
    .nav-actions-mobile {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
    gap: 0.5rem;
    padding: 0.5rem 0;
    }
    
    .nav-actions-mobile #authButtonsMobile {
        display: flex;
        flex-direction: row;
        justify-content: center;
        gap: 0.5rem;
    }
    
    .nav-actions-mobile #profileMenuMobile {
        display: flex;
        justify-content: center;
    }
}

@media (max-width: 768px) {
    .container { padding: 0 1.25rem; }

    /* Secciones */
    .section { padding-top: calc(var(--header-height) + 1.5rem); padding-bottom: 3rem; }
    .page-header { flex-direction: column; align-items: flex-start; }
    .form-row { grid-template-columns: 1fr; }
    .stats-grid { grid-template-columns: repeat(2, 1fr); }
    .features-grid { grid-template-columns: 1fr 1fr; }
    .routine-card { flex-direction: column; align-items: flex-start; }
    .footer-inner { flex-direction: column; text-align: center; }

    /* Hero móvil */
    .hero { padding-top: calc(var(--header-height) + 0.5rem); padding-bottom: 2rem; gap: 1rem; }
    .hero-text h1 { font-size: 2.6rem; }
    .hero-cta { flex-direction: column; align-items: center; gap: 0.75rem; }
    .hero-cta .btn { width: 100%; max-width: 300px; justify-content: center; }
    .hero-stats { gap: 1rem; flex-wrap: wrap; justify-content: center; }
    .stat-num { font-size: 1.3rem; }

    /* Dropdown perfil en móvil */
    .profile-dropdown { position: fixed; top: var(--header-height); right: 0; left: 0; width: 100%; border-radius: 0; border-top: 1px solid var(--border); }

    /* Admin */
    .admin-grid { grid-template-columns: 1fr; }
}

@media (max-width: 480px) {
    h1 { font-size: 2.2rem; }
    .features-grid { grid-template-columns: 1fr; }
    .stats-grid { grid-template-columns: 1fr 1fr; }
    .calories-row { grid-template-columns: 1fr 1fr; }
    .exercise-grid { grid-template-columns: 1fr; }
    .toast-container { left: 1rem; right: 1rem; bottom: 1rem; }

    .hero-badge { font-size: 0.78rem; }
    .hero-text h1 { font-size: 2rem; }
    .hero-text p { font-size: 0.95rem; }

    .section-header h2 { font-size: 1.6rem; }

    .modal-content { width: 95%; }
    .modal-header { padding: 1.5rem 1.5rem 0; }
    .modal-body { padding: 0 1.5rem 1.5rem; }

    .chat-widget { bottom: 1rem; right: 1rem; }
    .chat-window { width: calc(100vw - 2rem); }
}

/* === CHATBOT FITBOT === */
.chat-widget {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    z-index: 4000;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 1rem;
}

/* Botón flotante */
.chat-fab {
    width: 60px; height: 60px;
    border-radius: 50%;
    background: var(--primary);
    border: none;
    cursor: pointer;
    font-size: 1.6rem;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 20px rgba(249,115,22,0.5);
    transition: all var(--t-base) var(--ease);
    position: relative;
    flex-shrink: 0;
}

.chat-fab:hover {
    background: var(--primary-dark);
    transform: scale(1.08);
    box-shadow: 0 6px 28px rgba(249,115,22,0.6);
}

.chat-badge {
    position: absolute;
    top: -4px; right: -4px;
    width: 20px; height: 20px;
    background: #EF4444;
    color: #fff;
    border-radius: 50%;
    font-size: 0.7rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid var(--bg-base);
    animation: pulse-badge 2s infinite;
}

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

/* Ventana del chat */
.chat-window {
    width: 360px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-lg);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    /* Oculto por defecto */
    max-height: 0;
    opacity: 0;
    pointer-events: none;
    transform: translateY(16px) scale(0.97);
    transition: all 0.35s var(--ease);
    transform-origin: bottom right;
}

.chat-window.open {
    max-height: 520px;
    opacity: 1;
    pointer-events: all;
    transform: translateY(0) scale(1);
}

/* Header */
.chat-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 1.25rem;
    background: var(--bg-surface);
    border-bottom: 1px solid var(--border);
    flex-shrink: 0;
}

.chat-header-info { display: flex; align-items: center; gap: 0.75rem; }

.chat-avatar {
    width: 38px; height: 38px;
    background: rgba(249,115,22,0.15);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
}

.chat-name { font-weight: 700; font-size: 0.95rem; color: var(--text-primary); }

.chat-status {
    font-size: 0.75rem;
    color: var(--success);
    display: flex;
    align-items: center;
    gap: 0.3rem;
}

.status-dot {
    width: 7px; height: 7px;
    background: var(--success);
    border-radius: 50%;
    display: inline-block;
    animation: pulse-dot 2s infinite;
}

@keyframes pulse-dot {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.4; }
}

.chat-close {
    background: rgba(255,255,255,0.06);
    border: none;
    color: var(--text-secondary);
    width: 28px; height: 28px;
    border-radius: 50%;
    font-size: 1.1rem;
    cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    transition: all var(--t-fast) var(--ease);
}

.chat-close:hover { background: rgba(255,255,255,0.12); color: var(--text-primary); }

/* Mensajes */
.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 1.25rem;
    display: flex;
    flex-direction: column;
    gap: 0.85rem;
    min-height: 0;
}

.chat-msg { display: flex; }
.chat-msg.user { justify-content: flex-end; }
.chat-msg.bot  { justify-content: flex-start; }

.msg-bubble {
    max-width: 82%;
    padding: 0.7rem 1rem;
    border-radius: var(--radius-md);
    font-size: 0.88rem;
    line-height: 1.55;
}

.chat-msg.bot .msg-bubble {
    background: var(--bg-surface);
    color: var(--text-secondary);
    border-bottom-left-radius: 4px;
}

.chat-msg.user .msg-bubble {
    background: var(--primary);
    color: #fff;
    border-bottom-right-radius: 4px;
}

/* Typing indicator */
.typing-indicator .msg-bubble {
    display: flex;
    gap: 5px;
    align-items: center;
    padding: 0.85rem 1rem;
}

.typing-dot {
    width: 7px; height: 7px;
    background: var(--text-muted);
    border-radius: 50%;
    animation: typing 1.2s infinite;
}

.typing-dot:nth-child(2) { animation-delay: 0.2s; }
.typing-dot:nth-child(3) { animation-delay: 0.4s; }

@keyframes typing {
    0%, 60%, 100% { transform: translateY(0); opacity: 0.4; }
    30% { transform: translateY(-6px); opacity: 1; }
}

/* Sugerencias */
.chat-suggestions {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
    margin-top: 0.25rem;
}

.suggestion-btn {
    background: rgba(249,115,22,0.08);
    border: 1px solid rgba(249,115,22,0.2);
    color: var(--primary-light);
    padding: 0.5rem 0.85rem;
    border-radius: 100px;
    font-size: 0.82rem;
    font-weight: 500;
    cursor: pointer;
    text-align: left;
    transition: all var(--t-fast) var(--ease);
    font-family: var(--font-body);
}

.suggestion-btn:hover {
    background: rgba(249,115,22,0.16);
    border-color: rgba(249,115,22,0.4);
}

/* Input */
.chat-input-area {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.85rem 1rem;
    border-top: 1px solid var(--border);
    background: var(--bg-surface);
    flex-shrink: 0;
}

.chat-input {
    flex: 1;
    background: var(--bg-card);
    border: 1.5px solid var(--border);
    border-radius: 100px;
    padding: 0.55rem 1rem;
    color: var(--text-primary);
    font-family: var(--font-body);
    font-size: 0.88rem;
    outline: none;
    transition: border-color var(--t-fast) var(--ease);
}

.chat-input:focus { border-color: var(--primary); }
.chat-input::placeholder { color: var(--text-muted); }

.chat-send {
    width: 38px; height: 38px;
    background: var(--primary);
    border: none;
    border-radius: 50%;
    color: #fff;
    cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    transition: all var(--t-fast) var(--ease);
    flex-shrink: 0;
}

.chat-send:hover { background: var(--primary-dark); transform: scale(1.05); }
.chat-send:disabled { background: var(--text-muted); cursor: not-allowed; transform: none; }

@media (max-width: 480px) {
    .chat-widget { bottom: 1rem; right: 1rem; }
    .chat-window { width: calc(100vw - 2rem); }
}

/* === PERFIL DROPDOWN === */
.profile-btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.45rem 0.9rem;
}

.profile-avatar { font-size: 1rem; }
.profile-chevron { font-size: 0.7rem; color: var(--text-muted); transition: transform var(--t-fast) var(--ease); }
.profile-btn.open .profile-chevron { transform: rotate(180deg); }

.profile-dropdown {
    position: absolute;
    top: calc(100% + 10px);
    right: 0;
    width: 240px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    z-index: 2000;
    overflow: hidden;
    display: none;
    animation: fadeUp 0.2s var(--ease) both;
}

.profile-dropdown.open { display: block; }

.dropdown-header {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    padding: 1.1rem 1.25rem;
    background: var(--bg-surface);
}

.dropdown-avatar {
    width: 40px; height: 40px;
    background: rgba(249,115,22,0.12);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    flex-shrink: 0;
}

.dropdown-username {
    font-weight: 700;
    font-size: 0.95rem;
    color: var(--text-primary);
}

.dropdown-email {
    font-size: 0.78rem;
    color: var(--text-muted);
    margin-top: 0.15rem;
}

.dropdown-divider {
    height: 1px;
    background: var(--border);
    margin: 0.35rem 0;
}

.dropdown-item {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    width: 100%;
    padding: 0.7rem 1.25rem;
    background: none;
    border: none;
    color: var(--text-secondary);
    font-family: var(--font-body);
    font-size: 0.9rem;
    cursor: pointer;
    text-align: left;
    transition: all var(--t-fast) var(--ease);
}

.dropdown-item:hover {
    background: rgba(255,255,255,0.05);
    color: var(--text-primary);
}

.dropdown-item.danger { color: var(--danger); }
.dropdown-item.danger:hover { background: rgba(239,68,68,0.08); }

/* === VÍDEO EN EJERCICIOS === */
.exercise-video {
    margin-top: 1rem;
    border-radius: var(--radius-md);
    overflow: hidden;
    aspect-ratio: 16/9;
    background: var(--bg-base);
}

.exercise-video iframe {
    width: 100%;
    height: 100%;
    border: none;
    display: block;
}

/* === MODAL ENTRENAMIENTO === */
.modal-workout {
    max-width: 420px;
}

.workout-header-info {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.workout-icon {
    font-size: 2rem;
    width: 52px; height: 52px;
    background: rgba(249,115,22,0.12);
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
}

.workout-timer {
    text-align: center;
    padding: 2rem 0;
    margin-bottom: 1.5rem;
    background: var(--bg-surface);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border);
}

.timer-display {
    font-family: var(--font-display);
    font-size: 4rem;
    font-weight: 800;
    color: var(--primary);
    line-height: 1;
    letter-spacing: 2px;
}

.timer-label {
    font-size: 0.82rem;
    color: var(--text-muted);
    margin-top: 0.5rem;
    text-transform: uppercase;
    letter-spacing: 0.8px;
}

.workout-actions {
    display: flex;
    gap: 0.75rem;
    margin-top: 1.25rem;
}

/* === MODO CLARO === */
body.light-mode {
    --bg-base:        #F5F5F7;
    --bg-surface:     #FFFFFF;
    --bg-card:        #FFFFFF;
    --bg-card-hover:  #F0F0F5;
    --bg-glass:       rgba(245, 245, 247, 0.9);
    --border:         rgba(0, 0, 0, 0.1);
    --border-active:  rgba(249, 115, 22, 0.5);
    --text-primary:   #1A1A1F;
    --text-secondary: #444450;
    --text-muted:     #88889A;
}

body.light-mode header {
    background: rgba(245,245,247,0.92);
    border-bottom-color: rgba(0,0,0,0.08);
}

body.light-mode .nav-item { color: var(--text-secondary); }
body.light-mode .nav-item:hover,
body.light-mode .nav-item.active { color: var(--text-primary); background: rgba(0,0,0,0.05); }
body.light-mode tbody tr { background: #fff; }
body.light-mode tbody tr:hover { background: #f8f8fb; }
body.light-mode .chat-window,
body.light-mode .modal-content { background: #fff; }

/* === TOGGLE TEMA === */
.theme-toggle {
    width: 36px; height: 36px;
    border-radius: 50%;
    background: rgba(255,255,255,0.06);
    border: 1.5px solid var(--border);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    transition: all var(--t-fast) var(--ease);
}

.theme-toggle:hover {
    background: rgba(255,255,255,0.12);
    border-color: var(--primary);
    transform: rotate(20deg);
}

/* === VALIDACIÓN DE CAMPOS === */
.form-input.error {
    border-color: var(--danger) !important;
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.15) !important;
}

.form-input.success {
    border-color: var(--success) !important;
}

.field-error {
    display: block;
    color: var(--danger);
    font-size: 0.8rem;
    margin-top: 0.3rem;
    min-height: 1rem;
    font-weight: 500;
}

/* === CONTACTO === */
.contact-layout {
    display: grid;
    grid-template-columns: 1fr 2fr;
    gap: 2rem;
    align-items: start;
}

.contact-info {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.contact-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1.25rem;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    transition: all var(--t-fast) var(--ease);
}

.contact-item:hover { border-color: var(--border-active); }

.contact-icon {
    font-size: 1.5rem;
    width: 44px; height: 44px;
    background: rgba(249,115,22,0.1);
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.contact-label {
    font-size: 0.78rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.6px;
    margin-bottom: 0.2rem;
}

.contact-value {
    font-size: 0.92rem;
    color: var(--text-primary);
    font-weight: 500;
}

.contact-form-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-xl);
    padding: 2rem;
}

.contact-success {
    margin-top: 1rem;
    padding: 1rem;
    background: rgba(34,197,94,0.1);
    border: 1px solid rgba(34,197,94,0.25);
    border-radius: var(--radius-md);
    color: var(--success);
    font-size: 0.92rem;
    text-align: center;
    animation: fadeUp 0.3s var(--ease) both;
}

@media (max-width: 768px) {
    .contact-layout { grid-template-columns: 1fr; }
}

/* === MODAL VIDEO === */
.video-modal-content {
    background: #000;
    border-radius: var(--radius-lg);
    width: 90%;
    max-width: 800px;
    position: relative;
    overflow: hidden;
    animation: modalIn 0.3s var(--ease) both;
}

.video-modal-frame {
    aspect-ratio: 16/9;
    width: 100%;
}

.video-modal-frame iframe {
    width: 100%;
    height: 100%;
    display: block;
    border: none;
}

.video-modal-close {
    position: absolute;
    top: 0.75rem;
    right: 0.75rem;
    background: rgba(0,0,0,0.7);
    border: none;
    color: #fff;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    font-size: 1.2rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
    transition: background var(--t-fast) var(--ease);
}

.video-modal-close:hover { background: rgba(249,115,22,0.8); }

/* Wrapper del video con boton encima */
.exercise-video {
    position: relative;
}

.video-expand-btn {
    position: absolute;
    bottom: 0.5rem;
    right: 0.5rem;
    background: rgba(0,0,0,0.7);
    border: none;
    color: #fff;
    padding: 0.3rem 0.7rem;
    border-radius: var(--radius-sm);
    font-size: 0.78rem;
    font-family: var(--font-body);
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.3rem;
    transition: background var(--t-fast) var(--ease);
    z-index: 5;
}

.video-expand-btn:hover { background: var(--primary); }

@media (max-width: 1024px) {
    .nav-links:not(.open) {
        visibility: hidden;
        pointer-events: none;
    }
}