:root {
    --primary: #6366f1;
    --primary-hover: #4f46e5;
    --background: #0f172a;
    --surface: #1e293b;
    --surface-light: #334155;
    --text: #f8fafc;
    --text-muted: #94a3b8;
    --border: #334155;
}

body {
    background-color: var(--background) !important;
    color: var(--text) !important;
    font-family: 'Outfit', -apple-system, sans-serif !important;
    overflow-x: hidden;
}

.glass-card {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border-radius: 1.25rem;
}

.btn-primary {
    background: var(--primary) !important;
    border: none !important;
    padding: 0.75rem 1.5rem !important;
    border-radius: 0.75rem !important;
    font-weight: 600 !important;
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1) !important;
}

.btn-primary:hover {
    background: var(--primary-hover) !important;
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(99, 102, 241, 0.2);
}

.form-control, .form-select {
    background-color: #0f172a !important;
    border: 1px solid var(--border) !important;
    color: white !important;
    padding: 0.8rem 1rem !important;
    border-radius: 0.75rem !important;
}

/* SIDEBAR & NAVIGATION */
.sidebar {
    width: 260px;
    height: 100vh;
    background: #0b0f19;
    border-right: 1px solid rgba(255,255,255,0.05);
    padding: 2rem 1rem;
    position: fixed;
    z-index: 2000;
    transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.brand-area h3 {
    letter-spacing: -1px;
    background: linear-gradient(to right, var(--primary), #a855f7);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    filter: drop-shadow(0 0 5px rgba(99, 102, 241, 0.3));
}

.nav-link {
    font-size: 0.95rem;
    font-weight: 500;
    color: var(--text-muted);
    padding: 0.8rem 1rem !important;
    border-radius: 0.75rem !important;
    margin-bottom: 0.25rem;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 12px;
}

.nav-link i { font-size: 1.1rem; width: 24px; text-align: center; }

.nav-link:hover {
    background: rgba(255,255,255,0.03) !important;
    color: var(--text) !important;
}

.nav-link.active {
    background: linear-gradient(90deg, rgba(99, 102, 241, 0.1), transparent) !important;
    border-right: 3px solid var(--primary) !important;
    border-radius: 0.75rem 0 0 0.75rem !important;
    color: var(--primary) !important;
}

.main-view {
    margin-left: 260px;
    padding: 2rem 3rem;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* MOBILE RESPONSIVE SIDEBAR */
@media (max-width: 991.98px) {
    .sidebar { transform: translateX(-100%); width: 280px; }
    .sidebar.show-mobile { transform: translateX(0); box-shadow: 20px 0 50px rgba(0,0,0,0.5); }
    .main-view { margin-left: 0; padding: 6rem 1rem 2rem 1rem !important; }
}

.mobile-nav {
    backdrop-filter: blur(15px);
    background: rgba(10, 15, 25, 0.8) !important;
}

/* CHAT COMPONENTS */
.chat-container {
    height: calc(100vh - 250px);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    background: rgba(15, 23, 42, 0.6);
    border-radius: 2rem;
    box-shadow: 0 20px 50px rgba(0,0,0,0.3);
}

.message-user, .message-ai { max-width: 80%; }
.text-bubble {
    position: relative;
    padding: 1.25rem 1.5rem !important;
}

.btn-copy-msg {
    position: absolute;
    bottom: -35px;
    right: 0;
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-size: 0.8rem;
    opacity: 0;
    transition: 0.3s;
}

.message-ai:hover .btn-copy-msg { opacity: 1; bottom: 5px; right: 10px; }

/* BADGES & STATS */
.badge-credits {
    background: linear-gradient(135deg, var(--primary), #a855f7);
    color: white;
    padding: 0.5rem 1.2rem;
    border-radius: 2rem;
    font-weight: 700;
    box-shadow: 0 5px 15px rgba(99, 102, 241, 0.3);
}

.stat-card {
    background: rgba(255,255,255,0.03);
    padding: 1.5rem;
    border-radius: 1.5rem;
    border: 1px solid rgba(255,255,255,0.05);
}

/* ANIMATIONS */
.loader {
    width: 24px; height: 24px; border: 3px solid #FFF; border-bottom-color: transparent;
    border-radius: 50%; display: inline-block; animation: rotation 1s linear infinite;
}

@keyframes rotation { 0% { transform: rotate(0deg); } 100% { transform: rotate(360deg); } }

.typing-indicator { display: flex; align-items: center; gap: 4px; height: 1.5rem; }
.typing-indicator span { 
    width: 8px; height: 8px; background: var(--primary); border-radius: 50%; 
    display: block; opacity: 0.4; animation: pulse 1s infinite; 
}
.typing-indicator span:nth-child(2) { animation-delay: 0.2s; }
.typing-indicator span:nth-child(3) { animation-delay: 0.4s; }

@keyframes pulse {
    0%, 100% { transform: scale(1); opacity: 0.4; }
    50% { transform: scale(1.2); opacity: 1; }
}
