/* ==========================================================================
   GLOBAL CSS - COMPORTAMIENTO TIPO APP
   ========================================================================== */
@import 'variables.css';

/* --------------------------------------
   RESETS BÁSICOS
   -------------------------------------- */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    font-size: 16px;
    -webkit-text-size-adjust: 100%;
    /* Prevenir scroll rebotando en móviles para sensación de App Nativa */
    overscroll-behavior: none; 
}

body {
    background-color: var(--color-bg-base);
    color: var(--color-text-primary);
    font-family: var(--font-sans);
    font-size: var(--text-base);
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    
    /* Configuración para sensación de App a pantalla completa */
    min-height: 100vh;
    /* height: 100vh falla en móviles por la barra del navegador, usamos min-height y calc */
    min-height: calc(100vh - var(--safe-top) - var(--safe-bottom));
    display: flex;
    flex-direction: column;
    
    /* Prevenir selección de texto accidental en interfaces (App-like) */
    user-select: none;
    -webkit-user-select: none;
    
    /* Suavizar fondos oscuros */
    background-image: 
        radial-gradient(circle at 15% 50%, rgba(59, 130, 246, 0.08), transparent 25%),
        radial-gradient(circle at 85% 30%, rgba(16, 185, 129, 0.08), transparent 25%);
}

/* Permitir selección de texto solo donde es útil */
input, textarea, p.selectable, h1.selectable {
    user-select: auto;
    -webkit-user-select: auto;
}

/* --------------------------------------
   TIPOGRAFÍA Y HEADINGS
   -------------------------------------- */
h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-display);
    font-weight: 700;
    line-height: 1.2;
    color: var(--color-text-primary);
    margin-bottom: var(--space-4);
}

h1 { font-size: var(--text-3xl); letter-spacing: -0.02em; }
h2 { font-size: var(--text-2xl); letter-spacing: -0.01em; }
h3 { font-size: var(--text-xl); }

p {
    color: var(--color-text-muted);
    margin-bottom: var(--space-4);
}

/* --------------------------------------
   GLASSMORPHISM & UI COMPONENTS
   -------------------------------------- */

.glass-card {
    background: rgba(21, 27, 43, 0.6);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    padding: var(--space-6);
    box-shadow: var(--shadow-md);
    transition: transform var(--transition-base), box-shadow var(--transition-base);
}

.glass-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg), var(--shadow-glow);
}

/* Botones Premium */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: var(--space-3) var(--space-6);
    font-family: var(--font-display);
    font-weight: 600;
    font-size: var(--text-sm);
    border-radius: var(--radius-md);
    border: none;
    cursor: pointer;
    transition: all var(--transition-base);
    text-decoration: none;
}

/* Efecto de tap táctil para móviles */
.btn:active {
    transform: scale(0.96);
}

.btn-primary {
    background: var(--color-primary);
    color: #fff;
    box-shadow: 0 4px 14px 0 rgba(59, 130, 246, 0.39);
}

.btn-primary:hover {
    background: var(--color-primary-hover);
    box-shadow: 0 6px 20px rgba(59, 130, 246, 0.5);
}

.btn-full {
    width: 100%;
}

/* --------------------------------------
   FORMULARIOS
   -------------------------------------- */
.form-group {
    margin-bottom: var(--space-4);
    display: flex;
    flex-direction: column;
}

.form-label {
    font-size: var(--text-sm);
    font-weight: 500;
    color: var(--color-text-muted);
    margin-bottom: var(--space-2);
}

.form-input {
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid var(--color-border);
    color: var(--color-text-primary);
    padding: var(--space-3) var(--space-4);
    border-radius: var(--radius-md);
    font-family: var(--font-sans);
    font-size: var(--text-base);
    transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

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

.form-input::placeholder {
    color: rgba(148, 163, 184, 0.5);
}

/* --------------------------------------
   LAYOUTS (Contenedores)
   -------------------------------------- */
.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 var(--space-4);
}

.app-layout {
    display: flex;
    flex-direction: column;
    height: 100vh;
    padding-top: var(--safe-top);
    padding-bottom: var(--safe-bottom);
}

.center-screen {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: var(--space-4);
}

/* Ocultar barra de scroll para una sensación más limpia */
::-webkit-scrollbar {
    width: 8px;
}
::-webkit-scrollbar-track {
    background: var(--color-bg-base); 
}
::-webkit-scrollbar-thumb {
    background: var(--color-bg-elevated); 
    border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
    background: var(--color-text-muted); 
}
