:root {
    --bg-deep: #050507;
    --bg-panel: rgba(20, 20, 25, 0.6);
    --accent: #a855f7;
    --accent-glow: rgba(168, 85, 247, 0.4);
    --text-primary: #f1f5f9;
    --text-secondary: #94a3b8;
    --border-light: rgba(255, 255, 255, 0.08);
    --glass: blur(12px);
    --font-main: 'Plus Jakarta Sans', sans-serif;
}

body {
    background-color: var(--bg-deep);
    color: var(--text-primary);
    font-family: var(--font-main);
    height: 100dvh;
    margin: 0;
    display: flex;
    overflow: hidden;
}

/* --- Sidebar (Kept for tools, hidden on Landing) --- */
#sidebar {
    width: 280px;
    background: rgba(0, 0, 0, 0.2);
    border-right: 1px solid var(--border-light);
    display: none;
    flex-direction: column;
    padding: 1.5rem;
    backdrop-filter: blur(20px);
    z-index: 20;
}

@media (min-width: 1024px) {
    body:not(.landing-page) #sidebar { display: flex; }
}

/* --- Shared Elements --- */
.brand { display: flex; align-items: center; gap: 12px; margin-bottom: 3rem; }
.logo-box { width: 40px; height: 40px; background: var(--accent); border-radius: 12px; display: flex; align-items: center; justify-content: center; box-shadow: 0 0 15px var(--accent-glow); color: white; }
.brand-text { font-weight: 800; font-size: 1.25rem; letter-spacing: -0.5px; }
.text-accent { color: var(--accent); }
.nav-label { font-size: 0.75rem; font-weight: 700; color: var(--text-secondary); text-transform: uppercase; letter-spacing: 1px; margin-bottom: 0.5rem; }
.nav-item { width: 100%; text-align: left; background: transparent; border: none; color: var(--text-secondary); padding: 12px 16px; border-radius: 12px; cursor: pointer; transition: all 0.2s; font-family: inherit; font-size: 0.9rem; font-weight: 500; display: flex; align-items: center; gap: 10px; text-decoration: none; }
.nav-item:hover, .nav-item.active { background: rgba(255, 255, 255, 0.05); color: white; }
.nav-item.active i { color: var(--accent); }

/* --- Landing Page Specifics --- */
.landing-container { width: 100%; height: 100%; display: flex; flex-direction: column; align-items: center; justify-content: center; overflow-y: auto; padding: 2rem; }
.landing-header { text-align: center; margin-bottom: 4rem; }
.landing-header h1 { font-size: 3.5rem; margin-bottom: 1rem; }
.landing-header p { color: var(--text-secondary); font-size: 1.2rem; }

.tools-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 2rem; width: 100%; max-width: 1000px; }
.tool-card { background: var(--bg-panel); border: 1px solid var(--border-light); padding: 2.5rem; border-radius: 24px; text-decoration: none; color: inherit; transition: all 0.3s; display: flex; flex-direction: column; align-items: center; text-align: center; backdrop-filter: blur(10px); }
.tool-card:hover { transform: translateY(-10px); border-color: var(--accent); box-shadow: 0 10px 40px rgba(0,0,0,0.5); }
.tool-icon { width: 80px; height: 80px; background: rgba(255,255,255,0.03); border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 2rem; color: var(--accent); margin-bottom: 1.5rem; transition: 0.3s; }
.tool-card:hover .tool-icon { background: var(--accent); color: white; box-shadow: 0 0 20px var(--accent-glow); }
.tool-title { font-size: 1.5rem; font-weight: 700; margin-bottom: 0.5rem; }
.tool-desc { color: var(--text-secondary); font-size: 0.9rem; line-height: 1.5; }

/* --- Legal Pages --- */
.legal-page-container { max-width: 800px; margin: 0 auto; padding: 4rem 2rem; overflow-y: auto; height: 100vh; }
.legal-content h1 { color: var(--accent); font-size: 2.5rem; margin-bottom: 2rem; }
.legal-content h2 { margin-top: 2rem; color: white; }
.legal-content p, .legal-content li { color: var(--text-secondary); line-height: 1.7; margin-bottom: 1rem; }
.back-btn { display: inline-flex; align-items: center; gap: 8px; color: white; text-decoration: none; margin-bottom: 2rem; opacity: 0.7; transition: 0.2s; }
.back-btn:hover { opacity: 1; color: var(--accent); }

/* --- Main App Layout (Shared by tools) --- */
.main-container { flex-grow: 1; display: flex; flex-direction: column; position: relative; width: 100%; max-width: 1200px; margin: 0 auto; }
.aura { position: fixed; width: 50vw; height: 50vw; border-radius: 50%; filter: blur(100px); z-index: -1; opacity: 0.15; pointer-events: none; }
.aura.top-left { top: -20%; left: -10%; background: var(--accent); }
.aura.bottom-right { bottom: -20%; right: -10%; background: #4f46e5; }
.app-header { padding: 1rem 1.5rem; display: flex; justify-content: space-between; align-items: center; border-bottom: 1px solid var(--border-light); background: rgba(5, 5, 7, 0.7); backdrop-filter: blur(10px); }
.status-badge { font-size: 0.7rem; font-weight: 800; color: var(--text-secondary); text-transform: uppercase; letter-spacing: 1px; display: flex; align-items: center; gap: 8px; }
.status-dot { width: 6px; height: 6px; background: #22c55e; border-radius: 50%; box-shadow: 0 0 8px #22c55e; }
.icon-btn { background: none; border: none; color: var(--text-secondary); cursor: pointer; padding: 8px; border-radius: 50%; transition: 0.2s; }
.icon-btn:hover { color: white; background: rgba(255,255,255,0.1); }
#chat-stream { flex-grow: 1; overflow-y: auto; padding: 2rem 1.5rem; display: flex; flex-direction: column; gap: 1.5rem; scrollbar-width: thin; scrollbar-color: #333 transparent; }
#welcome-screen { text-align: center; margin-top: 10vh; animation: fadeIn 0.8s ease-out; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(20px); } to { opacity: 1; transform: translateY(0); } }
.hero-icon { width: 80px; height: 80px; background: rgba(168, 85, 247, 0.1); color: var(--accent); border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 2rem; margin: 0 auto 1.5rem; box-shadow: 0 0 30px rgba(168, 85, 247, 0.1); }
#welcome-screen h2 { font-size: 2rem; margin: 0 0 0.5rem; }
#welcome-screen p { color: var(--text-secondary); margin-bottom: 2rem; }
.suggestions { display: flex; justify-content: center; flex-wrap: wrap; gap: 10px; }
.chip { background: rgba(255,255,255,0.03); border: 1px solid var(--border-light); color: var(--text-secondary); padding: 10px 16px; border-radius: 20px; font-size: 0.8rem; cursor: pointer; transition: all 0.2s; display: flex; align-items: center; gap: 8px; }
.chip:hover { background: rgba(255,255,255,0.08); border-color: var(--accent); color: white; transform: translateY(-2px); }
.msg-row { display: flex; width: 100%; margin-bottom: 1rem; }
.msg-row.user { justify-content: flex-end; }
.msg-row.ai { justify-content: flex-start; }
.msg-bubble { max-width: 85%; padding: 14px 20px; font-size: 0.95rem; line-height: 1.6; position: relative; }
.msg-row.user .msg-bubble { background: linear-gradient(135deg, #6366f1 0%, #a855f7 100%); border-radius: 20px 20px 4px 20px; color: white; box-shadow: 0 4px 15px rgba(168, 85, 247, 0.2); }
.msg-row.ai .msg-bubble { background: var(--bg-panel); border: 1px solid var(--border-light); border-radius: 20px 20px 20px 4px; backdrop-filter: blur(10px); }
.ai-image-container { border-radius: 12px; overflow: hidden; margin-top: 10px; border: 1px solid var(--border-light); }
.input-area { padding: 1.5rem; background: linear-gradient(to top, var(--bg-deep) 80%, transparent); }
.input-wrapper { background: rgba(255, 255, 255, 0.03); border: 1px solid var(--border-light); border-radius: 16px; padding: 8px 8px 8px 20px; display: flex; align-items: center; gap: 10px; transition: all 0.3s; box-shadow: 0 4px 20px rgba(0,0,0,0.3); }
.input-wrapper:focus-within { border-color: var(--accent); box-shadow: 0 0 20px var(--accent-glow); background: rgba(0,0,0,0.3); }
#user-input { flex-grow: 1; background: transparent; border: none; color: white; font-size: 1rem; font-family: inherit; padding: 10px 0; }
#user-input:focus { outline: none; }
#send-btn { width: 45px; height: 45px; border-radius: 12px; border: none; background: var(--accent); color: white; cursor: pointer; transition: 0.2s; display: flex; align-items: center; justify-content: center; }
#send-btn:hover { transform: scale(1.05); box-shadow: 0 0 15px var(--accent-glow); }
#send-btn:disabled { opacity: 0.5; cursor: not-allowed; transform: none; filter: grayscale(1); }
.input-footer { text-align: center; font-size: 0.7rem; color: #52525b; margin-top: 10px; }
.ai-bubble.loading { display: flex; align-items: center; gap: 4px; padding: 12px 20px; background: var(--bg-panel); border: 1px solid var(--border-light); border-radius: 20px; width: fit-content; margin-left: 1.5rem; margin-bottom: 1rem; }
.dot { width: 6px; height: 6px; background: var(--accent); border-radius: 50%; animation: bounce 1.4s infinite ease-in-out; }
.dot:nth-child(1) { animation-delay: -0.32s; }
.dot:nth-child(2) { animation-delay: -0.16s; }
@keyframes bounce { 0%, 80%, 100% { transform: scale(0); } 40% { transform: scale(1); } }
.hidden { display: none !important; }

/* Code Blocks */
pre { background: #000 !important; border-radius: 12px; padding: 1rem; overflow-x: auto; border: 1px solid var(--border-light); margin-top: 10px; }