/**
 * Solwater PRO - Core Design Tokens
 * Variables y componentes universales compartidos.
 */

:root {
    --bg-main: #0f172a;
    --bg-card: #1e293b;
    --text-main: #f8fafc;
    --text-muted: #94a3b8;
    --accent: #2da3ca;
    --accent-hover: #2488a8;
    --border: #334155;
    --border-light: #e2e8f0;
    --success: #10b981;
    --warning: #f59e0b;
    --danger: #ef4444;
    --shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
}

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

body {
    font-family: 'Inter', -apple-system, sans-serif;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

h1, h2, h3, .logo-text { font-family: 'Montserrat', sans-serif; }

/* Componente: Card Universal */
.card {
    background: #ffffff;
    border: 1px solid var(--border-light);
    border-radius: 16px;
    padding: 20px;
    box-shadow: var(--shadow);
}

/* Componente: Botón Premium */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 24px;
    border-radius: 12px;
    font-weight: 600;
    font-size: 0.9rem;
    border: none;
    cursor: pointer;
    transition: all 0.2s;
    font-family: inherit;
}

.btn-primary { background: var(--accent); color: white; }
.btn-primary:active { transform: scale(0.96); }

.btn-ghost { background: transparent; border: 1px solid var(--border-light); color: var(--text-muted); }
.btn-sm { padding: 8px 16px; font-size: 0.8rem; }

/* Componente: Input PRO */
.pro-input {
    width: 100%;
    height: 48px;
    padding: 0 16px;
    border-radius: 12px;
    border: 1px solid var(--border-light);
    background: #f8fafc;
    font-size: 0.95rem;
    transition: all 0.2s;
}

.pro-input:focus { border-color: var(--accent); outline: none; background: #ffffff; }

/* Status Badges */
.status-badge {
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.7rem;
    font-weight: 700;
    background: #f1f5f9;
    color: #64748b;
}

.status-sync { background: #dcfce7; color: #166534; }
.status-pending { background: #fef3c7; color: #92400e; }

/* --- SISTEMA DE MODALES PREMIUM --- */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(10, 15, 30, 0.85);
    backdrop-filter: blur(10px);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    padding: 20px;
}

.modal-overlay.active { display: flex; }

.modal-card {
    background: #1e293b;
    border: 1px solid #334155;
    width: 100%;
    max-width: 400px;
    border-radius: 28px;
    padding: 32px;
    text-align: center;
    animation: modalIn 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
}

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

.modal-header { margin-bottom: 24px; }
.modal-title { font-size: 1.5rem; font-weight: 800; color: var(--accent); margin-bottom: 8px; font-family: 'Montserrat'; }
.modal-subtitle { color: var(--text-muted); font-size: 0.95rem; line-height: 1.5; }

.modal-footer {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-top: 32px;
}

.modal-footer .btn { width: 100%; height: 52px; font-size: 1rem; }

/* Splash Screen (Común) */
.splash-screen {
    position: fixed;
    inset: 0;
    background: #0f172a;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    transition: all 0.6s ease;
}

.splash-logo { width: 80px; margin-bottom: 20px; animation: pulse 2s infinite; }
@keyframes pulse { 0%, 100% { transform: scale(1); opacity: 0.8; } 50% { transform: scale(1.1); opacity: 1; } }

.splash-loader { width: 30px; height: 30px; border: 3px solid rgba(255,255,255,0.1); border-top-color: var(--accent); border-radius: 50%; animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* --- SISTEMA DE NOTIFICACIONES (TOASTS) --- */
.toast-container {
    position: fixed;
    bottom: 100px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 11000;
    display: flex;
    flex-direction: column;
    gap: 12px;
    pointer-events: none;
    width: calc(100% - 40px);
    max-width: 320px;
}

.toast {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(15px);
    border: 1px solid rgba(15, 23, 42, 0.1);
    color: #0f172a;
    padding: 16px 20px;
    border-radius: 18px;
    display: flex;
    align-items: center;
    gap: 12px;
    box-shadow: 0 15px 30px -5px rgba(0, 0, 0, 0.4);
    animation: toastIn 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    pointer-events: auto;
}

.toast i { width: 20px; height: 20px; color: #2da3ca; flex-shrink: 0; }
.toast span { font-size: 0.9rem; font-weight: 700; }

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

.toast.error { border-color: var(--danger); }
.toast.error i { color: var(--danger); }

/* --- BLOQUES DE IA CONSULTORÍA SENIOR --- */
.ia-senior-block {
    background: rgba(10, 15, 30, 0.4);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 18px;
    transition: all 0.3s ease;
}

.ia-senior-block.study-level {
    border: 1px solid rgba(139, 92, 246, 0.2);
    background: rgba(139, 92, 246, 0.03);
}

.ia-header {
    padding: 12px 15px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.btn-ia-action {
    background: linear-gradient(135deg, #8b5cf6, #d946ef);
    border: none;
    border-radius: 10px;
    color: white;
    font-size: 0.7rem;
    font-weight: 800;
    padding: 8px 16px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.2s ease;
    box-shadow: 0 4px 15px rgba(139, 92, 246, 0.3);
}

.btn-ia-action:active { transform: scale(0.95); }
.btn-ia-action.small { padding: 6px 12px; font-size: 0.6rem; }

.ia-result-box {
    background: rgba(0, 0, 0, 0.2);
    padding: 15px;
    font-family: 'Roboto', sans-serif;
    font-size: 0.9rem;
    line-height: 1.5;
    color: #cbd5e1;
    max-height: 300px;
    overflow-y: auto;
}

/* Efecto de carga en botón IA */
.btn-ia-action.loading {
    opacity: 0.7;
    pointer-events: none;
    background: #475569;
}
