/* ==========================================================================
   FITAI WORKOUT — ESTILOS GLOBALES & DISEÑO RESPONSIVE Y MODERNO (CSS3)
   ========================================================================== */

:root {
    --bg-main: #0b0f17;
    --bg-card: #111827;
    --bg-card-hover: #1f2937;
    --bg-input: #1f2937;
    
    --text-primary: #f9fafb;
    --text-secondary: #9ca3af;
    --text-muted: #6b7280;
    
    --accent-emerald: #10b981;
    --accent-emerald-hover: #059669;
    --accent-blue: #3b82f6;
    --accent-warning: #f59e0b;
    --accent-danger: #ef4444;
    
    --border-color: #374151;
    --border-radius: 14px;
    --border-radius-sm: 8px;
    
    --font-main: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    --shadow-card: 0 10px 25px -5px rgba(0, 0, 0, 0.5);
    --transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

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

body {
    background-color: var(--bg-main);
    color: var(--text-primary);
    font-family: var(--font-main);
    line-height: 1.5;
    min-height: 100vh;
    display: flex;
    justify-content: center;
    background-image: radial-gradient(circle at 50% 0%, rgba(16, 185, 129, 0.08), transparent 70%);
}

.app-container {
    width: 100%;
    max-width: 600px;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    padding-bottom: 75px; /* Espacio para navegación inferior */
    position: relative;
}

/* Header */
.app-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 1.25rem;
    background: rgba(17, 24, 39, 0.8);
    backdrop-filter: blur(12px);
    position: sticky;
    top: 0;
    z-index: 50;
    border-bottom: 1px solid var(--border-color);
}

.logo-container {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 800;
    font-size: 1.2rem;
}

.app-logo-icon {
    font-size: 1.4rem;
}

.highlight {
    color: var(--accent-emerald);
}

/* Badges de Estado */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
}

.badge-checking { background: rgba(245, 158, 11, 0.15); color: var(--accent-warning); border: 1px solid rgba(245, 158, 11, 0.3); }
.badge-success { background: rgba(16, 185, 129, 0.15); color: var(--accent-emerald); border: 1px solid rgba(16, 185, 129, 0.3); }
.badge-danger { background: rgba(239, 68, 68, 0.15); color: var(--accent-danger); border: 1px solid rgba(239, 68, 68, 0.3); }
.badge-accent { background: var(--accent-emerald); color: #000; font-weight: 700; }
.badge-outline { border: 1px solid var(--border-color); color: var(--text-secondary); }

.status-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background-color: currentColor;
}

/* Banner PWA */
.pwa-banner {
    background: #1f2937;
    border-bottom: 1px solid var(--accent-emerald);
    padding: 0.85rem 1.25rem;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.pwa-banner-content {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 0.85rem;
}

.pwa-banner-actions {
    display: flex;
    gap: 0.5rem;
    justify-content: flex-end;
}

/* Main Content Views */
.main-content {
    padding: 1.25rem;
    flex: 1;
}

.view-section {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.hidden {
    display: none !important;
}

/* Racha Widget */
.streak-widget {
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.15), rgba(59, 130, 246, 0.05));
    border: 1px solid rgba(16, 185, 129, 0.3);
    border-radius: var(--border-radius);
    padding: 1rem 1.25rem;
    display: flex;
    align-items: center;
    gap: 1rem;
}

.streak-count-box {
    display: flex;
    align-items: center;
    gap: 4px;
    background: var(--bg-card);
    padding: 8px 14px;
    border-radius: var(--border-radius-sm);
    border: 1px solid var(--border-color);
}

.streak-fire { font-size: 1.5rem; }
.streak-number { font-size: 1.8rem; font-weight: 900; color: var(--accent-emerald); }
.streak-info strong { display: block; font-size: 0.8rem; letter-spacing: 0.5px; color: var(--text-secondary); }
.streak-info p { font-size: 0.85rem; color: var(--text-muted); }

/* Hero & Formularios */
.hero-card, .profile-card, .workout-header-card, .loading-card, .completed-card, .seo-info-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    padding: 1.5rem;
    box-shadow: var(--shadow-card);
}

h1 { font-size: 1.5rem; font-weight: 800; margin-bottom: 0.25rem; }
h2 { font-size: 1.2rem; font-weight: 700; margin-bottom: 0.75rem; }
.subtitle { color: var(--text-secondary); font-size: 0.9rem; margin-bottom: 1.25rem; }

.form-group {
    border: none;
    margin-bottom: 1.25rem;
}

.form-label {
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 1px;
    color: var(--text-secondary);
    margin-bottom: 0.6rem;
    display: block;
}

/* Selector Deportes */
.sport-selector {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.5rem;
}

.sport-btn {
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    border-radius: var(--border-radius-sm);
    padding: 0.85rem 0.5rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    cursor: pointer;
    transition: var(--transition);
}

.sport-btn .sport-icon { font-size: 1.5rem; }
.sport-btn span { font-size: 0.85rem; font-weight: 700; }
.sport-btn small { font-size: 0.65rem; color: var(--text-muted); }

.sport-btn:hover, .sport-btn.active {
    border-color: var(--accent-emerald);
    background: rgba(16, 185, 129, 0.1);
}

/* Selector Tiempos */
.time-selector {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.5rem;
}

.time-btn {
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    border-radius: var(--border-radius-sm);
    padding: 0.75rem 0.5rem;
    font-weight: 600;
    font-size: 0.85rem;
    cursor: pointer;
    transition: var(--transition);
}

.time-btn:hover, .time-btn.active {
    border-color: var(--accent-emerald);
    background: rgba(16, 185, 129, 0.1);
    color: var(--accent-emerald);
}

.custom-time-box {
    margin-top: 0.75rem;
    background: var(--bg-input);
    padding: 0.75rem;
    border-radius: var(--border-radius-sm);
    border: 1px solid var(--border-color);
}

.custom-time-box label { display: block; font-size: 0.8rem; margin-bottom: 0.4rem; color: var(--text-secondary); }
.input-inline { display: flex; align-items: center; gap: 0.5rem; }
.input-inline input { flex: 1; }

/* Botones */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.85rem 1.25rem;
    border-radius: var(--border-radius-sm);
    font-weight: 700;
    font-size: 0.95rem;
    border: none;
    cursor: pointer;
    transition: var(--transition);
}

.btn-primary { background: var(--accent-emerald); color: #000; }
.btn-primary:hover { background: var(--accent-emerald-hover); }
.btn-success { background: #10b981; color: #000; }
.btn-warning { background: var(--accent-warning); color: #000; }
.btn-ghost { background: transparent; color: var(--text-secondary); border: 1px solid var(--border-color); }
.btn-danger-outline { background: transparent; color: var(--accent-danger); border: 1px solid rgba(239, 68, 68, 0.4); }
.btn-block { width: 100%; }
.btn-lg { padding: 1.1rem; font-size: 1.05rem; margin-bottom: 15px;}
.btn-sm { padding: 0.4rem 0.75rem; font-size: 0.8rem; }

/* Inputs */
input[type="text"], input[type="number"], select {
    width: 100%;
    padding: 0.75rem;
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-sm);
    color: var(--text-primary);
    font-size: 0.95rem;
    outline: none;
}

input:focus, select:focus {
    border-color: var(--accent-emerald);
}

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

.form-field {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.form-field label {
    font-size: 0.8rem;
    color: var(--text-secondary);
}

/* Temporizador */
.timer-card {
    background: linear-gradient(180deg, #1f2937 0%, #111827 100%);
    border: 2px solid var(--accent-emerald);
    border-radius: var(--border-radius);
    padding: 1.25rem;
    text-align: center;
}

.timer-display {
    font-size: 3.5rem;
    font-weight: 900;
    font-family: monospace;
    letter-spacing: 2px;
    color: var(--accent-emerald);
    margin-bottom: 0.75rem;
}

.timer-controls {
    display: flex;
    justify-content: center;
    gap: 0.5rem;
}

/* Ejercicios Tarjetas */
.exercise-grid {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
	margin-bottom: 20px;
}

.exercise-card, .notes-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-sm);
    padding: 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

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

.exercise-title { color: var(--accent-emerald); font-size: 1rem; }
.exercise-meta { font-size: 0.85rem; color: var(--accent-blue); font-weight: 700; }
.exercise-desc { font-size: 0.85rem; color: var(--text-secondary); line-height: 1.4; }

/* Métricas Perfil */
.metrics-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 0.75rem;
}

.metric-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-sm);
    padding: 1rem;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.metric-title { font-size: 0.75rem; color: var(--text-secondary); font-weight: 600; }
.metric-value { font-size: 1.4rem; font-weight: 800; color: var(--accent-emerald); }
.metric-subtext, .metric-badge { font-size: 0.7rem; color: var(--text-muted); }

.disclaimer-card {
    background: rgba(245, 158, 11, 0.08);
    border: 1px solid rgba(245, 158, 11, 0.2);
    border-radius: var(--border-radius-sm);
    padding: 0.85rem;
    font-size: 0.78rem;
    color: #fcd34d;
}

/* Histórico List */
.history-item {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-sm);
    padding: 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.75rem;
}

.history-info { display: flex; flex-direction: column; gap: 2px; }
.history-date { font-size: 0.7rem; color: var(--text-muted); text-transform: uppercase; }
.history-title { font-weight: 700; font-size: 0.95rem; }
.history-sub { font-size: 0.8rem; color: var(--text-secondary); }

/* Navegación Inferior */
.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 100%;
    max-width: 600px;
    background: rgba(17, 24, 39, 0.95);
    backdrop-filter: blur(16px);
    border-top: 1px solid var(--border-color);
    display: flex;
    justify-content: space-around;
    padding: 0.5rem 0;
    z-index: 100;
}

.nav-btn {
    background: transparent;
    border: none;
    color: var(--text-muted);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    cursor: pointer;
    font-size: 0.7rem;
    width: 33%;
    transition: var(--transition);
}

.nav-icon { font-size: 1.25rem; }
.nav-btn.active { color: var(--accent-emerald); font-weight: 700; }

/* SEO Card */
.seo-info-card {
    font-size: 0.82rem;
    color: var(--text-muted);
}
.seo-info-card h2 { font-size: 0.95rem; color: var(--text-secondary); margin-bottom: 0.4rem; }

/* Loader Pulse */
.ai-pulse-loader {
    position: relative;
    width: 80px;
    height: 80px;
    margin: 0 auto 1.5rem auto;
    display: flex;
    align-items: center;
    justify-content: center;
}

.ai-icon { font-size: 2.5rem; z-index: 2; }
.pulse-ring {
    position: absolute;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    background: var(--accent-emerald);
    opacity: 0.4;
    animation: pulseAnim 1.8s infinite ease-out;
}

@keyframes pulseAnim {
    0% { transform: scale(0.8); opacity: 0.8; }
    100% { transform: scale(1.6); opacity: 0; }
}

.text-center { text-align: center; }
.section-title-bar { display: flex; justify-content: space-between; align-items: center; }
#notes-list {list-style-type: disclosure-closed;}
#notes-list li{margin-left: 10px;}