/**
 * Mi Entrenamiento - Estilos frontend
 * Diseño oscuro deportivo con acento verde lima.
 * Todo prefijado con .me- y scopeado para no chocar con el tema.
 */

/* ============================================
   VARIABLES (scopeadas al dashboard)
   ============================================ */
.me-dash,
.me-nivel-contenido,
.me-paywall {
    --me-bg: #0c0d10;
    --me-surface: #15171c;
    --me-surface-2: #1d2027;
    --me-border: #2a2e38;
    --me-text: #f4f5f7;
    --me-text-muted: #9498a4;
    --me-accent: #d4ff3f;
    --me-accent-dark: #a8cc24;
    --me-accent-glow: rgba(212, 255, 63, 0.25);
    --me-locked: #4a4e5a;
    --me-radius: 16px;
}

/* ============================================
   DASHBOARD
   ============================================ */
.me-dash {
    background: var(--me-bg);
    color: var(--me-text);
    border-radius: var(--me-radius);
    padding: 40px 32px;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background-image:
        radial-gradient(circle at 15% 0%, rgba(212,255,63,0.06), transparent 40%),
        radial-gradient(circle at 85% 100%, rgba(212,255,63,0.04), transparent 40%);
}

.me-dash * { box-sizing: border-box; }

/* Header */
.me-dash__header {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    margin-bottom: 36px;
    padding-bottom: 24px;
    border-bottom: 1px solid var(--me-border);
    flex-wrap: wrap;
    gap: 20px;
}
.me-dash__eyebrow {
    font-family: 'Archivo', sans-serif;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 3px;
    text-transform: uppercase;
    color: var(--me-accent);
    margin-bottom: 8px;
}
.me-dash__title {
    font-family: 'Archivo', sans-serif;
    font-size: 40px;
    font-weight: 800;
    line-height: 1;
    letter-spacing: -1px;
    margin: 0;
    color: var(--me-text);
}
.me-dash__title span { color: var(--me-text-muted); }

.me-dash__stats { display: flex; gap: 14px; }
.me-stat-pill {
    background: var(--me-surface);
    border: 1px solid var(--me-border);
    border-radius: var(--me-radius);
    padding: 14px 22px;
    text-align: center;
    min-width: 88px;
}
.me-stat-pill__num {
    font-family: 'Archivo', sans-serif;
    font-size: 28px;
    font-weight: 800;
    color: var(--me-accent);
    line-height: 1;
}
.me-stat-pill__label {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--me-text-muted);
    margin-top: 6px;
}

/* Grid */
.me-planes-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 22px;
}

/* Card */
.me-plan-card {
    background: var(--me-surface);
    border: 1px solid var(--me-border);
    border-radius: var(--me-radius);
    overflow: hidden;
    transition: transform .3s cubic-bezier(.2,.8,.2,1), border-color .3s;
    opacity: 0;
    animation: me-rise .6s forwards;
}
.me-plan-card:hover {
    transform: translateY(-6px);
    border-color: var(--me-accent-dark);
}
@keyframes me-rise {
    from { opacity: 0; transform: translateY(24px); }
    to   { opacity: 1; transform: translateY(0); }
}
.me-plan-card:nth-child(1) { animation-delay: .05s; }
.me-plan-card:nth-child(2) { animation-delay: .12s; }
.me-plan-card:nth-child(3) { animation-delay: .19s; }
.me-plan-card:nth-child(4) { animation-delay: .26s; }

.me-plan-card__cover {
    height: 150px;
    background-size: cover;
    background-position: center;
    position: relative;
}
.me-plan-card__cover::after {
    content: '';
    position: absolute; inset: 0;
    background: linear-gradient(to top, var(--me-surface) 5%, transparent 70%);
}
/* Fallbacks de gradiente si no hay imagen */
.me-plan-card__cover--fallback.me-plan-card__cover--0 { background: linear-gradient(135deg, #2b1a47, #6b3fa0); }
.me-plan-card__cover--fallback.me-plan-card__cover--1 { background: linear-gradient(135deg, #1a2747, #2f6ba0); }
.me-plan-card__cover--fallback.me-plan-card__cover--2 { background: linear-gradient(135deg, #47321a, #a06b2f); }
.me-plan-card__cover--fallback.me-plan-card__cover--3 { background: linear-gradient(135deg, #1a472f, #2fa06b); }

.me-plan-card__badge {
    position: absolute;
    top: 14px; left: 14px;
    background: rgba(12,13,16,0.7);
    -webkit-backdrop-filter: blur(8px);
    backdrop-filter: blur(8px);
    border: 1px solid var(--me-border);
    color: var(--me-text);
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 1px;
    text-transform: uppercase;
    padding: 6px 12px;
    border-radius: 100px;
    z-index: 2;
}

.me-plan-card__body { padding: 22px 24px 26px; }
.me-plan-card__title {
    font-family: 'Archivo', sans-serif;
    font-size: 22px;
    font-weight: 700;
    margin: 0 0 4px;
    letter-spacing: -0.5px;
    color: var(--me-text);
}
.me-plan-card__sub {
    font-size: 13px;
    color: var(--me-text-muted);
    margin: 0 0 20px;
}

/* Progreso */
.me-progress-head {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    margin-bottom: 8px;
}
.me-progress-head__lvl {
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--me-text);
}
.me-progress-head__pct {
    font-size: 13px;
    font-weight: 700;
    color: var(--me-accent);
}
.me-progress-track {
    height: 8px;
    background: var(--me-surface-2);
    border-radius: 100px;
    overflow: hidden;
}
.me-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--me-accent-dark), var(--me-accent));
    border-radius: 100px;
    box-shadow: 0 0 12px var(--me-accent-glow);
    width: 0;
    transition: width 1.2s cubic-bezier(.2,.8,.2,1);
}

/* Niveles dots */
.me-niveles-track {
    display: flex;
    gap: 6px;
    margin: 20px 0 22px;
}
.me-nivel-dot {
    flex: 1;
    height: 36px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    font-weight: 700;
    position: relative;
    text-decoration: none;
    transition: transform .2s;
}
.me-nivel-dot:hover { transform: scale(1.08); }
.me-nivel-dot--done {
    background: var(--me-accent);
    color: #0c0d10;
}
.me-nivel-dot--current {
    background: var(--me-surface-2);
    color: var(--me-accent);
    border: 2px solid var(--me-accent);
}
.me-nivel-dot--locked {
    background: var(--me-surface-2);
    color: var(--me-locked);
    border: 1px dashed var(--me-locked);
    pointer-events: none;
}
.me-nivel-dot--locked::after {
    content: '🔒';
    font-size: 10px;
    position: absolute;
    top: -6px; right: -4px;
}

/* Botones */
.me-plan-actions { display: flex; gap: 10px; }
.me-btn {
    flex: 1;
    font-family: 'Archivo', sans-serif;
    font-weight: 700;
    font-size: 14px;
    letter-spacing: 0.3px;
    padding: 13px 16px;
    border-radius: 10px;
    border: none;
    cursor: pointer;
    text-align: center;
    text-decoration: none;
    transition: all .2s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}
.me-btn--primary {
    background: var(--me-accent);
    color: #0c0d10 !important;
}
.me-btn--primary:hover {
    background: #e2ff6b;
    box-shadow: 0 0 20px var(--me-accent-glow);
}
.me-btn--ghost {
    background: transparent;
    color: var(--me-text) !important;
    border: 1px solid var(--me-border);
    flex: 0 0 auto;
    padding: 13px 18px;
}
.me-btn--ghost:hover { border-color: var(--me-text-muted); }

/* Estado vacío */
.me-empty {
    text-align: center;
    padding: 70px 20px;
    background: var(--me-surface);
    border: 1px dashed var(--me-border);
    border-radius: var(--me-radius);
}
.me-empty__icon { font-size: 48px; margin-bottom: 16px; }
.me-empty h3 { font-size: 22px; margin: 0 0 8px; color: var(--me-text); font-weight: 700; }
.me-empty p { color: var(--me-text-muted); margin: 0 0 24px; }
.me-empty .me-btn { display: inline-flex; max-width: 260px; margin: 0 auto; }

/* ============================================
   PAYWALL (oscuro, a tono)
   ============================================ */
.me-paywall {
    background: var(--me-surface);
    color: var(--me-text);
    text-align: center;
    padding: 3rem 1.5rem;
    border: 1px dashed var(--me-border);
    border-radius: var(--me-radius);
    margin: 2rem 0;
    font-family: 'Inter', sans-serif;
}
.me-paywall__icon { font-size: 3rem; margin-bottom: .5rem; }
.me-paywall__title { margin-bottom: .5rem; color: var(--me-text); }
.me-paywall__message { color: var(--me-text-muted); margin-bottom: 1.5rem; }
.me-btn-comprar {
    display: inline-flex;
    background: var(--me-accent);
    color: #0c0d10 !important;
    font-weight: 700;
    font-size: 1.05rem;
    padding: .85rem 2rem;
    border-radius: 10px;
    text-decoration: none;
    transition: all .2s;
}
.me-btn-comprar:hover { background: #e2ff6b; box-shadow: 0 0 20px var(--me-accent-glow); }

/* ============================================
   CONTENIDO DEL NIVEL
   ============================================ */
.me-nivel-contenido {
    max-width: 900px;
    margin: 0 auto;
    background: var(--me-bg);
    color: var(--me-text);
    padding: 32px;
    border-radius: var(--me-radius);
    font-family: 'Inter', sans-serif;
}
.me-breadcrumb { font-size: .9rem; color: var(--me-text-muted); }
.me-breadcrumb a { color: var(--me-accent); text-decoration: none; }
.me-nivel-contenido h1 { color: var(--me-text); margin-top: 4px; }

.me-video-wrapper {
    position: relative;
    padding-bottom: 56.25%;
    height: 0;
    margin: 1.5rem 0;
    background: #000;
    border-radius: 12px;
    overflow: hidden;
}
.me-video-wrapper iframe {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    border: 0;
}

.me-ejercicios { margin-top: 2rem; }
.me-ejercicios h2 { color: var(--me-text); }
.me-ejercicios-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 1.25rem;
}
.me-ejercicio-card {
    background: var(--me-surface);
    border: 1px solid var(--me-border);
    border-radius: 12px;
    overflow: hidden;
}
.me-ejercicio-card img { width: 100%; height: auto; display: block; }
.me-ejercicio-card h3 { padding: .75rem 1rem 0; font-size: 1rem; color: var(--me-text); }
.me-ejercicio-card__content { padding: .5rem 1rem 1rem; font-size: .9rem; color: var(--me-text-muted); }

.me-pdf-download { margin-top: 2rem; text-align: center; }
.me-pdf-download .button {
    background: var(--me-accent);
    color: #0c0d10 !important;
    font-weight: 700;
    padding: .85rem 2rem;
    border-radius: 10px;
    text-decoration: none;
}

/* ============================================
   RESPONSIVE
   ============================================ */
@media (max-width: 600px) {
    .me-dash { padding: 28px 18px; }
    .me-dash__title { font-size: 30px; }
    .me-dash__stats { width: 100%; }
    .me-stat-pill { flex: 1; }
    .me-planes-grid { grid-template-columns: 1fr; }
}
