/*
 * site.css — Heaven ML Design System
 * Tokens + Base + Navbar + Shared Components
 */

/* ─── TYPOGRAPHY BASE ────────────────────────────────────────────────────── */
html {
    font-size: 14px;
    scroll-behavior: smooth;
}

@media (min-width: 768px) {
    html {
        font-size: 16px;
    }
}

/* ─── DESIGN TOKENS — LIGHT MODE ─────────────────────────────────────────── */
:root {
    /* Brand */
    --ml-yellow:        #FFE600;
    --ml-yellow-dim:    rgba(255, 230, 0, 0.12);
    --ml-yellow-border: rgba(255, 230, 0, 0.35);
    --ml-blue:          #3483FA;
    --ml-blue-hover:    #2968C8;
    --ml-blue-dim:      rgba(52, 131, 250, 0.10);

    /* Surfaces — light */
    --hml-page:          #f3f4f7;
    --hml-surface:       #ffffff;
    --hml-surface-raise: #f8f9fb;
    --hml-surface-inset: #f0f1f5;

    /* Borders — light */
    --hml-border:        rgba(0, 0, 0, 0.08);
    --hml-border-strong: rgba(0, 0, 0, 0.15);

    /* Text — light */
    --hml-text-1: #1a1a2e;
    --hml-text-2: #505078;
    --hml-text-3: #8888a8;
    --hml-text-4: #b0b0c8;

    /* Semantic — light */
    --hml-success:    #16a34a;
    --hml-success-bg: rgba(22, 163, 74, 0.10);
    --hml-danger:     #dc2626;
    --hml-danger-bg:  rgba(220, 38, 38, 0.10);
    --hml-warning:    #d97706;
    --hml-warning-bg: rgba(217, 119, 6, 0.10);

    /* Controls — light */
    --hml-ctrl-bg:     #f0f1f5;
    --hml-ctrl-border: rgba(0, 0, 0, 0.12);

    /* Geometry */
    --hml-radius:    8px;
    --hml-radius-sm: 4px;
    --hml-radius-lg: 12px;

    /* Motion */
    --hml-ease: 0.15s ease;
}

/* ─── DESIGN TOKENS — DARK MODE ──────────────────────────────────────────── */
[data-bs-theme="dark"] {
    /* Surfaces — warm charcoal (not cold blue-gray) */
    --hml-page:          #0f0f1a;
    --hml-surface:       #17172a;
    --hml-surface-raise: #1e1e33;
    --hml-surface-inset: #111120;

    /* Borders — dark */
    --hml-border:        rgba(255, 255, 255, 0.08);
    --hml-border-strong: rgba(255, 255, 255, 0.14);

    /* Text — dark (slightly warm white) */
    --hml-text-1: #eeeef8;
    --hml-text-2: #9090b8;
    --hml-text-3: #606080;
    --hml-text-4: #404060;

    /* Semantic — dark (desaturated for dark surfaces) */
    --hml-success:    #4ade80;
    --hml-success-bg: rgba(74, 222, 128, 0.12);
    --hml-danger:     #f87171;
    --hml-danger-bg:  rgba(248, 113, 113, 0.12);
    --hml-warning:    #fbbf24;
    --hml-warning-bg: rgba(251, 191, 36, 0.12);

    /* Controls — inset feel on dark */
    --hml-ctrl-bg:     #111120;
    --hml-ctrl-border: rgba(255, 255, 255, 0.10);
}

/* ─── BASE ────────────────────────────────────────────────────────────────── */
html {
    position: relative;
    min-height: 100%;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    -webkit-font-smoothing: antialiased;
}

*, *::before, *::after {
    transition: background-color var(--hml-ease), border-color var(--hml-ease), color var(--hml-ease), box-shadow var(--hml-ease);
}

/* ─── NAVBAR ──────────────────────────────────────────────────────────────── */
.hml-navbar {
    height: 52px;
    padding: 0 1rem !important;
    background-color: var(--hml-surface) !important;
    border-bottom: 1px solid var(--hml-border) !important;
    box-shadow: 0 1px 0 var(--hml-border);
    margin-bottom: 0 !important;
}

.hml-brand {
    font-size: 0.925rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    color: var(--ml-blue) !important;
    display: flex;
    align-items: center;
    gap: 6px;
    text-decoration: none !important;
    padding: 0 !important;
}

[data-bs-theme="dark"] .hml-brand {
    color: var(--ml-yellow) !important;
}

/* Heaven SVG icon via mask-image — hereda el color del padre con currentColor */
.heaven-icon {
    display: inline-block;
    background-color: currentColor;
    -webkit-mask-image: url('/imgs/heaven-isotipo.svg');
    mask-image: url('/imgs/heaven-isotipo.svg');
    -webkit-mask-repeat: no-repeat;
    mask-repeat: no-repeat;
    -webkit-mask-size: contain;
    mask-size: contain;
    -webkit-mask-position: center;
    mask-position: center;
    width: 1.2em;
    height: 1em;
    vertical-align: middle;
    flex-shrink: 0;
}

.hml-nav-link {
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--hml-text-2) !important;
    padding: 5px 10px !important;
    border-radius: var(--hml-radius-sm);
}

.hml-nav-link:hover {
    color: var(--hml-text-1) !important;
    background-color: var(--hml-surface-raise);
}

/* User badge */
.hml-user-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 500;
    background-color: var(--ml-yellow-dim);
    color: var(--hml-text-2);
    border: 1px solid var(--ml-yellow-border);
    line-height: 1.5;
}

[data-bs-theme="dark"] .hml-user-badge {
    background-color: rgba(255, 230, 0, 0.10);
    color: var(--ml-yellow);
    border-color: rgba(255, 230, 0, 0.20);
}

/* Subsidiary badge */
.hml-subsidiary-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 0.78rem;
    font-weight: 500;
    background-color: rgba(0, 180, 255, 0.10);
    color: #4db8ff;
    border: 1px solid rgba(0, 180, 255, 0.25);
    line-height: 1.5;
}

[data-bs-theme="light"] .hml-subsidiary-badge {
    background-color: rgba(0, 120, 200, 0.08);
    color: #0070c0;
    border-color: rgba(0, 120, 200, 0.25);
}

/* Theme toggle button */
.hml-theme-btn {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--hml-border);
    border-radius: var(--hml-radius-sm);
    background: transparent;
    color: var(--hml-text-3);
    cursor: pointer;
    flex-shrink: 0;
}

.hml-theme-btn:hover {
    background-color: var(--hml-surface-raise);
    color: var(--hml-text-1);
    border-color: var(--hml-border-strong);
}

/* ─── BETA BADGE ──────────────────────────────────────────────────────────── */
@keyframes betaPulse {
    0%, 100% { box-shadow: 0 0 6px rgba(255, 107, 53, 0.5), 0 0 14px rgba(255, 107, 53, 0.25); }
    50%       { box-shadow: 0 0 12px rgba(255, 107, 53, 0.8), 0 0 24px rgba(255, 107, 53, 0.4); }
}

.hml-beta-badge {
    font-size: 0.65rem;
    font-weight: 800;
    letter-spacing: 0.12em;
    padding: 2px 8px;
    border-radius: 20px;
    background: linear-gradient(135deg, #ff6b35, #f7c59f);
    color: #fff;
    box-shadow: 0 0 6px rgba(255, 107, 53, 0.5), 0 0 14px rgba(255, 107, 53, 0.25);
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
    animation: betaPulse 2s ease-in-out infinite;
    align-self: center;
    line-height: 1.7;
}

/* ─── FOCUS STATES ────────────────────────────────────────────────────────── */
.btn:focus,
.btn:active:focus,
.form-control:focus,
.form-select:focus,
.form-check-input:focus {
    box-shadow: 0 0 0 3px rgba(52, 131, 250, 0.2) !important;
    outline: none !important;
}

[data-bs-theme="dark"] .btn:focus,
[data-bs-theme="dark"] .form-control:focus,
[data-bs-theme="dark"] .form-select:focus {
    box-shadow: 0 0 0 3px rgba(255, 230, 0, 0.18) !important;
}

/* ─── FOOTER ──────────────────────────────────────────────────────────────── */
.hml-footer {
    padding: 0.6rem 0;
    margin-top: auto;
    font-size: 0.75rem;
    color: var(--hml-text-3);
    border-top: 1px solid var(--hml-border);
}
