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

/* --------------------------------------------------
   RESET + GLOBAL SETTINGS
-------------------------------------------------- */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    transition: all 0.2s ease;
}

html, body {
    width: 100%;
    height: 100%;
    font-family: 'Inter', sans-serif;
}

/* --------------------------------------------------
   DESIGN TOKENS (CSS VARIABLES)
-------------------------------------------------- */
:root {
    --bg: #050507;
    --text: #e2e8f0;

    --panel: rgba(15, 17, 26, 0.6);
    --panel-heavy: rgba(10, 11, 16, 0.85);

    --cyan: #06b6d4;
    --blue: #3b82f6;
    --magenta: #d946ef;
    --purple: #8b5cf6;

    --scroll-thumb: #1f2433;

    --ease-out: cubic-bezier(0.16, 1, 0.3, 1);

    --z-base: 1;
    --z-panel: 10;
    --z-overlay: 100;
    --z-modal: 1000;
}

/* --------------------------------------------------
   BODY + BACKGROUND
-------------------------------------------------- */
body {
    background-color: var(--bg);
    color: var(--text);
    overflow: hidden;
    background-image: 
        radial-gradient(circle at 15% 50%, rgba(6, 182, 212, 0.03), transparent 25%),
        radial-gradient(circle at 85% 30%, rgba(217, 70, 239, 0.03), transparent 25%);
}

/* --------------------------------------------------
   SCROLLBAR
-------------------------------------------------- */
::-webkit-scrollbar { width: 4px; height: 4px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--scroll-thumb); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: var(--cyan); }

/* --------------------------------------------------
   GLASS PANELS
-------------------------------------------------- */
.glass-panel {
    background: var(--panel);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid rgba(255, 255, 255, 0.03);
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.5);
    z-index: var(--z-panel);
}

.glass-panel-heavy {
    background: var(--panel-heavy);
    backdrop-filter: blur(24px);
    border: 1px solid rgba(255, 255, 255, 0.05);
    box-shadow: inset 0 1px 0 0 rgba(255,255,255,0.05);
    z-index: var(--z-panel);
}

/* --------------------------------------------------
   TEXT GRADIENTS
-------------------------------------------------- */
.text-gradient-cyan {
    background: linear-gradient(to right, var(--cyan), var(--blue));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.text-gradient-magenta {
    background: linear-gradient(to right, var(--magenta), var(--purple));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

/* --------------------------------------------------
   PAGE TRANSITIONS
-------------------------------------------------- */
.page-content {
    display: none;
    opacity: 0;
    transform: translateY(15px);
    transition: opacity 0.3s var(--ease-out), transform 0.3s var(--ease-out);
}

.page-content.active {
    display: block;
    opacity: 1;
    transform: translateY(0);
    animation: quantumFade 0.5s var(--ease-out) forwards;
}

@keyframes quantumFade {
    0% { opacity: 0; transform: translateY(20px) scale(0.98); filter: blur(4px); }
    100% { opacity: 1; transform: translateY(0) scale(1); filter: blur(0); }
}

/* --------------------------------------------------
   CODE BLOCKS
-------------------------------------------------- */
.code-block {
    background: #09090b;
    border: 1px solid var(--scroll-thumb);
    border-radius: 8px;
    font-family: 'JetBrains Mono', monospace;
    padding: 12px;
    font-size: 12px;
    overflow-x: auto;
    position: relative;
}

.code-block::before {
    content: 'solidity';
    position: absolute;
    top: 0; right: 0;
    background: var(--scroll-thumb);
    color: var(--purple);
    font-size: 9px;
    padding: 2px 6px;
    border-bottom-left-radius: 4px;
    text-transform: uppercase;
}

/* --------------------------------------------------
   AI THINKING DOTS
-------------------------------------------------- */
.ai-thinking {
    display: inline-flex;
    gap: 4px;
    align-items: center;
    height: 20px;
}

.ai-dot {
    width: 6px;
    height: 6px;
    background-color: var(--cyan);
    border-radius: 50%;
    animation: aiPulse 1.5s infinite ease-in-out;
}

.ai-dot:nth-child(2) { animation-delay: 0.2s; background-color: var(--purple); }
.ai-dot:nth-child(3) { animation-delay: 0.4s; background-color: var(--magenta); }

@keyframes aiPulse {
    0%, 100% { transform: scale(0.5); opacity: 0.3; }
    50% { transform: scale(1.2); opacity: 1; box-shadow: 0 0 10px currentColor; }
}

/* --------------------------------------------------
   LIVE INDICATOR
-------------------------------------------------- */
.live-indicator {
    position: relative;
    width: 8px;
    height: 8px;
    background: #10b981;
    border-radius: 50%;
}

.live-indicator::after {
    content: '';
    position: absolute;
    inset: -4px;
    border-radius: 50%;
    border: 1px solid #10b981;
    animation: ping 2s cubic-bezier(0, 0, 0.2, 1) infinite;
}

/* --------------------------------------------------
   BACKGROUND GRID
-------------------------------------------------- */
.bg-grid {
    background-image: 
        linear-gradient(rgba(255,255,255,0.03) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255,255,255,0.03) 1px, transparent 1px);
    background-size: 20px 20px;
}

/* --------------------------------------------------
   HOVER STATES (universal)
-------------------------------------------------- */
button:hover {
    transform: translateY(-2px);
}

/* --------------------------------------------------
   ANIMATION UTILITIES
-------------------------------------------------- */
.pause-spin {
    animation-play-state: paused !important;
}

/* --------------------------------------------------
   RESPONSIVE
-------------------------------------------------- */
@media (max-width: 768px) {
    .glass-panel, .glass-panel-heavy {
        padding: 12px;
    }
}

/* --------------------------------------------------
   3D FLIP UTILITIES
-------------------------------------------------- */
.perspective-1000 { perspective: 1000px; }
.preserve-3d { transform-style: preserve-3d; }
.backface-hidden { backface-visibility: hidden; }
.rotate-y-180 { transform: rotateY(180deg); }

/* --------------------------------------------------
   MOBILE SIDEBAR EXPAND
-------------------------------------------------- */
@media (max-width: 1023px) {
    #main-sidebar.mobile-expanded {
        position: absolute;
        width: 16rem !important; /* w-64 */
        z-index: 50;
        height: 100%;
        box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
    }
    #main-sidebar.mobile-expanded + main {
        margin-left: 5rem; /* w-20 */
    }
    #main-sidebar.mobile-expanded .profile-container {
        justify-content: flex-start;
    }
}

