:root {
    /* Color Palette */
    --bg-dark: #0a0e17;
    --navy-blue: #111827;
    --cyan: #06b6d4;
    --cyan-glow: rgba(6, 182, 212, 0.4);
    --purple: #8b5cf6;
    --purple-glow: rgba(139, 92, 246, 0.3);
    --emerald: #10b981;
    --red: #ef4444;
    --yellow: #f59e0b;
    
    /* Surface colors */
    --surface: rgba(30, 41, 59, 0.7);
    --surface-hover: rgba(30, 41, 59, 0.9);
    --border: rgba(148, 163, 184, 0.15);
    
    /* Text */
    --text-primary: #f8fafc;
    --text-secondary: #94a3b8;
    
    /* Typography */
    --font-main: 'Inter', sans-serif;
    --font-mono: 'JetBrains Mono', monospace;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    background-color: var(--bg-dark);
    color: var(--text-primary);
    font-family: var(--font-main);
    line-height: 1.5;
    position: relative;
    overflow-x: hidden;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Background Effects */
.glow-bg {
    position: fixed;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle at 50% 30%, var(--purple-glow) 0%, transparent 40%),
                radial-gradient(circle at 20% 70%, var(--cyan-glow) 0%, transparent 30%);
    z-index: -1;
    pointer-events: none;
    animation: drift 20s ease-in-out infinite alternate;
}

@keyframes drift {
    0% { transform: translateY(0) rotate(0deg); }
    100% { transform: translateY(-5%) rotate(2deg); }
}

/* Typography styles */
h1, h2, h3 { font-weight: 700; }
a { text-decoration: none; color: inherit; }

/* Navbar */
.navbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 2rem;
    background: rgba(10, 14, 23, 0.85);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
}

.nav-left, .nav-right, .nav-tools {
    display: flex;
    align-items: center;
    gap: 2rem;
}

.logo {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    position: relative;
}

.logo-icon {
    width: 24px;
    height: 24px;
    background: linear-gradient(135deg, var(--cyan), var(--purple));
    border-radius: 6px;
    box-shadow: 0 0 15px var(--cyan-glow);
}

.logo h1 {
    font-size: 1.4rem;
    letter-spacing: 2px;
    background: linear-gradient(to right, #fff, #94a3b8);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.env-badge {
    background: rgba(139, 92, 246, 0.2);
    color: #c4b5fd;
    border: 1px solid rgba(139, 92, 246, 0.4);
    font-size: 0.65rem;
    padding: 0.15rem 0.4rem;
    border-radius: 4px;
    font-weight: 700;
    letter-spacing: 1px;
    margin-left: 0.5rem;
    transform: translateY(-2px);
}

.nav-links { display: flex; gap: 1.5rem; }
.nav-links a {
    color: var(--text-secondary);
    font-size: 0.9rem;
    font-weight: 500;
    transition: color 0.3s, transform 0.2s;
    display: flex;
    align-items: center;
    gap: 0.4rem;
}
.nav-links a:hover, .nav-links a.active { color: var(--cyan); }
.nav-links a:hover { transform: translateY(-1px); }

/* Ensure Lucide SVGs size well in nav-links */
.nav-links svg {
    width: 18px;
    height: 18px;
    stroke-width: 2.2px;
}

.nav-tools {
    gap: 1rem;
    border-right: 1px solid var(--border);
    padding-right: 1.5rem;
}

.icon-btn-nav {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    transition: color 0.2s, transform 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Ensure Lucide SVGs size well in buttons */
.icon-btn-nav svg {
    width: 20px;
    height: 20px;
    stroke-width: 2px;
}

.icon-btn-nav:hover {
    color: var(--text-primary);
    transform: scale(1.1);
}

.notification-wrapper {
    position: relative;
    display: flex;
}
.ping {
    position: absolute;
    top: 0;
    right: -2px;
    width: 6px;
    height: 6px;
    background: var(--red);
    border-radius: 50%;
    box-shadow: 0 0 8px var(--red);
}

.user-profile {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    cursor: pointer;
    transition: opacity 0.2s;
}
.user-profile:hover { opacity: 0.8; }

.avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: linear-gradient(135deg, #1e293b, #0f172a);
    border: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 0.85rem;
    color: var(--cyan);
}

.user-info {
    display: flex;
    flex-direction: column;
}
.user-name { font-size: 0.85rem; font-weight: 600; color: var(--text-primary); }
.user-role { font-size: 0.7rem; color: var(--text-secondary); }

/* Layout */
.container {
    max-width: 1200px;
    margin: 3rem auto;
    padding: 0 1.5rem;
    flex-grow: 1;
    width: 100%;
}

/* Glass Panels */
.glass-panel {
    background: var(--surface);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.3);
}

/* Input Section */
.input-section { margin-bottom: 3rem; }

.panel-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 0.5rem;
}

.panel-header h2 { font-size: 1.5rem; }

.badge {
    background: rgba(16, 185, 129, 0.1);
    color: var(--emerald);
    padding: 0.25rem 0.75rem;
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 600;
    border: 1px solid rgba(16, 185, 129, 0.3);
}

.subtitle { color: var(--text-secondary); margin-bottom: 1.5rem; font-size: 0.95rem; }

.input-wrapper { display: flex; flex-direction: column; gap: 1rem; }

textarea {
    width: 100%;
    min-height: 180px;
    background: rgba(15, 23, 42, 0.6);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 1rem;
    color: var(--text-primary);
    font-family: var(--font-mono);
    font-size: 0.95rem;
    resize: vertical;
    transition: all 0.3s ease;
}

textarea:focus {
    outline: none;
    border-color: var(--cyan);
    box-shadow: 0 0 0 2px var(--cyan-glow);
}

.input-actions { display: flex; gap: 1rem; }

.btn-primary, .btn-secondary, .btn-icon {
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: 6px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    font-family: var(--font-main);
    font-size: 0.95rem;
}

.btn-primary {
    background: var(--cyan);
    color: #fff;
    box-shadow: 0 0 15px var(--cyan-glow);
}
.btn-primary:hover {
    background: #0891b2;
    transform: translateY(-1px);
    box-shadow: 0 4px 20px rgba(6, 182, 212, 0.6);
}
.btn-primary:active { transform: translateY(1px); }

.btn-secondary {
    background: transparent;
    color: var(--text-secondary);
    border: 1px solid var(--border);
}
.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-primary);
}

/* Error message */
.error-msg {
    margin-top: 1rem;
    padding: 0.75rem 1rem;
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.3);
    color: #fca5a5;
    border-radius: 6px;
    font-size: 0.9rem;
}

/* Spinner */
.spinner {
    width: 18px;
    height: 18px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: #fff;
    animation: spin 1s ease-in-out infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.hidden { display: none !important; }

/* Dashboard Grid Component */
.report-section {
    animation: slideUp 0.5s ease-out;
}

.report-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
}

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

.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1.5rem;
}

.card { transition: transform 0.3s ease, box-shadow 0.3s ease; }
.card:hover { transform: translateY(-3px); box-shadow: 0 12px 40px rgba(0, 0, 0, 0.4); }
.card h3 {
    color: var(--cyan);
    font-size: 1.05rem;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    text-transform: uppercase;
    letter-spacing: 1px;
}
.card.full-width { grid-column: span 2; }
.col-span-2 { grid-column: span 1; }

@media (max-width: 900px) {
    .dashboard-grid { grid-template-columns: 1fr; }
    .card.full-width, .col-span-2 { grid-column: span 1; }
}

.content-text { color: var(--text-primary); font-size: 0.95rem; }
.text-danger { color: #fca5a5; }

/* Custom elements inside cards */
.risk-badge {
    display: inline-block;
    padding: 0.5rem 1.25rem;
    border-radius: 6px;
    font-weight: 700;
    font-size: 1.1rem;
    border: 1px solid transparent;
}

.risk-critical { background: rgba(239, 68, 68, 0.15); color: #f87171; border-color: rgba(239, 68, 68, 0.3); }
.risk-high { background: rgba(245, 158, 11, 0.15); color: #fbbf24; border-color: rgba(245, 158, 11, 0.3); }
.risk-medium { background: rgba(234, 179, 8, 0.15); color: #fde047; border-color: rgba(234, 179, 8, 0.3); }
.risk-low { background: rgba(16, 185, 129, 0.15); color: #34d399; border-color: rgba(16, 185, 129, 0.3); }

.tag-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    list-style: none;
}

.tag-list li {
    background: rgba(139, 92, 246, 0.15);
    border: 1px solid rgba(139, 92, 246, 0.3);
    color: #c4b5fd;
    padding: 0.3rem 0.75rem;
    border-radius: 4px;
    font-size: 0.85rem;
    font-family: var(--font-mono);
}

.step-list {
    list-style: none;
    counter-reset: my-counter;
}
.step-list li {
    position: relative;
    padding-left: 2rem;
    margin-bottom: 0.75rem;
    font-size: 0.95rem;
}
.step-list li::before {
    counter-increment: my-counter;
    content: counter(my-counter) ".";
    position: absolute;
    left: 0;
    color: var(--cyan);
    font-weight: 700;
}

/* Console Block */
.code-block {
    background: #0f172a;
    border-radius: 6px;
    padding: 1rem;
    border: 1px solid #1e293b;
    position: relative;
    overflow-x: auto;
}
code {
    font-family: var(--font-mono);
    color: #a5b4fc;
    font-size: 0.9rem;
    white-space: pre-wrap;
    word-break: break-all;
}

.copy-query-btn {
    position: absolute;
    top: 0.5rem;
    right: 0.5rem;
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-secondary);
    border: none;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-size: 0.75rem;
    cursor: pointer;
}
.copy-query-btn:hover { background: rgba(255, 255, 255, 0.2); color: white; }

/* Footer */
.footer {
    text-align: center;
    padding: 2rem;
    color: var(--text-secondary);
    font-size: 0.85rem;
    border-top: 1px solid var(--border);
    margin-top: auto;
}
