@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600;700;800&family=Plus+Jakarta+Sans:wght@300;400;500;600;700&display=swap');

:root {
    --bg-deep: #030014;
    --bg-card: rgba(17, 25, 40, 0.75);
    --primary: #00f0ff;
    --primary-dim: rgba(0, 240, 255, 0.1);
    --secondary: #7000ff;
    --accent: #ff0055;
    --text-main: #ffffff;
    --text-muted: #94a3b8;
    --glass-border: rgba(255, 255, 255, 0.08);
    --glass-highlight: rgba(255, 255, 255, 0.15);

    --font-heading: 'Outfit', sans-serif;
    --font-body: 'Plus Jakarta Sans', sans-serif;
}

/* --- Base Reset & Typography --- */
body {
    background-color: var(--bg-deep);
    color: var(--text-main);
    font-family: var(--font-body);
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    scroll-behavior: smooth;
    background-image:
        radial-gradient(circle at 15% 50%, rgba(112, 0, 255, 0.15), transparent 25%),
        radial-gradient(circle at 85% 30%, rgba(0, 240, 255, 0.15), transparent 25%);
    background-attachment: fixed;
}

h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-heading);
}

/* --- Utilities --- */
.font-heading { font-family: var(--font-heading); }
.font-body { font-family: var(--font-body); }

/* Text Gradients */
.text-gradient {
    background: linear-gradient(135deg, #fff 0%, #b4b4b4 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.text-gradient-primary {
    background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Glassmorphism */
.glass-panel {
    background: var(--bg-card);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--glass-border);
    box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.3);
}

.glass-pill {
    background: rgba(10, 10, 30, 0.6);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 9999px;
}

/* --- Animations --- */
@keyframes float {
    0%, 100% { transform: translateY(0px); }
    50% { transform: translateY(-15px); }
}

@keyframes float-slow {
    0%, 100% { transform: translateY(0px) rotate(0deg); }
    50% { transform: translateY(-20px) rotate(2deg); }
}

@keyframes pulse-glow {
    0%, 100% { box-shadow: 0 0 15px var(--primary-dim); }
    50% { box-shadow: 0 0 25px rgba(0, 240, 255, 0.3); }
}

@keyframes fadeInBlur {
    0% { opacity: 0; filter: blur(10px); transform: translateY(20px); }
    100% { opacity: 1; filter: blur(0); transform: translateY(0); }
}

@keyframes aurora {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

.animate-float { animation: float 6s ease-in-out infinite; }
.animate-float-slow { animation: float-slow 8s ease-in-out infinite; }
.animate-fade-in { animation: fadeInBlur 0.8s ease-out forwards; }

/* Interactive Elements */
.hover-glow:hover {
    box-shadow: 0 0 20px var(--primary-dim);
    border-color: var(--primary);
}

.card-hover {
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}
.card-hover:hover {
    transform: translateY(-5px) scale(1.02);
    box-shadow: 0 20px 40px -10px rgba(0,0,0,0.5);
    border-color: var(--glass-highlight);
}

/* --- Buttons --- */
.btn-primary {
    background: linear-gradient(90deg, var(--primary), #00c3ff);
    color: #000;
    font-weight: 600;
    font-family: var(--font-heading);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    z-index: 1;
}

.btn-primary::before {
    content: '';
    position: absolute;
    top: 0; left: 0; width: 100%; height: 100%;
    background: linear-gradient(90deg, #00c3ff, var(--primary));
    z-index: -1;
    transition: opacity 0.3s ease;
    opacity: 0;
}

.btn-primary:hover::before { opacity: 1; }
.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 0 30px rgba(0, 240, 255, 0.4);
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--glass-border);
    color: var(--text-main);
    font-family: var(--font-heading);
    transition: all 0.3s ease;
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: var(--text-main);
}

/* --- Chat Interface (HUD Style) --- */
.chat-container {
    background: rgba(5, 5, 10, 0.8);
    backdrop-filter: blur(20px);
    border: 1px solid var(--glass-border);
    border-radius: 24px;
    box-shadow:
        0 0 0 1px rgba(255, 255, 255, 0.05),
        0 20px 50px rgba(0, 0, 0, 0.5);
}

.message {
    max-width: 85%;
    padding: 12px 18px;
    border-radius: 18px;
    font-size: 0.95rem;
    line-height: 1.5;
    margin-bottom: 12px;
    position: relative;
    animation: messageSlideIn 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.bot-message {
    background: rgba(255, 255, 255, 0.08);
    color: var(--text-main);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-bottom-left-radius: 4px;
    align-self: flex-start;
    margin-right: auto;
}

.message pre {
    background: #0d1117;
    padding: 10px;
    border-radius: 8px;
    overflow-x: auto;
    color: #e6edf3;
    font-size: 0.85rem;
    margin-top: 0.5rem;
    margin-bottom: 0.5rem;
}

.message code {
    font-family: 'Menlo', 'Monaco', 'Courier New', monospace;
}

.message p {
    margin-bottom: 0.75rem;
}

.message p:last-child {
    margin-bottom: 0;
}

/* Markdown elements styling inside messages */
.message ul {
    list-style-type: disc;
    margin-left: 1.5rem;
    margin-bottom: 1rem;
    margin-top: 0.5rem;
}

.message ol {
    list-style-type: decimal;
    margin-left: 1.5rem;
    margin-bottom: 1rem;
    margin-top: 0.5rem;
}

.message li {
    margin-bottom: 0.5rem;
    padding-left: 0.25rem;
}

.message li:last-child {
    margin-bottom: 0;
}

.message h1, .message h2, .message h3, .message h4, .message h5, .message h6 {
    font-weight: 700;
    margin-top: 1.25rem;
    margin-bottom: 0.75rem;
    line-height: 1.3;
}

.message a {
    color: var(--primary);
    text-decoration: underline;
    text-underline-offset: 2px;
}

.message strong, .message b {
    font-weight: 700;
    color: inherit;
}

.message em {
    font-style: italic;
}

.user-message {
    background: linear-gradient(135deg, var(--secondary), #5000cc);
    color: white;
    border-bottom-right-radius: 4px;
    align-self: flex-end;
    margin-left: auto;
    box-shadow: 0 4px 15px rgba(112, 0, 255, 0.3);
}

.loading {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 12px 16px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 18px;
    border-bottom-left-radius: 4px;
    width: fit-content;
    margin-bottom: 12px;
}

.dot {
    width: 6px;
    height: 6px;
    background: var(--text-muted);
    border-radius: 50%;
    animation: typingBounce 1.4s infinite ease-in-out both;
}

.dot:nth-child(1) { animation-delay: -0.32s; }
.dot:nth-child(2) { animation-delay: -0.16s; }

@keyframes typingBounce {
    0%, 80%, 100% { transform: scale(0); opacity: 0.5; }
    40% { transform: scale(1); opacity: 1; }
}

@keyframes messageSlideIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 8px;
}
::-webkit-scrollbar-track {
    background: var(--bg-deep);
}
::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.2);
}

/* --- Mobile Specifics --- */
@media (max-width: 768px) {
    .snap-x-mandatory {
        scroll-snap-type: x mandatory;
    }
    .snap-center {
        scroll-snap-align: center;
    }
    /* Hide scrollbar for clean carousel */
    .hide-scrollbar::-webkit-scrollbar {
        display: none;
    }
    .hide-scrollbar {
        -ms-overflow-style: none;
        scrollbar-width: none;
    }
}
