/* ==================== MODERN LIGHT THEME SAAS ==================== */

/* CSS Variables (Light Theme) */
:root {
    --primary: #4f46e5;
    /* Indigo 600 */
    --primary-hover: #4338ca;
    /* Indigo 700 */
    --secondary: #8b5cf6;
    /* Violet 500 */
    --accent: #ec4899;
    /* Pink 500 */

    --bg-body: #f8fafc;
    /* Slate 50 */
    --bg-card: #ffffff;
    /* White */
    --bg-glass: rgba(255, 255, 255, 0.7);

    --text-main: #0f172a;
    /* Slate 900 */
    --text-muted: #64748b;
    /* Slate 500 */
    --text-light: #94a3b8;
    /* Slate 400 */

    --border-light: #e2e8f0;
    /* Slate 200 */
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    --shadow-2xl: 0 25px 50px -12px rgba(0, 0, 0, 0.25);

    --glow: rgba(79, 70, 229, 0.15);
}


* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: 'Inter', sans-serif;
    background-color: var(--bg-body);
    background-image:
        radial-gradient(circle at 15% 50%, rgba(79, 70, 229, 0.05), transparent 25%),
        radial-gradient(circle at 85% 30%, rgba(236, 72, 153, 0.05), transparent 25%);
    min-height: 100vh;
    color: var(--text-main);
    overflow-x: hidden;
    position: relative;
    line-height: 1.5;
}



/* ==================== FLOATING BACKGROUND ==================== */

.floating-background {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: -1;
    overflow: hidden;
}

.floating-item {
    position: absolute;
    opacity: 0.6;
    color: var(--text-light);
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.85rem;
    white-space: nowrap;
    animation: floatUp 20s linear infinite;
    user-select: none;
}

.code-snippet {
    background: rgba(255, 255, 255, 0.5);
    padding: 8px 16px;
    border-radius: 8px;
    border: 1px solid var(--border-light);
    box-shadow: var(--shadow-sm);
}

.shape-circle {
    width: 400px;
    height: 400px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(79, 70, 229, 0.03) 0%, transparent 70%);
    filter: blur(60px);
    animation: pulseGlow 10s ease-in-out infinite;
}

.shape-square {
    width: 300px;
    height: 300px;
    background: linear-gradient(135deg, rgba(236, 72, 153, 0.03), transparent);
    transform: rotate(45deg);
    filter: blur(50px);
    animation: floatUp 25s linear infinite reverse;
}

@keyframes floatUp {
    0% {
        transform: translateY(100vh) rotate(0deg);
        opacity: 0;
    }

    10% {
        opacity: 0.6;
    }

    90% {
        opacity: 0.6;
    }

    100% {
        transform: translateY(-20vh) rotate(5deg);
        opacity: 0;
    }
}

@keyframes pulseGlow {

    0%,
    100% {
        opacity: 0.5;
        transform: scale(1);
    }

    50% {
        opacity: 0.8;
        transform: scale(1.1);
    }
}

/* ==================== TOP NAVIGATION BAR ==================== */

.top-nav {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    padding: 16px 40px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border-light);
    z-index: 1000;
    transition: transform 0.3s ease, opacity 0.3s ease;
    /* Add smooth transition */
    transform: translateY(0);
    /* Default position */
}

/* Hide navigation when scrolling down */
.top-nav.hidden {
    transform: translateY(-100%);
    opacity: 0;
    pointer-events: none;
}

/* Minimized State (Float at right, BELOW chat-header) — was previously
   ``top: 80px; right: 30px`` which sat directly on top of the chat-header
   controls (New chat button, DB connection chip, Validate-SQL toggle,
   dialect picker) and visually hid them.
   New anchor sits BELOW the chat-header (top: 150px) so the header stays
   fully visible. The pill remains discoverable on the right edge as a
   compact 220px-wide chip. ``top`` is explicit so the expanded panel's
   ``top: 0`` baseline can't bleed through. */
.chat-simulator.minimized {
    position: fixed;
    top: 150px;
    bottom: auto;
    right: 30px;
    width: 60px !important;
    height: 60px !important;
    min-width: 0;
    z-index: 9999;
    background: #0d1117;
    border: 1px solid #3b82f6;
    border-radius: 50%;
    /* Small circular badge — shows only "LIVE"; click to re-expand. The
       blue glow pulses to signal it's live; pop-in makes minimize feel smooth. */
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4), 0 0 14px rgba(88, 166, 255, 0.55);
    overflow: hidden;
    cursor: pointer;
    /* Entire circle clickable */
    transition: transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.25s ease;
    animation:
        simPopIn 0.34s cubic-bezier(0.34, 1.56, 0.64, 1),
        simLiveGlow 2.4s ease-in-out 0.34s infinite;
}

/* Lift + brighten on hover so it reads as clickable. */
.chat-simulator.minimized:hover {
    transform: scale(1.1);
    box-shadow: 0 10px 28px rgba(0, 0, 0, 0.45), 0 0 22px rgba(88, 166, 255, 0.9);
}

@keyframes simPopIn {
    0% {
        transform: scale(0.2);
        opacity: 0;
    }

    100% {
        transform: scale(1);
        opacity: 1;
    }
}

@keyframes simLiveGlow {

    0%,
    100% {
        box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4), 0 0 12px rgba(88, 166, 255, 0.45);
    }

    50% {
        box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4), 0 0 26px rgba(88, 166, 255, 0.9);
    }
}

/* Collapse everything except the LIVE badge when minimized. */
.chat-simulator.minimized .simulator-content,
.chat-simulator.minimized .simulator-actions,
.chat-simulator.minimized .resize-handle,
.chat-simulator.minimized .simulator-header h3,
.chat-simulator.minimized .minimize-btn {
    display: none !important;
}

.chat-simulator.minimized .simulator-header {
    border-bottom: none;
    cursor: pointer;
    height: 100%;
    width: 100%;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Center the lone LIVE badge inside the circle. */
.chat-simulator.minimized .simulator-header > div {
    flex: initial !important;
    gap: 0 !important;
    justify-content: center;
}

.chat-simulator.minimized .simulator-badge {
    font-size: 0.62rem;
    font-weight: 800;
    letter-spacing: 0.04em;
    padding: 0;
    white-space: nowrap;
}

.minimize-btn {
    background: transparent;
    border: none;
    color: var(--text-light);
    cursor: pointer;
    padding: 4px;
    border-radius: 4px;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.minimize-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    color: white;
}

/* Show navigation when scrolling up */
.top-nav.visible {
    transform: translateY(0);
    opacity: 1;
}

.nav-brand {
    display: flex;
    align-items: center;
}

.brand-logo-box {
    width: 40px;
    height: 60px;
    background: white;
    border: 1px solid var(--primary);
    border-radius: 8px;
    color: var(--primary);
    font-weight: 900;
    font-size: 1.2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: var(--shadow-sm);
}


.nav-links {
    display: flex;
    align-items: center;
    gap: 32px;
    margin-left: auto;
    /* Change from 0 to auto - pushes links to the right */
    margin-right: 50px;
    /* Add space between nav links and Get Started button */
    justify-content: center;
    flex: 0;
    /* Change from 1 to 0 - stops it from taking all available space */
}

.nav-link {
    color: var(--text-main);
    text-decoration: none;
    font-size: 0.95rem;
    font-weight: 500;
    transition: all 0.2s ease;
}


.nav-link:hover {
    color: var(--primary);
}

.nav-right {
    display: flex;
    align-items: center;
    gap: 16px;
}

.nav-cta {
    padding: 15px 20px;
    font-size: 0.9rem;
}

/* Add this to your styles.css file */

.cta-button {
    text-decoration: none;
    display: inline-block;
    padding: 10px 20px;
    font-size: 0.95rem;
    font-weight: 500;
    transition: all 0.2s ease;
}

.primary-cta {
    color: #000000;
    /* Black color */
    background: transparent;
}

.primary-cta:hover {
    color: var(--primary);
}

.nav-cta {
    padding: 11px 20px;
    font-size: 0.9rem;
}


/* CTA Button Styles */
.cta-button {
    text-decoration: none;
    display: inline-block;
    font-size: 0.9rem;
    font-weight: 500;
    transition: all 0.3s ease;
    border-radius: 6px;
    cursor: pointer;
}

.primary-cta {
    color: #eee9e9;
    background-color: #4441e8;
    border: 1px solid #e0e0e0;
    padding: 8px 20px;
}

.primary-cta:hover {
    background-color: #462ee4;
    border-color: #000000;
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.nav-cta {
    font-size: 0.9rem;
    padding: 10.5px 24px;
}

/* ==================== HERO SECTION ==================== */

.main-container {
    max-width: 1280px;
    padding: 120px 40px 20px 40px;
    /* Very small bottom padding */
    margin: 0 auto;
    position: relative;
    z-index: 1;
}

.hero-section {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 60px;
    margin-bottom: 100px;
}

.hero-content {
    flex: 1;
    max-width: 600px;
}

.hero-heading {
    font-size: 3.2rem;
    font-weight: 800;
    line-height: 1.1;
    margin: 0 0 24px 0;
    letter-spacing: -0.03em;
    color: var(--text-main);
}

.highlight-text {
    color: var(--primary);
}

.hero-description {
    font-size: 1.25rem;
    color: var(--text-muted);
    line-height: 1.6;
    margin-bottom: 40px;
    max-width: 540px;
}

.hero-actions {
    display: flex;
    gap: 16px;
    align-items: center;
}

.hero-visual {
    flex: 1;
    display: flex;
    justify-content: center;
}

/* System Overview Diagram Styles */
.system-overview-card {
    background: #f8fafc;
    border-radius: 16px;
    padding: 30px;
    width: 100%;
    max-width: 600px;
    border: 1px solid var(--border-light);
}

.system-diagram-placeholder {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    position: relative;
    padding: 20px 0;
}

.sd-node {
    background: white;
    border: 1px solid var(--border-light);
    border-radius: 12px;
    padding: 16px;
    text-align: center;
    width: 100px;
    box-shadow: var(--shadow-sm);
    z-index: 2;
    position: relative;
}

.sd-icon {
    font-size: 24px;
    margin-bottom: 8px;
    color: var(--primary);
}

.sd-label {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-main);
    line-height: 1.2;
}

.sd-flow-line {
    position: absolute;
    top: 50%;
    left: 50px;
    right: 50px;
    height: 2px;
    background: var(--border-light);
    z-index: 1;
}

.system-badges {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    justify-content: center;
}

.badge {
    background: white;
    border: 1px solid var(--border-light);
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-main);
    display: flex;
    align-items: center;
    gap: 6px;
}

.badge::before {
    content: '';
    display: block;
    width: 6px;
    height: 6px;
    background: var(--primary);
    border-radius: 50%;
}

/* ==================== HOW IT WORKS SECTION ==================== */

.section-container {
    margin-bottom: 120px;
}

.steps-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 30px;
}

.step-card {
    background: transparent;
    padding: 20px;
}

.step-number {
    background: var(--primary);
    color: white;
    width: 32px;
    height: 32px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.9rem;
    margin-bottom: 16px;
}

.step-title {
    font-size: 1.25rem;
    font-weight: 700;
    margin-bottom: 12px;
    color: var(--text-main);
}

.step-description {
    color: var(--text-muted);
    line-height: 1.6;
    font-size: 0.95rem;
}

/* ==================== REFERENCE ARCHITECTURE SECTION ==================== */

.architecture-layout {
    display: flex;
    gap: 60px;
    align-items: center;
    background: white;
    border: 1px solid var(--border-light);
    border-radius: 24px;
    padding: 60px;
    box-shadow: var(--shadow-sm);
}

.arch-info {
    flex: 1;
    max-width: 400px;
}

.arch-list {
    list-style: none;
    padding: 0;
    margin: 0 0 30px 0;
}

.arch-list li {
    position: relative;
    padding-left: 20px;
    margin-bottom: 12px;
    color: var(--text-main);
    font-weight: 500;
}

.arch-list li::before {
    content: '•';
    color: var(--primary);
    position: absolute;
    left: 0;
    font-weight: bold;
}

.arch-visual {
    flex: 1.5;
    display: flex;
    justify-content: center;
    align-items: center;
}

.arch-image {
    max-width: 100%;
    height: auto;
    border-radius: 12px;
}

@media (max-width: 1024px) {
    .hero-section {
        flex-direction: column;
        text-align: center;
    }

    .hero-content {
        max-width: 100%;
        display: flex;
        flex-direction: column;
        align-items: center;
    }

    .hero-actions {
        justify-content: center;
    }

    .architecture-layout {
        flex-direction: column;
        padding: 40px;
    }

    .arch-info {
        max-width: 100%;
        text-align: center;
    }

    .arch-list li {
        text-align: left;
        display: inline-block;
    }
}

/* ==================== FEATURES SECTION ==================== */

.section-heading {
    font-size: 2.25rem;
    font-weight: 700;
    text-align: center;
    margin-bottom: 60px;
    color: var(--text-main);
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 30px;
}

.feature-box {
    background: var(--bg-card);
    border: 1px solid var(--border-light);
    border-radius: 20px;
    padding: 40px;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    box-shadow: var(--shadow-md);
}

.feature-box:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-xl);
    border-color: var(--primary);
}

.feature-emoji {
    font-size: 3rem;
    margin-bottom: 24px;
    display: inline-block;
}

.feature-heading {
    font-size: 1.25rem;
    font-weight: 700;
    margin-bottom: 12px;
    color: var(--text-main);
}

.feature-info {
    color: var(--text-muted);
    line-height: 1.6;
}

/* ==================== FOOTER ==================== */

.page-bottom {
    text-align: center;
    color: #475569;
    ;
    font-size: 0.9rem;
    padding: 20px 20px;
    border-top: 1px solid var(--border-light);
    margin-top: 5px;
    /* Minimal top margin */
    background: rgb(255, 255, 255);
}

/* ==================== MODALS & DEPLOYMENT ==================== */

.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(15, 23, 42, 0.4);
    /* Darker overlay for contrast */
    backdrop-filter: blur(4px);
    z-index: 2000;
    display: none;
    justify-content: center;
    align-items: center;
}

.modal-content {
    background: var(--bg-card);
    padding: 30px;
    border-radius: 20px;
    max-width: 800px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    border: 1px solid var(--border-light);
    position: relative;
    box-shadow: var(--shadow-2xl);
    color: var(--text-main);
}

.close-modal {
    position: absolute;
    top: 20px;
    right: 24px;
    font-size: 24px;
    cursor: pointer;
    color: var(--text-light);
    transition: color 0.2s;
}

.close-modal:hover {
    color: var(--text-main);
}

/* ==================== DEPLOYMENT PAGE STYLES ==================== */

.deployment-container {
    max-width: 900px;
    margin: 120px auto 60px auto;
    padding: 20px;
}

.status-bar {
    background-color: white;
    padding: 16px;
    border-radius: 12px;
    margin-bottom: 30px;
    display: flex;
    justify-content: space-around;
    flex-wrap: wrap;
    color: var(--text-main);
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-light);
}

.status-item {
    font-weight: 600;
    font-size: 0.9rem;
}

.status-completed {
    color: #10b981;
}

.status-current {
    color: #f59e0b;
}

.status-pending {
    color: #cbd5e1;
}

.step-card {
    background: white;
    border: 1px solid var(--border-light);
    border-radius: 12px;
    margin-bottom: 20px;
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    transition: box-shadow 0.2s;
}

.step-card:hover {
    box-shadow: var(--shadow-md);
}

.step-header {
    padding: 20px 24px;
    background: var(--bg-body);
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-weight: 600;
    color: var(--text-main);
    border-bottom: 1px solid var(--border-light);
}

.step-content {
    padding: 24px;
    display: none;
    background: white;
}

.step-content.active {
    display: block;
}

.form-group {
    margin-bottom: 20px;
}

.form-label {
    display: block;
    margin-bottom: 8px;
    color: var(--text-main);
    font-weight: 500;
    font-size: 0.95rem;
}

.form-input,
.form-select {
    width: 100%;
    padding: 12px;
    border-radius: 8px;
    border: 1px solid var(--border-light);
    background: white;
    color: var(--text-main);
    font-size: 1rem;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.form-input:focus,
.form-select:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
}

.btn-primary {
    background-color: var(--primary);
    color: white;
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.2s;
    font-size: 1rem;
}

.btn-primary:hover {
    background-color: var(--primary-hover);
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

.btn-secondary {
    background-color: white;
    color: var(--text-main);
    padding: 12px 24px;
    border: 1px solid var(--border-light);
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.2s;
}

.btn-secondary:hover {
    background-color: var(--bg-body);
    border-color: #cbd5e1;
}

.spinner {
    border: 3px solid rgba(79, 70, 229, 0.1);
    border-radius: 50%;
    border-top: 3px solid var(--primary);
    width: 20px;
    height: 20px;
    animation: spin 1s linear infinite;
    display: inline-block;
    margin-right: 10px;
    vertical-align: middle;
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

/* ==================== LOGIN PAGE STYLES ==================== */

.login-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.login-card {
    background: rgb(234, 246, 250);
    padding: 40px;
    border-radius: 20px;
    box-shadow: var(--shadow-xl);
    width: 100%;
    max-width: 400px;
    border: 1px solid var(--border-light);
    text-align: center;
}

.login-title {
    font-size: 1.75rem;
    font-weight: 700;
    margin-bottom: 10px;
    color: var(--text-main);
}

.login-subtitle {
    color: var(--text-muted);
    margin-bottom: 30px;
}

/* ==================== ARCHITECTURE FLOW DIAGRAM STYLES ==================== */

.architecture-flow-container {
    display: flex;
    flex-direction: column;
    gap: 24px;
    width: 100%;
}

.process-group {
    background: #f8fafc;
    border: 1px solid var(--border-light);
    border-radius: 16px;
    padding: 20px;
    position: relative;
}

.ancillary-group {
    background: linear-gradient(to right, #fdf4ff, #f8fafc);
    border-color: #e9d5ff;
}

.main-group {
    background: linear-gradient(to right, #fff7ed, #f8fafc);
    border-color: #fed7aa;
}

.group-label {
    position: absolute;
    top: -12px;
    left: 20px;
    background: white;
    padding: 4px 12px;
    border-radius: 100px;
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--text-muted);
    border: 1px solid var(--border-light);
    box-shadow: var(--shadow-sm);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.flow-row {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    flex-wrap: wrap;
}

.flow-node {
    background: white;
    border: 1px solid var(--border-light);
    border-radius: 12px;
    padding: 12px 16px;
    display: flex;
    flex-direction: column;
    align-items: center;
    min-width: 80px;
    box-shadow: var(--shadow-sm);
    transition: transform 0.2s, box-shadow 0.2s;
}

.flow-node:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
    border-color: var(--primary);
}

.node-icon {
    font-size: 1.5rem;
    margin-bottom: 6px;
}

.node-title {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-main);
    text-align: center;
}

.flow-arrow {
    color: var(--text-light);
    font-weight: bold;
    font-size: 1.2rem;
}

.flow-connector-down {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    margin-right: 40px;
    height: 40px;
    position: relative;
}

.connector-line {
    width: 2px;
    height: 100%;
    background: var(--border-light);
    position: absolute;
    right: 14px;
}

.connector-arrow {
    position: absolute;
    bottom: -10px;
    right: 6px;
    color: var(--text-light);
    font-size: 1.2rem;
}

.reverse-flow {
    flex-direction: row-reverse;
}

@media (max-width: 768px) {
    .flow-row {
        flex-direction: column;
    }

    .flow-arrow {
        transform: rotate(90deg);
    }

    .reverse-flow {
        flex-direction: column;
    }

    .flow-connector-down {
        display: none;
    }
}

/* ==================== NEW CHAT LAYOUT ==================== */

.chat-layout {
    display: flex;
    position: fixed;
    top: 73px;
    bottom: 0;
    left: 0;
    right: 0;
    width: 100%;
    background: var(--bg-body);
    overflow: hidden;
    /* Prevent body scroll, children handle scrolling */
    z-index: 10;
}

.chat-sidebar {
    width: 280px;
    background: rgb(242, 246, 246);
    border-right: 1px solid var(--border-light);
    display: flex;
    flex-direction: column;
    padding: 20px;
    transition: width 0.3s ease, padding 0.3s ease, opacity 0.3s ease;
    overflow: hidden;
    white-space: nowrap;
}

.chat-sidebar.collapsed {
    width: 0;
    padding: 20px 0;
    /* Keep vertical padding but remove horizontal to avoid content squishing */
    opacity: 0;
    border-right: none;
}

.sidebar-header {
    margin-bottom: 20px;
}

/* Loading Spinner (Segmented/iOS style) */
/* Loading Spinner (Clean Round Circle) */
.spinner {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(99, 102, 241, 0.2);
    border-radius: 50%;
    border-top-color: #6366f1;
    /* Indigo-500 matches theme */
    animation: spin 0.8s linear infinite;
    margin-right: 10px;
    vertical-align: middle;
    background-image: none;
    /* Remove SVG */
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

.loading-bubble {
    color: var(--text-muted);
    font-style: normal;
    /* Removed italic for cleaner look */
    font-size: 0.95rem;
    display: flex;
    align-items: center;
    background: transparent;
}

.sidebar-header p {
    font-size: 0.90em;
    margin: 0;
}

.sidebar-content {
    flex: 1;
    overflow-y: auto;
    margin-bottom: 15px;
}

.sidebar-actions {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.action-btn {
    width: 100%;
    padding: 10px;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    font-size: 0.9rem;
}

.action-btn.primary {
    background: var(--primary);
    color: white;
    border: none;
}

.action-btn.secondary {
    background: white;
    border: 1px solid var(--border-light);
    color: var(--text-main);
}

.chat-main {
    flex: 1;
    display: flex;
    flex-direction: column;
    background: #f8fafc;
    position: relative;
    min-width: 0;
    /* Prevent flex item expansion */
}

.chat-header {
    padding: 10px 20px;
    background: rgb(233, 242, 239);
    border-bottom: 1px solid var(--border-light);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.chat-title h2 {
    font-size: 1.1rem;
    font-weight: 700;
    margin: 0;
    color: var(--text-main);
}

.chat-status {
    font-size: 0.8rem;
    color: #10b981;
    display: flex;
    align-items: center;
    gap: 6px;
}

.chat-status::before {
    content: '';
    display: block;
    width: 8px;
    height: 8px;
    background: #10b981;
    border-radius: 50%;
}

.chat-messages {
    flex: 1;
    padding: 24px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 20px;
    min-height: 0;
    /* Critical for nested flex scrolling */
    min-width: 0;
    /* Prevent flex item expansion */
}

.message-wrapper {
    display: flex;
    flex-direction: column;
    max-width: 80% !important;
    /* Force constraint */
    min-width: 0;
    /* Critical for flex child overflow */
}

.message-wrapper.user {
    align-self: flex-end;
    align-items: flex-end;
}

.message-wrapper.bot {
    align-self: flex-start;
    align-items: flex-start;
}


.bot-message {
    align-self: flex-start;
}

.user-message {
    align-self: flex-end;
    align-items: flex-end;
}

.message-bubble {
    padding: 9px;
    border-radius: 16px;
    line-height: 1.6;
    font-size: 0.85rem;
    position: relative;
    overflow-wrap: break-word;
    /* Prevent long text/content from breaking layout */
    word-break: break-word;
    max-width: 100%;
    /* Ensure it doesn't exceed wrapper */
}

.message-bubble.bot {
    background: white;
    border: 1px solid var(--border-light);
    border-top-left-radius: 4px;
    color: var(--text-main);
    box-shadow: var(--shadow-sm);
}

.message-bubble.user {
    background: var(--primary);
    color: white;
    border-top-right-radius: 4px;
}

.message-time {
    font-size: 0.75rem;
    color: var(--text-light);
    margin-top: 6px;
    padding: 0 4px;
}

.chat-input-container {
    padding: 24px;
    background: white;
    border-top: 1px solid var(--border-light);
}

.input-wrapper {
    position: relative;
    background: var(--bg-body);
    border: 1px solid var(--border-light);
    border-radius: 12px;
    padding: 4px;
    display: flex;
    align-items: flex-end;
    transition: all 0.2s;
}

.input-wrapper:focus-within {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
    background: white;
}

.chat-textarea {
    flex: 1;
    background: transparent;
    border: none;
    padding: 12px 16px;
    font-family: inherit;
    font-size: 0.95rem;
    resize: none;
    max-height: 150px;
    outline: none;
    color: var(--text-main);
}

.send-button {
    background: var(--primary);
    color: white;
    border: none;
    width: 36px;
    height: 36px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    margin: 4px;
    transition: all 0.2s;
}

.send-button:hover {
    background: var(--primary-hover);
    transform: scale(1.05);
}

.input-hint {
    font-size: 0.75rem;
    color: var(--text-light);
    margin-top: 8px;
    text-align: center;
}

.user-badge {
    font-weight: 600;
    color: var(--text-main);
    background: var(--bg-body);
    padding: 6px 12px;
    border-radius: 20px;
    border: 1px solid var(--border-light);
}

/* ==================== POST DEPLOY DASHBOARD ==================== */

.success-banner {
    background-color: #4ade80;
    background: linear-gradient(to right, #4ade80, #22c55e);
    color: white;
    text-align: center;
    padding: 16px;
    font-size: 1.5rem;
    font-weight: 700;
    margin-top: 73px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    box-shadow: var(--shadow-md);
}

.dashboard-container {
    max-width: 1200px;
    margin: 40px auto;
    padding: 0 20px;
    display: grid;
    grid-template-columns: 1.5fr 1fr;
    gap: 30px;
}

.dashboard-card {
    background: white;
    border-radius: 16px;
    padding: 30px;
    box-shadow: var(--shadow-md);
    border: 1px solid var(--border-light);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

/* Main SQL Generator Card */
.sql-gen-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    justify-content: center;
    min-height: 400px;
    background: white;
    border-top: 4px solid #3b82f6;
}

.sql-gen-header {
    font-size: 2rem;
    font-weight: 700;
    color: var(--text-main);
    margin-bottom: 40px;
}

.sql-gen-content {
    background: #f1f5f9;
    border-radius: 12px;
    padding: 30px;
    display: flex;
    align-items: center;
    gap: 20px;
    margin-bottom: 40px;
    text-align: left;
    max-width: 80%;
}

.sql-gen-icon {
    font-size: 4rem;
    color: #3b82f6;
}

.sql-gen-text {
    color: var(--text-muted);
    font-size: 1rem;
    line-height: 1.5;
}

.btn-generate {
    background-color: #3b82f6;
    color: white;
    padding: 14px 32px;
    border-radius: 8px;
    font-weight: 600;
    font-size: 1.1rem;
    border: none;
    cursor: pointer;
    transition: all 0.2s;
    text-decoration: none;
}

.btn-generate:hover {
    background-color: #2563eb;
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

/* Right Column Cards */
.right-column {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.side-card {
    padding: 24px;
    border-radius: 12px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    min-height: 140px;
}

/* Evaluation Card */
.eval-card {
    background-color: #dcfce7;
    border: 1px solid #bbf7d0;
}



.eval-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
}

.eval-icon {
    font-size: 2rem;
    color: #16a34a;
}

.eval-title {
    font-size: 1.1rem;
    font-weight: 700;
    color: #14532d;
}

/* Card Header Styling */
.card-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
}

.header-icon {
    font-size: 2rem;
}

.header-title {
    font-size: 1.3rem;
    font-weight: 700;
}

/* Content Box Styling - Same as SQL Generator */
.card-content-box {
    border-radius: 12px;
    padding: 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
    margin-bottom: 0;
}

.eval-content-box {
    background: #f0fdf4;
    border: 1px solid #bbf7d0;
}

.config-content-box {
    background: #fff7ed;
    border: 1px solid #fed7aa;
}

.content-text {
    font-size: 1rem;
    color: var(--text-secondary);
    font-weight: 500;
}

/* Action Buttons */
.btn-action {
    background-color: #0ea5e9;
    padding: 10px 24px;
    border-radius: 8px;
    font-weight: 600;
    font-size: 0.95rem;
    border: none;
    cursor: pointer;
    text-decoration: none;
    display: inline-block;
    white-space: nowrap;
    transition: all 0.3s ease;
}

.btn-eval {
    background: #22c55e;
    color: white;
}

.btn-eval:hover {
    background: #16a34a;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(34, 197, 94, 0.3);
}

.btn-config {
    background: #16b8e0;
    color: white;
}

.btn-config:hover {
    background: #ea580c;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(249, 115, 22, 0.3);
}

/* Config specific colors */
.config-icon {
    color: #ea580c;
}

.config-title {
    color: #7c2d12;
}

/* Keep existing eval icon/title colors */
.eval-card .header-icon {
    color: #16a34a;
}

.eval-card .header-title {
    color: #166534;
}

.eval-action {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.eval-desc {
    color: #15803d;
    font-size: 0.9rem;
}

.btn-eval {
    background-color: #22c55e;
    color: white;
    padding: 8px 16px;
    border-radius: 6px;
    font-weight: 600;
    border: none;
    cursor: pointer;
    text-decoration: none;
    font-size: 0.9rem;
}

.btn-eval:hover {
    background-color: #16a34a;
}

/* Reconfiguration Card */
.config-card {
    background-color: #ffedd5;
    border: 1px solid #fed7aa;
}

.config-icon {
    font-size: 2rem;
    color: #335fd8;
}

.config-title {
    font-size: 1.1rem;
    font-weight: 700;
    color: #7c2d12;
}

.config-desc {
    color: #2c37cd;
    font-size: 0.9rem;
}

.btn-config {
    background-color: #4ca2e8;
    color: white;
    padding: 8px 16px;
    border-radius: 6px;
    font-weight: 600;
    border: none;
    cursor: pointer;
    text-decoration: none;
    font-size: 0.9rem;
}

.btn-config:hover {
    background-color: #8ae066;
}

/* Details Card */
.details-card {
    background-color: #f1f5f9;
    border: 1px solid #e2e8f0;
}

.details-title {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text-main);
    margin-bottom: 16px;
}

.details-list {
    list-style: none;
    padding: 0;
    margin: 0;
    font-size: 0.9rem;
    color: var(--text-muted);
}

.details-list li {
    margin-bottom: 8px;
}

.details-list strong {
    color: var(--text-main);
    font-weight: 600;
}

@media (max-width: 768px) {
    .dashboard-container {
        grid-template-columns: 1fr;
    }

    .sql-gen-content {
        flex-direction: column;
        text-align: center;
    }
}


.system-overview-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    font-size: 11px;
}

/* Outline button style for See Architecture */
.secondary-cta-outline {
    color: #000000;
    background: transparent;
    border: 2px solid #4441e8;
    padding: 8px 20px;
}


/* ==================== BACKEND WORKFLOW SIMULATOR (TERMINAL STYLE) ==================== */

.chat-simulator {
    width: 450px;
    /* Slightly wider for terminal lines */
    background: #0d1117;
    /* GitHub Dark Dimmed / Terminal Black */
    border-left: 1px solid #30363d;
    display: flex;
    flex-direction: column;
    height: 100%;
    font-family: 'Fira Code', 'Consolas', 'Monaco', monospace;
    /* Monospace is key */
    color: #c9d1d9;
    box-shadow: -5px 0 15px rgba(0, 0, 0, 0.3);
    z-index: 50;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1), width 0.3s ease, padding 0.3s ease, opacity 0.3s ease, flex-basis 0.3s ease;
    position: relative;
    /* For absolute positioning of resizer */
    min-width: 300px;
    max-width: 800px;
}

.chat-simulator.collapsed {
    width: 0;
    padding: 0;
    overflow: hidden;
    opacity: 0;
    border-left: none;
    min-width: 0;
}

.resize-handle {
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 5px;
    cursor: col-resize;
    z-index: 100;
    transition: background 0.2s;
}

.resize-handle:hover,
.resize-handle.active {
    background: #58a6ff;
}

.simulator-header {
    padding: 15px;
    background: #161b22;
    border-bottom: 1px solid #30363d;
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 14px;
    font-weight: 700;
    color: #58a6ff;
    /* Terminal Blue */
    text-transform: uppercase;
    letter-spacing: 1px;
}

.simulator-content {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    background: #0d1117;
}

/* Terminal Lines */
.term-line {
    font-size: 13px;
    line-height: 1.5;
    word-break: break-all;
    display: block;
    position: relative;
    padding-left: 15px;
    border-left: 2px solid transparent;
    /* Guide line placeholder */
}

/* Status variants */
.term-line.header {
    background: #1f6feb;
    /* Blue background */
    color: #ffffff;
    padding: 6px 12px;
    border-radius: 4px;
    font-weight: 700;
    border-left: none;
    margin-top: 10px;
}

.term-line.header::before {
    content: '> ';
    margin-right: 5px;
}

.term-line.success {
    color: #3fb950;
    /* Green */
    font-weight: 600;
    border-left: 2px solid #3fb950;
    padding-left: 10px;
}

.term-line.error {
    color: #f85149;
    /* Red */
    border-left: 2px solid #f85149;
    padding-left: 10px;
}

.term-line.info {
    color: #8b949e;
    /* Gray */
    padding-left: 10px;
    border-left: 2px solid #30363d;
}

/* JSON Output */
.term-json {
    background: #161b22;
    padding: 10px;
    border-radius: 4px;
    border: 1px solid #30363d;
    color: #e3b341;
    /* Yellow for JSON */
    font-size: 12px;
    white-space: pre-wrap;
    margin-top: 5px;
    margin-left: 12px;
}

/* Action Area in Terminal */
.simulator-actions {
    padding: 15px;
    background: #161b22;
    border-top: 1px solid #30363d;
    min-height: 80px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.btn-sim-action {
    background: transparent;
    border: 1px solid #3fb950;
    color: #3fb950;
    padding: 10px 20px;
    border-radius: 4px;
    font-family: inherit;
    font-weight: 700;
    cursor: pointer;
    width: 100%;
    text-transform: uppercase;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.btn-sim-action:hover {
    background: #3fb950;
    color: #0d1117;
    box-shadow: 0 0 15px rgba(63, 185, 80, 0.4);
}

.btn-sim-action:disabled {
    border-color: #30363d;
    color: #8b949e;
    cursor: not-allowed;
    background: rgba(48, 54, 61, 0.3);
    box-shadow: none;
}

/* Scrollbar dark */
.simulator-content::-webkit-scrollbar {
    width: 8px;
}

.simulator-content::-webkit-scrollbar-track {
    background: #0d1117;
}

.simulator-content::-webkit-scrollbar-thumb {
    background: #30363d;
    border-radius: 4px;
}


.sim-title {
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--text-main);
}

.sim-log {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.8rem;
    color: var(--text-muted);
    background: #f8fafc;
    padding: 8px;
    border-radius: 4px;
    margin-top: 8px;
    white-space: pre-wrap;
    word-break: break-all;
    border: 1px solid #f1f5f9;
}

.simulator-actions {
    padding: 20px;
    background: white;
    border-top: 1px solid var(--border-light);
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.btn-sim-action {
    width: 100%;
    padding: 12px;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    border: none;
}

.btn-sim-action.primary {
    background: #3b82f6;
    color: white;
}

.btn-sim-action.primary:hover {
    background: #2563eb;
}

.btn-sim-action:disabled {
    background: #e2e8f0;
    color: #94a3b8;
    cursor: not-allowed;
}

.empty-state {
    text-align: center;
    padding: 40px 20px;
    color: var(--text-muted);
}

.step-icon.start {
    font-size: 2rem;
    margin-bottom: 10px;
}