/* ═══════════════════════════════════════════════════════
   Glitrex AI — Design System & Global Styles
   ═══════════════════════════════════════════════════════ */

:root {
    /* ── Palette ─────────────────────────────────────── */
    --bg-primary: #08080d;
    --bg-secondary: #0f0f16;
    --bg-tertiary: #16161f;
    --bg-elevated: #1c1c28;
    --bg-hover: #22222f;

    --surface-1: rgba(255, 255, 255, 0.03);
    --surface-2: rgba(255, 255, 255, 0.06);
    --surface-3: rgba(255, 255, 255, 0.09);

    --text-primary: #e8e8ed;
    --text-secondary: #9898a6;
    --text-tertiary: #6b6b7a;
    --text-inverse: #08080d;

    --accent-purple: #8b5cf6;
    --accent-blue: #6366f1;
    --accent-cyan: #06b6d4;
    --accent-green: #22c55e;
    --accent-red: #ef4444;
    --accent-amber: #f59e0b;

    --gradient-primary: linear-gradient(135deg, #8b5cf6, #6366f1, #06b6d4);
    --gradient-subtle: linear-gradient(135deg, rgba(139, 92, 246, 0.15), rgba(6, 182, 212, 0.15));
    --gradient-glow: linear-gradient(135deg, rgba(139, 92, 246, 0.3), rgba(99, 102, 241, 0.2), rgba(6, 182, 212, 0.3));

    --border-subtle: rgba(255, 255, 255, 0.06);
    --border-medium: rgba(255, 255, 255, 0.1);
    --border-accent: rgba(139, 92, 246, 0.3);

    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.5);
    --shadow-glow: 0 0 30px rgba(139, 92, 246, 0.15);

    /* ── Typography ──────────────────────────────────── */
    --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    --font-mono: 'JetBrains Mono', 'Fira Code', monospace;

    /* ── Sizing ──────────────────────────────────────── */
    --sidebar-width: 300px;
    --header-height: 60px;
    --input-height: 60px;
    --app-height: 100vh;
    --safe-area-bottom: env(safe-area-inset-bottom, 0px);
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 20px;

    /* ── Animation ───────────────────────────────────── */
    --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
    --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
    --duration-fast: 150ms;
    --duration-normal: 250ms;
    --duration-slow: 400ms;
}

/* ── Reset ─────────────────────────────────────────── */
*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    font-size: 16px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    height: 100%;
}

body {
    font-family: var(--font-sans);
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    overflow: hidden;
    min-height: var(--app-height);
    height: var(--app-height);
    width: 100%;
}

input,
textarea,
select,
button {
    font-family: inherit;
    font-size: inherit;
    color: inherit;
    border: none;
    outline: none;
    background: none;
}

button {
    cursor: pointer;
}

a {
    color: var(--accent-cyan);
    text-decoration: none;
}

img {
    max-width: 100%;
    display: block;
}

/* ── Logo tinting ─────────────────────────────────── */
.logo-img {
    border-radius: var(--radius-sm);
    /* Colorize grey logo to match purple accent */
    filter: brightness(0.9) sepia(1) hue-rotate(220deg) saturate(3);
    transition: filter var(--duration-normal) ease;
}

.logo-img:hover {
    filter: brightness(1) sepia(1) hue-rotate(220deg) saturate(3.5);
}

.logo-img--welcome {
    border-radius: var(--radius-md);
    filter: brightness(0.9) sepia(1) hue-rotate(220deg) saturate(3) drop-shadow(0 0 12px rgba(139, 92, 246, 0.4));
}

/* ── Scrollbar ─────────────────────────────────────── */
::-webkit-scrollbar {
    width: 6px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: var(--surface-3);
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.15);
}

/* ── Utilities ─────────────────────────────────────── */
.hidden {
    display: none !important;
}

.icon-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    transition: all var(--duration-fast) ease;
    flex-shrink: 0;
}

.icon-btn:hover {
    background: var(--surface-2);
    color: var(--text-primary);
}

.icon-btn.danger:hover {
    background: rgba(239, 68, 68, 0.15);
    color: var(--accent-red);
}

.icon-btn.small {
    width: 24px;
    height: 24px;
}

/* ── Animations ────────────────────────────────────── */
@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(12px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateX(-12px);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes pulse-glow {

    0%,
    100% {
        box-shadow: 0 0 20px rgba(139, 92, 246, 0.1);
    }

    50% {
        box-shadow: 0 0 30px rgba(139, 92, 246, 0.25);
    }
}

@keyframes shimmer {
    0% {
        background-position: -200% 0;
    }

    100% {
        background-position: 200% 0;
    }
}

@keyframes typing-dot {

    0%,
    80%,
    100% {
        transform: scale(0.6);
        opacity: 0.4;
    }

    40% {
        transform: scale(1);
        opacity: 1;
    }
}

.typing-indicator {
    display: flex;
    gap: 5px;
    padding: 6px 0;
}

.typing-indicator span {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--accent-purple);
    animation: typing-dot 1.4s ease-in-out infinite;
}

.typing-indicator span:nth-child(2) {
    animation-delay: 0.2s;
}

.typing-indicator span:nth-child(3) {
    animation-delay: 0.4s;
}

/* ── Mobile ────────────────────────────────────────── */
.mobile-only {
    display: none;
}

@media (max-width: 768px) {
    .mobile-only {
        display: flex;
    }
}
