/* ============================================================
   base.css – Reset, Typography, Global Utilities, Animations
   ============================================================ */

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

html { font-size: 16px; scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }

body {
    font-family: var(--font);
    font-size: var(--text-base);
    color: var(--surface-800);
    background: var(--surface-100);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    -webkit-tap-highlight-color: transparent;
    overflow-x: hidden;
}

h1,h2,h3,h4,h5,h6 { font-weight: 700; line-height: 1.3; color: var(--surface-900); }
a { color: var(--brand-500); text-decoration: none; transition: color var(--t-fast); }
a:hover { color: var(--brand-700); }
button { font-family: var(--font); cursor: pointer; border: none; background: none; }
input, select, textarea { font-family: var(--font); }
ul, ol { list-style: none; }

/* ─── Ambient Background (kế thừa HUBSP) ─── */
.ambient-bg {
    position: fixed; inset: 0;
    pointer-events: none; z-index: 0; overflow: hidden;
}
.ambient-bg::before {
    content: ''; position: absolute;
    width: 12px; height: 12px;
    background: #f43f5e; opacity: 0.12; border-radius: 50%;
    top: 15%; left: 8%; filter: blur(1px);
}
.ambient-bg::after {
    content: ''; position: absolute;
    width: 8px; height: 8px;
    background: #eab308; opacity: 0.12; border-radius: 50%;
    bottom: 25%; right: 12%; filter: blur(1px);
}

/* ─── Gradient Text ─── */
.gradient-text {
    background: linear-gradient(135deg, var(--brand-800) 0%, var(--brand-500) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* ─── Utilities ─── */
.hidden      { display: none !important; }
.mt-4        { margin-top: var(--sp-4); }
.text-xs     { font-size: var(--text-xs); }
.text-sm     { font-size: var(--text-sm); }
.font-medium { font-weight: 500; }
.font-semibold { font-weight: 600; }
.font-bold   { font-weight: 700; }
.text-muted  { color: var(--surface-500); }
.text-danger { color: var(--color-danger); }
.text-success{ color: var(--color-success); }
.text-warning{ color: var(--color-warning); }

/* ─── Scrollbar ─── */
::-webkit-scrollbar { width: 4px; height: 4px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--surface-300); border-radius: var(--r-full); }
::-webkit-scrollbar-thumb:hover { background: var(--surface-400); }

::selection { background: var(--brand-100); color: var(--brand-800); }

/* ─── Keyframe Animations ─── */
@keyframes fadeIn   { from { opacity: 0; } to { opacity: 1; } }
@keyframes slideUp  { from { transform: translateY(16px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }
@keyframes slideInRight { from { transform: translateX(100%); } to { transform: translateX(0); } }
@keyframes slideInLeft  { from { transform: translateX(-100%); } to { transform: translateX(0); } }
@keyframes pulseSoft {
    0%, 100% { opacity: 0.3; transform: scale(1); }
    50%       { opacity: 0;   transform: scale(1.5); }
}
@keyframes spin { from { transform: rotate(0deg); } to { transform: rotate(360deg); } }
@keyframes toastIn {
    from { transform: translateX(110%); opacity: 0; }
    to   { transform: translateX(0);    opacity: 1; }
}
@keyframes toastOut {
    from { transform: translateX(0);   opacity: 1; }
    to   { transform: translateX(110%); opacity: 0; }
}

.animate-fade-in  { animation: fadeIn  0.3s ease-out both; }
.animate-slide-up { animation: slideUp 0.4s cubic-bezier(0.16,1,0.3,1) both; }
