/* ============================================================
   BASE — Reset, Typography, Body Defaults, Utilities
   ============================================================ */

/* ── Google Fonts loaded in head.php ── */

/* ── Reset ─────────────────────────────────────── */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

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

body {
    font-family: var(--font-main);
    font-size: var(--text-base);
    font-weight: var(--weight-normal);
    line-height: var(--leading-normal);
    color: var(--text-primary);
    background-color: var(--bg-body);
    min-height: 100vh;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* ── Links ─────────────────────────────────────── */
a {
    color: var(--brand-primary);
    text-decoration: none;
    transition: color var(--transition-fast);
}

a:hover {
    color: var(--brand-primary-hover);
}

/* ── Images ────────────────────────────────────── */
img, svg {
    max-width: 100%;
    display: block;
}

/* ── Lists ─────────────────────────────────────── */
ul, ol {
    list-style: none;
}

/* ── Buttons ───────────────────────────────────── */
button {
    font-family: inherit;
    font-size: inherit;
    cursor: pointer;
    border: none;
    background: none;
    color: inherit;
}

/* ── Inputs ────────────────────────────────────── */
input, select, textarea {
    font-family: inherit;
    font-size: var(--text-base);
    color: var(--text-primary);
    background-color: var(--bg-elevated);
    border: 1px solid var(--border-input);
    border-radius: var(--radius-md);
    outline: none;
    transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

input:focus, select:focus, textarea:focus {
    border-color: var(--brand-primary);
    box-shadow: 0 0 0 3px var(--brand-primary-light);
}

input::placeholder, textarea::placeholder {
    color: var(--text-tertiary);
}

/* ── Scrollbar (Webkit) ────────────────────────── */
::-webkit-scrollbar {
    width: 4px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: var(--radius-full);
}

/* ── Selection ─────────────────────────────────── */
::selection {
    background-color: var(--brand-primary);
    color: var(--text-inverse);
}

/* ── Typography ────────────────────────────────── */
h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-display);
    font-weight: var(--weight-bold);
    line-height: var(--leading-tight);
    color: var(--text-primary);
}

h1 { font-size: var(--text-3xl); }
h2 { font-size: var(--text-2xl); }
h3 { font-size: var(--text-xl);  }
h4 { font-size: var(--text-lg);  }
h5 { font-size: var(--text-md);  }
h6 { font-size: var(--text-base);}

p {
    color: var(--text-secondary);
    line-height: var(--leading-relaxed);
}

small {
    font-size: var(--text-xs);
    color: var(--text-tertiary);
}

/* ── Icon Golden Color ──────────────────────────── */
.section-title i,
.page-title i,
.form-section-title i,
.info-item i,
.stat-icon i,
.sidebar-stat i {
    color: var(--brand-primary);
}

/* ── Utility Classes ───────────────────────────── */
.text-brand   { color: var(--brand-primary) !important; }
.text-success { color: var(--success) !important; }
.text-danger  { color: var(--danger) !important; }
.text-warning { color: var(--warning) !important; }
.text-info    { color: var(--info) !important; }
.text-muted   { color: var(--text-secondary) !important; }
.text-center  { text-align: center !important; }
.text-right   { text-align: right !important; }

.font-display { font-family: var(--font-display) !important; }
.font-medium  { font-weight: var(--weight-medium) !important; }
.font-semi    { font-weight: var(--weight-semi) !important; }
.font-bold    { font-weight: var(--weight-bold) !important; }

.mt-xs  { margin-top: var(--space-xs) !important; }
.mt-sm  { margin-top: var(--space-sm) !important; }
.mt-md  { margin-top: var(--space-md) !important; }
.mt-lg  { margin-top: var(--space-lg) !important; }
.mb-xs  { margin-bottom: var(--space-xs) !important; }
.mb-sm  { margin-bottom: var(--space-sm) !important; }
.mb-md  { margin-bottom: var(--space-md) !important; }
.mb-lg  { margin-bottom: var(--space-lg) !important; }

.p-sm   { padding: var(--space-sm) !important; }
.p-md   { padding: var(--space-md) !important; }
.p-lg   { padding: var(--space-lg) !important; }

.flex        { display: flex !important; }
.flex-col    { flex-direction: column !important; }
.items-center{ align-items: center !important; }
.justify-between { justify-content: space-between !important; }
.justify-center  { justify-content: center !important; }
.gap-xs { gap: var(--space-xs) !important; }
.gap-sm { gap: var(--space-sm) !important; }
.gap-md { gap: var(--space-md) !important; }

.w-full  { width: 100% !important; }
.hidden  { display: none !important; }
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    border: 0;
}

/* ── Fade In Animation ─────────────────────────── */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(8px); }
    to   { opacity: 1; transform: translateY(0); }
}

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

@keyframes slideInRight {
    from { transform: translateX(100%); }
    to   { transform: translateX(0); }
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50%      { opacity: 0.5; }
}

@keyframes shimmer {
    0%   { background-position: -200% 0; }
    100% { background-position: 200% 0; }
}

.animate-fade-in   { animation: fadeIn 0.3s ease forwards; }
.animate-slide-up  { animation: slideUp 0.4s ease forwards; }
