@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');
@import url('variables.css');
@import url('components/glass-panel.css');
@import url('components/button.css');
@import url('components/form.css');
@import url('components/badge.css');
@import url('components/stat-card.css');
@import url('components/data-table.css');
@import url('components/alert.css');
@import url('components/pagination.css');
@import url('components/modal.css');
@import url('layout/sidebar.css');
@import url('layout/topbar.css');
@import url('layout/grid.css');

/* ── Username with avatar ── */
.user-tag {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}
.user-tag__avatar {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: var(--color-accent-subtle);
    color: var(--color-accent);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 10px;
    flex-shrink: 0;
    text-transform: uppercase;
}
.user-tag__avatar img {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
}
.user-tag__name {
    font-weight: var(--font-weight-medium);
}
.user-tag__name::before {
    content: '@';
    opacity: 0.4;
}

/* ── Hint icon (?) ── */
.th-hint {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: var(--color-bg-glass-hover);
    border: 1px solid var(--glass-border);
    color: var(--color-text-muted);
    font-size: 10px;
    font-weight: 700;
    cursor: help;
    margin-left: 4px;
    transition: all 200ms ease;
    vertical-align: middle;
    position: relative;
}
.th-hint:hover {
    background: var(--color-accent-subtle);
    border-color: var(--color-accent);
    color: var(--color-accent);
}

/* Tooltip via data-tip (CSS-only) */
/* Tooltip (JS-rendered, appended to body) */
.th-tip {
    position: fixed;
    z-index: 9999;
    pointer-events: none;
    display: none;
    background: var(--color-bg-elevated);
    border: 1px solid var(--glass-border-light);
    border-radius: var(--radius-md);
    padding: 6px 10px;
    font-size: var(--font-size-xs);
    font-weight: var(--font-weight-normal);
    color: var(--color-text-secondary);
    line-height: 1.4;
    max-width: 280px;
    box-shadow: var(--glass-shadow);
}

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

html {
    font-size: var(--font-size-base);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-family);
    background: var(--color-bg-primary);
    color: var(--color-text-primary);
    line-height: 1.6;
    min-height: 100vh;
    overflow-x: hidden;
    position: relative;
}

/* ── Ambient floating orbs ── */
.ambient-orb {
    position: fixed;
    border-radius: 50%;
    pointer-events: none;
    filter: blur(80px);
    z-index: 0;
}

.ambient-orb--purple {
    width: 400px;
    height: 400px;
    background: radial-gradient(circle, var(--orb-purple), transparent 70%);
    top: -100px;
    right: 10%;
    opacity: 0.15;
    animation: float-orb-1 20s ease-in-out infinite;
}

.ambient-orb--green {
    width: 350px;
    height: 350px;
    background: radial-gradient(circle, var(--orb-green), transparent 70%);
    bottom: 10%;
    left: 5%;
    opacity: 0.12;
    animation: float-orb-2 25s ease-in-out infinite;
}

.ambient-orb--blue {
    width: 300px;
    height: 300px;
    background: radial-gradient(circle, var(--orb-blue), transparent 70%);
    top: 40%;
    right: 30%;
    opacity: 0.1;
    animation: float-orb-3 22s ease-in-out infinite;
}

@keyframes float-orb-1 {
    0%, 100% { transform: translate(0, 0) scale(1); }
    25% { transform: translate(-40px, 60px) scale(1.1); }
    50% { transform: translate(30px, -30px) scale(0.95); }
    75% { transform: translate(-20px, -50px) scale(1.05); }
}

@keyframes float-orb-2 {
    0%, 100% { transform: translate(0, 0) scale(1); }
    33% { transform: translate(50px, -40px) scale(1.08); }
    66% { transform: translate(-30px, 30px) scale(0.92); }
}

@keyframes float-orb-3 {
    0%, 100% { transform: translate(0, 0) scale(1); }
    20% { transform: translate(-35px, 25px) scale(1.05); }
    40% { transform: translate(20px, -45px) scale(0.97); }
    60% { transform: translate(40px, 15px) scale(1.1); }
    80% { transform: translate(-15px, -30px) scale(0.93); }
}

/* ── Links ── */
a {
    color: var(--color-accent);
    text-decoration: none;
    transition: color var(--transition-base);
}

a:hover {
    color: var(--color-accent-hover);
}

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

::-moz-selection {
    background: var(--color-accent);
    color: var(--color-text-inverse);
}

/* ── Scrollbar ── */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

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

::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.1);
    border-radius: var(--radius-full);
    transition: background var(--transition-base);
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.2);
}

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

/* Firefox scrollbar */
* {
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 255, 255, 0.1) transparent;
}

/* ── Utility: text helpers ── */
.text-muted {
    color: var(--color-text-muted);
}

.text-secondary {
    color: var(--color-text-secondary);
}

.text-accent {
    color: var(--color-accent);
}

.text-success {
    color: var(--color-success);
}

.text-danger {
    color: var(--color-danger);
}

.text-warning {
    color: var(--color-warning);
}

/* ── Utility: spacing ── */
.mt-sm { margin-top: var(--spacing-sm); }
.mt-md { margin-top: var(--spacing-md); }
.mt-lg { margin-top: var(--spacing-lg); }
.mb-sm { margin-bottom: var(--spacing-sm); }
.mb-md { margin-bottom: var(--spacing-md); }
.mb-lg { margin-bottom: var(--spacing-lg); }

/* ── Utility: flex helpers ── */
.flex { display: flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-xs { gap: var(--spacing-xs); }
.gap-sm { gap: var(--spacing-sm); }
.gap-md { gap: var(--spacing-md); }
.gap-lg { gap: var(--spacing-lg); }

/* ── Image defaults ── */
img {
    max-width: 100%;
    height: auto;
}

/* ── Focus visible for keyboard navigation ── */
:focus-visible {
    outline: 2px solid var(--color-accent);
    outline-offset: 2px;
}
