/* 
   HIGEXT NEXA — Design System v7.0 "Obsidian Glass"
   True Dark · Vivid Violet/Cyan · Inter Typography
   Modern glassmorphism-driven design language.
*/

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800;900&family=JetBrains+Mono:wght@400;500;600&display=swap');

:root {
    --brand: #8B5CF6;
    --brand-light: #C4B5FD;
    --brand-dark: #7C3AED;
    --brand-hover: #A78BFA;
    --brand-glow: rgba(139, 92, 246, 0.4);
    --brand-subtle: rgba(139, 92, 246, 0.08);

    --bg-deepest: #050507;
    --bg-deep: #09090F;
    --bg-base: #0C0C14;
    --bg-raised: #141420;
    --bg-surface: #18182A;
    --bg-overlay: #1E1E30;
    --bg-float: #282840;
    --bg-hover: rgba(139, 92, 246, 0.06);
    --bg-active: rgba(139, 92, 246, 0.12);
    --bg-highlight: #3A3A50;

    --glass-bg: rgba(12, 12, 20, 0.78);
    --glass-bg-heavy: rgba(5, 5, 7, 0.88);
    --glass-border: rgba(255, 255, 255, 0.06);
    --glass-glow: rgba(139, 92, 246, 0.08);

    --text-100: #F5F5F7;
    --text-200: #E4E4E9;
    --text-300: #C8C8D2;
    --text-400: #9898A8;
    --text-500: #6E6E80;
    --text-600: #4E4E5C;
    --text-700: #36364A;
    --text-800: #1E1E30;
    --text-900: #0C0C14;

    --online: #34D399;
    --idle: #FBBF24;
    --dnd: #F87171;
    --offline: #6E6E80;
    --streaming: #C084FC;

    --success: #34D399;
    --success-bg: rgba(52, 211, 153, 0.1);
    --warning: #FBBF24;
    --warning-bg: rgba(251, 191, 36, 0.1);
    --danger: #F87171;
    --danger-bg: rgba(248, 113, 113, 0.1);
    --info: #22D3EE;
    --info-bg: rgba(34, 211, 238, 0.1);

    --accent-mint: #2DD4BF;
    --accent-rose: #FB7185;
    --accent-sky: #38BDF8;
    --accent-gold: #FBBF24;
    --accent-coral: #FB923C;
    --accent-violet: #C4B5FD;
    --accent-lime: #A3E635;

    --border: rgba(255, 255, 255, 0.07);
    --border-faint: rgba(255, 255, 255, 0.04);
    --border-subtle: rgba(255, 255, 255, 0.06);
    --border-muted: rgba(255, 255, 255, 0.1);
    --border-visible: rgba(255, 255, 255, 0.14);
    --border-strong: rgba(255, 255, 255, 0.2);

    --shadow-xs: 0 1px 2px rgba(0, 0, 0, 0.4);
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.4);
    --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.5);
    --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.5);
    --shadow-xl: 0 16px 48px rgba(0, 0, 0, 0.6);
    --shadow-2xl: 0 24px 72px rgba(0, 0, 0, 0.7);
    --shadow-glow: 0 0 30px var(--brand-glow);
    --shadow-inner: inset 0 1px 4px rgba(0, 0, 0, 0.4);

    --r-xs: 4px;
    --r-sm: 6px;
    --r-md: 10px;
    --r-lg: 14px;
    --r-xl: 18px;
    --r-2xl: 22px;
    --r-3xl: 30px;
    --r-full: 9999px;

    --s-1: 4px; --s-2: 8px; --s-3: 12px; --s-4: 16px;
    --s-5: 20px; --s-6: 24px; --s-7: 28px; --s-8: 32px;
    --s-10: 40px; --s-12: 48px; --s-14: 56px; --s-16: 64px;
    --s-20: 80px;

    --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
    --ease-in-out: cubic-bezier(0.45, 0, 0.55, 1);
    --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
    --t-fast: 0.12s var(--ease-out);
    --t-normal: 0.2s var(--ease-out);
    --t-smooth: 0.35s var(--ease-out);
    --t-slow: 0.5s var(--ease-out);

    --z-base: 0;
    --z-raised: 10;
    --z-dropdown: 100;
    --z-sticky: 200;
    --z-overlay: 500;
    --z-modal-backdrop: 900;
    --z-modal: 1000;
    --z-popover: 1100;
    --z-toast: 2000;
    --z-max: 9999;
}

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

html {
    width: 100%; height: 100%; height: 100dvh;
    font-size: 15px;
    -webkit-text-size-adjust: 100%;
}

body {
    width: 100%; height: 100%; height: 100dvh;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
    background-color: var(--bg-deepest);
    background-image: url('../assets/backgrounds/default.jpg');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    color: var(--text-300);
    overflow: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    line-height: 1.5;
    text-rendering: optimizeLegibility;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
    letter-spacing: -0.011em;
}

h1 { font-size: 1.875rem; font-weight: 800; letter-spacing: -0.025em; color: var(--text-100); line-height: 1.15; }
h2 { font-size: 1.375rem; font-weight: 700; letter-spacing: -0.02em; color: var(--text-100); line-height: 1.2; }
h3 { font-size: 1.125rem; font-weight: 600; letter-spacing: -0.01em; color: var(--text-100); line-height: 1.3; }
h4 { font-size: 0.9375rem; font-weight: 600; color: var(--text-200); }
h5 { font-size: 0.8125rem; font-weight: 600; color: var(--text-500); text-transform: uppercase; letter-spacing: 0.06em; }

p { line-height: 1.6; color: var(--text-400); }

a { color: var(--accent-sky); text-decoration: none; transition: color var(--t-fast); }
a:hover { color: var(--brand-light); text-decoration: underline; }

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

::-webkit-scrollbar { width: 5px; height: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(139, 92, 246, 0.15); border-radius: 6px; }
::-webkit-scrollbar-thumb:hover { background: rgba(139, 92, 246, 0.3); }
::-webkit-scrollbar-corner { background: transparent; }
* { scrollbar-width: thin; scrollbar-color: rgba(139, 92, 246, 0.15) transparent; }

input, textarea, select {
    background: rgba(9, 9, 15, 0.8);
    border: 1.5px solid var(--border-subtle);
    border-radius: var(--r-md);
    color: var(--text-200);
    padding: 11px 15px;
    font-family: inherit;
    font-size: 0.875rem;
    transition: all 0.25s var(--ease-out);
    width: 100%; outline: none;
    -webkit-appearance: none; appearance: none;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

input:hover, textarea:hover, select:hover { border-color: var(--border-muted); background: rgba(14, 14, 24, 0.9); }
input:focus, textarea:focus, select:focus {
    border-color: var(--brand);
    box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.15), 0 0 20px rgba(139, 92, 246, 0.06);
    background: rgba(14, 14, 24, 0.95);
}
input::placeholder, textarea::placeholder { color: var(--text-600); }
textarea { resize: vertical; min-height: 80px; line-height: 1.5; }

select {
    cursor: pointer;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='20' viewBox='0 0 24 24' fill='none' stroke='%2364748B' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    background-size: 16px;
    padding-right: 40px;
}

button {
    cursor: pointer; border: none;
    font-family: inherit; font-size: 0.875rem; font-weight: 500;
    transition: all var(--t-normal);
    border-radius: var(--r-md);
    background: transparent; outline: none;
    -webkit-tap-highlight-color: transparent;
}

.btn {
    padding: 9px 18px;
    display: inline-flex; align-items: center; justify-content: center;
    gap: 8px; font-weight: 600; font-size: 0.8125rem;
    position: relative; overflow: hidden; white-space: nowrap;
    border-radius: var(--r-md); letter-spacing: 0;
}
.btn:active { transform: scale(0.97); }

.btn-primary {
    background: linear-gradient(135deg, var(--brand) 0%, #7C3AED 100%);
    color: white;
    box-shadow: 0 2px 16px rgba(139, 92, 246, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(139, 92, 246, 0.3);
}
.btn-primary:hover {
    background: linear-gradient(135deg, var(--brand-hover) 0%, var(--brand) 100%);
    box-shadow: 0 6px 28px rgba(139, 92, 246, 0.45), inset 0 1px 0 rgba(255, 255, 255, 0.15);
    transform: translateY(-2px);
}
.btn-primary:active { transform: translateY(0); box-shadow: 0 2px 8px rgba(139, 92, 246, 0.3); }

.btn-secondary {
    background: rgba(30, 30, 48, 0.6);
    color: var(--text-300);
    border: 1px solid var(--border-subtle);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}
.btn-secondary:hover { background: rgba(40, 40, 64, 0.8); border-color: var(--border-muted); }

.btn-danger {
    background: linear-gradient(135deg, var(--danger), #DC2626); color: white;
    box-shadow: 0 2px 12px rgba(248, 113, 113, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(248, 113, 113, 0.3);
}
.btn-danger:hover { background: linear-gradient(135deg, #EF4444, #B91C1C); transform: translateY(-2px); box-shadow: 0 6px 24px rgba(248, 113, 113, 0.4); }
.btn-danger:active { transform: translateY(0); }

.btn-success { background: var(--success); color: white; }
.btn-success:hover { background: #16A34A; }

.btn-ghost { background: transparent; color: var(--text-400); padding: 8px 14px; }
.btn-ghost:hover { background: var(--bg-hover); color: var(--text-200); }

.btn-outline { background: transparent; color: var(--brand-light); border: 1.5px solid var(--brand); }
.btn-outline:hover { background: var(--brand-subtle); }

.btn-icon {
    width: 34px; height: 34px; padding: 0;
    border-radius: var(--r-md);
    background: transparent; color: var(--text-500); font-size: 0.9375rem;
    display: inline-flex; align-items: center; justify-content: center;
}
.btn-icon:hover { background: var(--bg-hover); color: var(--text-200); }
.btn-icon.active { background: var(--brand-subtle); color: var(--brand-light); }

.btn-sm { padding: 5px 12px; font-size: 0.75rem; border-radius: var(--r-sm); }
.btn-lg { padding: 12px 24px; font-size: 0.9375rem; }
.btn-xl { padding: 14px 32px; font-size: 1rem; border-radius: var(--r-lg); }

.form-group { margin-bottom: var(--s-5); }
.form-group label {
    display: block; margin-bottom: 6px;
    font-weight: 600; font-size: 0.6875rem; color: var(--text-400);
    text-transform: uppercase; letter-spacing: 0.08em;
}

.avatar {
    display: inline-flex; align-items: center; justify-content: center;
    border-radius: var(--r-full);
    overflow: hidden; font-weight: 700; flex-shrink: 0;
    background: linear-gradient(135deg, var(--brand), var(--accent-sky));
    color: white; position: relative; user-select: none;
}
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.avatar-xs { width: 22px; height: 22px; font-size: 0.55rem; }
.avatar-sm { width: 32px; height: 32px; font-size: 0.7rem; }
.avatar-md { width: 40px; height: 40px; font-size: 0.85rem; }
.avatar-lg { width: 56px; height: 56px; font-size: 1.15rem; }
.avatar-xl { width: 80px; height: 80px; font-size: 1.5rem; }
.avatar-xxl { width: 120px; height: 120px; font-size: 2.2rem; }

.status-indicator {
    position: absolute; width: 12px; height: 12px;
    border-radius: var(--r-full);
    border: 2.5px solid var(--bg-raised);
    bottom: -1px; right: -1px;
}
.status-online { background-color: var(--online); }
.status-idle { background-color: var(--idle); }
.status-dnd { background-color: var(--dnd); }
.status-offline { background-color: var(--offline); }
.status-streaming { background-color: var(--streaming); }

.badge {
    display: inline-flex; align-items: center; gap: 4px;
    padding: 2px 8px; border-radius: var(--r-full);
    font-size: 0.625rem; font-weight: 700;
    text-transform: uppercase; letter-spacing: 0.04em; line-height: 1.4;
}
.badge-admin { background: var(--danger-bg); color: var(--danger); }
.badge-mod { background: var(--info-bg); color: var(--info); }
.badge-premium { background: rgba(251, 191, 36, 0.1); color: var(--accent-gold); }
.badge-bot { background: var(--info-bg); color: var(--info); }
.badge-streaming { background: rgba(168, 85, 247, 0.12); color: var(--streaming); }
.badge-online { background: var(--success-bg); color: var(--success); }
.badge-new { background: rgba(251, 113, 133, 0.12); color: var(--accent-rose); }

.notification-badge {
    position: absolute; top: -3px; right: -3px;
    background: var(--danger); color: white;
    font-size: 0.625rem; font-weight: 800;
    min-width: 16px; height: 16px; border-radius: 8px;
    display: flex; align-items: center; justify-content: center;
    padding: 0 4px; border: 2px solid var(--bg-raised); line-height: 1;
}

.modal {
    position: fixed; inset: 0;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(16px) saturate(1.2);
    -webkit-backdrop-filter: blur(16px) saturate(1.2);
    display: none; align-items: center; justify-content: center;
    z-index: var(--z-modal-backdrop);
    animation: fadeIn 0.15s var(--ease-out);
}
.modal.visible { display: flex; }

.modal-content {
    background: rgba(20, 20, 32, 0.92);
    border: 1px solid rgba(139, 92, 246, 0.1);
    border-radius: var(--r-2xl);
    min-width: 440px; max-width: 90vw; max-height: 85vh; max-height: 85dvh;
    overflow-y: auto;
    box-shadow: 0 24px 80px rgba(0, 0, 0, 0.6), 0 0 1px rgba(255, 255, 255, 0.05), 0 0 40px rgba(139, 92, 246, 0.06);
    animation: modalSlideIn 0.3s var(--ease-spring);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
}

.modal-header {
    display: flex; align-items: center; justify-content: space-between;
    padding: var(--s-5) var(--s-6);
    border-bottom: 1px solid var(--border-faint);
}
.modal-header h2 { margin: 0; font-size: 1.125rem; }

.modal-close {
    width: 30px; height: 30px;
    background: transparent; border: none; color: var(--text-500);
    font-size: 0.8rem; cursor: pointer; border-radius: var(--r-md);
    display: flex; align-items: center; justify-content: center;
    transition: all var(--t-fast);
}
.modal-close:hover { background: var(--danger-bg); color: var(--danger); }

.modal-body { padding: var(--s-5) var(--s-6); }
.modal-footer {
    display: flex; gap: 10px; justify-content: flex-end;
    padding: var(--s-4) var(--s-6);
    border-top: 1px solid var(--border-faint);
}

.divider { height: 1px; background: var(--border-faint); margin: var(--s-4) 0; }

[data-tooltip] { position: relative; }
[data-tooltip]::after {
    content: attr(data-tooltip);
    position: absolute; bottom: calc(100% + 8px); left: 50%;
    transform: translateX(-50%) scale(0.92);
    background: var(--bg-deepest); color: var(--text-200);
    padding: 5px 10px; border-radius: var(--r-sm);
    font-size: 0.75rem; font-weight: 500; white-space: nowrap;
    pointer-events: none; opacity: 0;
    transition: all var(--t-fast);
    box-shadow: var(--shadow-lg); z-index: var(--z-popover);
    border: 1px solid var(--border-subtle);
}
[data-tooltip]:hover::after { opacity: 1; transform: translateX(-50%) scale(1); }
[data-tooltip-right]::after {
    content: attr(data-tooltip-right);
    bottom: auto; left: calc(100% + 10px); top: 50%; transform: translateY(-50%) scale(0.92);
}
[data-tooltip-right]:hover::after { transform: translateY(-50%) scale(1); }

.hidden { display: none !important; }
.visible { display: flex !important; }
.flex { display: flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.justify-center { justify-content: center; }
.gap-1 { gap: var(--s-1); }
.gap-2 { gap: var(--s-2); }
.gap-3 { gap: var(--s-3); }
.gap-4 { gap: var(--s-4); }
.mt-2 { margin-top: var(--s-2); }
.mt-4 { margin-top: var(--s-4); }
.mb-2 { margin-bottom: var(--s-2); }
.mb-4 { margin-bottom: var(--s-4); }
.text-center { text-align: center; }
.text-muted { color: var(--text-600); }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.w-full { width: 100%; }

@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes fadeOut { from { opacity: 1; } to { opacity: 0; } }
@keyframes modalSlideIn { from { transform: scale(0.95) translateY(8px); opacity: 0; } to { transform: scale(1) translateY(0); opacity: 1; } }
@keyframes slideInUp { from { transform: translateY(10px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }
@keyframes slideInDown { from { transform: translateY(-10px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }
@keyframes slideInRight { from { transform: translateX(16px); opacity: 0; } to { transform: translateX(0); opacity: 1; } }
@keyframes slideInLeft { from { transform: translateX(-16px); opacity: 0; } to { transform: translateX(0); opacity: 1; } }
@keyframes pulse-glow { 0%, 100% { opacity: 1; } 50% { opacity: 0.5; } }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes shimmer { 0% { background-position: -200% 0; } 100% { background-position: 200% 0; } }
@keyframes float { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-6px); } }
@keyframes typing-dot { 0%, 100% { opacity: 0.3; transform: translateY(0); } 50% { opacity: 1; transform: translateY(-3px); } }
@keyframes gradientShift { 0% { background-position: 0% 50%; } 50% { background-position: 100% 50%; } 100% { background-position: 0% 50%; } }
@keyframes borderGlow { 0%, 100% { border-color: var(--brand); box-shadow: 0 0 12px var(--brand-glow); } 50% { border-color: var(--accent-sky); box-shadow: 0 0 12px rgba(56,189,248,0.2); } }

.animate-fade-in { animation: fadeIn 0.3s var(--ease-out); }
.animate-slide-in-up { animation: slideInUp 0.3s var(--ease-out); }

.loading-spinner {
    width: 20px; height: 20px;
    border: 2px solid var(--bg-highlight);
    border-top-color: var(--brand);
    border-radius: var(--r-full);
    animation: spin 0.7s linear infinite;
}
.loading-spinner-lg { width: 40px; height: 40px; border-width: 3px; }

.skeleton {
    background: linear-gradient(90deg, var(--bg-float) 25%, var(--bg-hover) 50%, var(--bg-float) 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
    border-radius: var(--r-sm);
}

.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: var(--s-12) var(--s-6);
    text-align: center;
}
.empty-state-icon {
    width: 72px; height: 72px;
    border-radius: var(--r-xl);
    display: flex; align-items: center; justify-content: center;
    margin-bottom: var(--s-4);
    background: rgba(124, 58, 237, 0.08);
    color: var(--text-500);
    font-size: 1.8rem;
}
.empty-state h3 {
    color: var(--text-200);
    margin-bottom: var(--s-2);
}
.empty-state p {
    color: var(--text-500);
    max-width: 360px;
    line-height: 1.5;
}

.scroll-to-top {
    position: absolute;
    bottom: 80px;
    right: var(--s-4);
    width: 40px; height: 40px;
    border-radius: var(--r-full);
    background: var(--bg-raised);
    border: 1px solid var(--border-subtle);
    color: var(--text-400);
    display: none;
    align-items: center; justify-content: center;
    cursor: pointer;
    box-shadow: var(--shadow-lg);
    z-index: var(--z-raised);
    transition: all var(--t-normal);
    font-size: 0.85rem;
}
.scroll-to-top:hover {
    background: var(--brand);
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(124, 58, 237, 0.3);
}
.scroll-to-top.visible {
    display: flex;
    animation: slideInUp 0.2s var(--ease-spring);
}

.status-selector {
    position: absolute;
    bottom: calc(100% + 8px);
    left: 0;
    width: 220px;
    background: var(--bg-raised);
    border: 1px solid var(--border-subtle);
    border-radius: var(--r-lg);
    box-shadow: var(--shadow-xl);
    z-index: var(--z-popover);
    padding: var(--s-2);
    animation: slideInUp 0.15s var(--ease-spring);
    display: none;
}
.status-selector.visible {
    display: block;
}
.status-selector-item {
    display: flex;
    align-items: center;
    gap: var(--s-2);
    padding: 8px var(--s-3);
    border-radius: var(--r-md);
    cursor: pointer;
    transition: background var(--t-fast);
    font-size: 0.8125rem;
    color: var(--text-300);
}
.status-selector-item:hover {
    background: var(--bg-hover);
}
.status-selector-item .status-dot {
    width: 10px; height: 10px;
    border-radius: var(--r-full);
    flex-shrink: 0;
}

.unread-pill {
    background: var(--brand);
    color: white;
    font-size: 0.6rem;
    font-weight: 800;
    min-width: 18px;
    height: 18px;
    border-radius: 9px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 5px;
    line-height: 1;
    flex-shrink: 0;
}
