/**
 * Stitch TrainerFlow Pro - Core CSS Design System
 * Theme: Dark Ultra-Performance with Volt Lime Accents (#caf300)
 */

:root {
    --bg-main: #121415;
    --bg-surface: #1a1c1d;
    --bg-surface-elevated: #1e2021;
    --bg-surface-high: #282a2b;
    --bg-surface-highest: #333536;
    --color-primary: #caf300;
    --color-primary-hover: #b0d500;
    --color-primary-text: #171e00;
    --color-text-main: #e2e2e3;
    --color-text-muted: #b7b5b4;
    --color-border: rgba(255, 255, 255, 0.08);
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 18px;
    --radius-full: 9999px;
    --shadow-subtle: 0 4px 20px rgba(0, 0, 0, 0.4);
    --shadow-glow: 0 0 25px rgba(202, 243, 0, 0.25);
}

/* Reset & Ergonomics */
* {
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

/* Evita que inputs con ancho intrínseco grande (ej. type="number") fuercen
   overflow horizontal cuando están dentro de un contenedor flex/grid en móvil */
input, select, textarea {
    min-width: 0;
}

html {
    scroll-behavior: smooth;
    background-color: var(--bg-main);
    color: var(--color-text-main);
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    overscroll-behavior-y: none;
}

h1, h2, h3, h4, .font-display {
    font-family: 'Montserrat', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

/* Custom Scrollbars */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}
::-webkit-scrollbar-track {
    background: var(--bg-main);
}
::-webkit-scrollbar-thumb {
    background: var(--bg-surface-highest);
    border-radius: var(--radius-full);
}
::-webkit-scrollbar-thumb:hover {
    background: var(--color-primary);
}

/* Mobile Safe Areas */
.safe-area-pb {
    padding-bottom: max(env(safe-area-inset-bottom, 16px), 16px);
}

/* Glassmorphism Cards */
.forge-card {
    background: var(--bg-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-subtle);
    transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

.forge-card-interactive:hover {
    border-color: rgba(202, 243, 0, 0.3);
    transform: translateY(-2px);
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.5);
}

/* High Voltage Primary Button */
.btn-volt {
    background-color: var(--color-primary);
    color: var(--color-primary-text);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    border-radius: var(--radius-md);
    padding: 0.75rem 1.5rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    box-shadow: var(--shadow-glow);
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
    border: none;
}

.btn-volt:hover {
    background-color: var(--color-primary-hover);
    transform: translateY(-1px);
    box-shadow: 0 0 30px rgba(202, 243, 0, 0.4);
}

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

.btn-volt:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    box-shadow: none;
    transform: none;
}

/* Secondary Button */
.btn-secondary {
    background: var(--bg-surface-high);
    color: #ffffff;
    font-weight: 600;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    padding: 0.75rem 1.25rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    transition: all 0.2s ease;
    cursor: pointer;
}

.btn-secondary:hover {
    background: var(--bg-surface-highest);
    border-color: rgba(255, 255, 255, 0.2);
    color: #ffffff;
}

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

/* ===================================================================
   Input Fields with Ultra-Dark Gym Background & High Contrast White Text
   =================================================================== */
input,
select,
textarea,
[type='text'],
[type='email'],
[type='url'],
[type='password'],
[type='number'],
[type='date'],
[type='datetime-local'],
[type='month'],
[type='search'],
[type='tel'],
[type='time'],
.forge-input,
.forge-select,
.forge-textarea {
    width: 100%;
    background-color: #1a1c1e !important;
    border: 1px solid rgba(255, 255, 255, 0.15) !important;
    border-radius: var(--radius-md);
    padding: 0.85rem 1rem;
    color: #ffffff !important;
    font-size: 0.95rem;
    color-scheme: dark;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

input:focus,
select:focus,
textarea:focus,
[type='text']:focus,
[type='email']:focus,
[type='url']:focus,
[type='password']:focus,
[type='number']:focus,
[type='date']:focus,
[type='datetime-local']:focus,
[type='month']:focus,
[type='search']:focus,
[type='tel']:focus,
[type='time']:focus,
.forge-input:focus,
.forge-select:focus,
.forge-textarea:focus {
    outline: none !important;
    border-color: #caf300 !important;
    box-shadow: 0 0 0 3px rgba(202, 243, 0, 0.2) !important;
    background-color: #222527 !important;
    color: #ffffff !important;
}

input::placeholder,
textarea::placeholder,
.forge-input::placeholder,
.forge-textarea::placeholder {
    color: #71717a !important;
    opacity: 1;
}

/* Chrome/Safari/Edge Autofill Background Fix */
input:-webkit-autofill,
input:-webkit-autofill:hover, 
input:-webkit-autofill:focus, 
input:-webkit-autofill:active {
    -webkit-box-shadow: 0 0 0 40px #1a1c1e inset !important;
    -webkit-text-fill-color: #ffffff !important;
    caret-color: #ffffff !important;
    border-color: rgba(255, 255, 255, 0.2) !important;
    transition: background-color 5000s ease-in-out 0s;
}

/* Status Badges */
.badge-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.25rem 0.75rem;
    border-radius: var(--radius-full);
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: capitalize;
}

/* Toast System Animations */
@keyframes toastSlideIn {
    from {
        opacity: 0;
        transform: translateX(100%) scale(0.9);
    }
    to {
        opacity: 1;
        transform: translateX(0) scale(1);
    }
}

@keyframes toastSlideOut {
    from {
        opacity: 1;
        transform: translateX(0) scale(1);
    }
    to {
        opacity: 0;
        transform: translateX(100%) scale(0.9);
    }
}

.toast-enter {
    animation: toastSlideIn 0.3s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.toast-exit {
    animation: toastSlideOut 0.25s ease-in forwards;
}

/* Modal Open Class */
.modal-active {
    opacity: 1 !important;
    pointer-events: auto !important;
}

.modal-active > div {
    transform: scale(1) !important;
}

/* Micro-animations */
@keyframes pulseGlow {
    0%, 100% {
        box-shadow: 0 0 15px rgba(202, 243, 0, 0.2);
    }
    50% {
        box-shadow: 0 0 30px rgba(202, 243, 0, 0.5);
    }
}

.animate-glow {
    animation: pulseGlow 2.5s infinite;
}

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

.animate-fadeIn {
    animation: fadeIn 0.25s ease-out forwards;
}
