/* =========================================================================
   VSO-CHAT.CSS - CAPITALCLAIM PREMIUM B2B INTEGRATION
   ========================================================================= */

body.ai-interface-body {
    margin: 0;
    padding: 0;
    height: 100vh;
    overflow: hidden;
    /* Uses background, fonts, noise from style.css */
}

.app-container {
    display: flex;
    height: 100vh;
    width: 100vw;
    position: relative;
    z-index: 10;
}

/* =========================================================================
   SIDEBAR
   ========================================================================= */
.ai-sidebar {
    width: 320px;
    background-color: rgba(15, 23, 42, 0.95); /* var(--clr-primary) with opacity */
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-right: 1px solid rgba(255,255,255,0.05);
    color: rgba(255,255,255,0.8);
    display: flex;
    flex-direction: column;
    padding: var(--space-md);
    box-sizing: border-box;
    flex-shrink: 0;
    box-shadow: var(--shadow-card);
}

.sidebar-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: var(--space-md);
}

.logo {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 700;
    font-size: 1.2rem;
    color: #fff;
    font-family: var(--font-heading);
    letter-spacing: 0.02em;
}

.logo-icon i {
    background: linear-gradient(135deg, var(--clr-primary-light), var(--clr-accent-2));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    font-size: 1.5rem;
}

.badge-pro {
    background: rgba(37, 99, 235, 0.2); /* var(--clr-accent-1) tint */
    color: var(--clr-accent-2);
    padding: 4px 8px;
    border: 1px solid rgba(37, 99, 235, 0.3);
    border-radius: 4px;
    font-family: var(--font-data);
    font-size: 0.65rem;
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.sidebar-nav h4 {
    font-family: var(--font-heading);
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: #fff;
    margin-bottom: var(--space-sm);
}

.btn-new-chat {
    width: 100%;
    padding: 12px;
    background: transparent;
    border: 1px solid rgba(255,255,255,0.15);
    color: #fff;
    border-radius: 6px;
    cursor: pointer;
    text-align: left;
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 600;
    font-size: 0.95rem;
    font-family: var(--font-heading);
    transition: background 0.3s ease, border-color 0.3s;
}

.btn-new-chat:hover {
    background: rgba(255,255,255,0.05);
    border-color: rgba(255,255,255,0.3);
}

.feature-list {
    list-style: none;
    padding: 0;
    margin: 15px 0 0 0;
}

.feature-list li {
    font-size: 0.9rem;
    font-weight: 600;
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    gap: 12px;
    color: rgba(255,255,255,0.6);
}

.text-success { color: #10b981; }

.sidebar-footer {
    margin-top: auto;
    font-size: 0.8rem;
    color: #888;
}

.trust-badge {
    background: rgba(16, 185, 129, 0.08);
    color: #10b981;
    font-family: var(--font-heading);
    padding: 10px;
    border: 1px solid rgba(16, 185, 129, 0.2);
    border-radius: 6px;
    display: flex;
    align-items: center;
    font-weight: 600;
    gap: 8px;
}

/* =========================================================================
   MAIN CHAT CONTAINER
   ========================================================================= */
.chat-container {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    position: relative;
    background-color: transparent; 
}

.mobile-header {
    display: none;
    padding: 15px 20px;
    background: var(--clr-primary);
    color: #fff;
    align-items: center;
    justify-content: space-between;
}

.chat-window {
    flex-grow: 1;
    overflow-y: auto;
    padding: 40px 20px 140px 20px; /* space for input area */
    scroll-behavior: smooth;
    display: flex;
    flex-direction: column;
    align-items: stretch;
}

.message {
    display: flex;
    gap: 15px;
    margin-bottom: 30px;
    max-width: 850px;
    width: 100%;
    margin-left: auto;
    margin-right: auto;
}

.ai-message { justify-content: flex-start; }
.user-message { flex-direction: row-reverse; }

.avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    box-shadow: var(--shadow-card);
}

.ai-avatar {
    background: var(--clr-primary);
    color: white;
}

.user-avatar {
    background: #E2E8F0;
    color: var(--clr-text-muted);
}

.message-content {
    display: flex;
    flex-direction: column;
    gap: 12px;
    max-width: 85%;
}

.message-bubble {
    padding: 20px 24px;
    border-radius: 12px;
    font-size: 1rem;
    line-height: 1.6;
    box-shadow: var(--shadow-soft);
}

.ai-message .message-bubble {
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
    color: rgba(255, 255, 255, 0.95);
    border-top-left-radius: 4px;
}

.user-message .message-bubble {
    background: linear-gradient(135deg, #2563EB, #1D4ED8);
    color: #fff;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-top-right-radius: 4px;
    box-shadow: 0 4px 15px rgba(37, 99, 235, 0.2);
}

.message-bubble p { margin: 0 0 10px 0; }
.message-bubble p:last-child { margin: 0; }

/* ACTION BUTTONS */
.action-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 5px;
}

.action-btn {
    background: rgba(255, 255, 255, 0.05); /* Sleek dark theme */
    border: 1px solid rgba(255, 255, 255, 0.15);
    color: #E2E8F0;
    padding: 12px 24px;
    border-radius: 8px;
    font-size: 1rem;
    font-family: var(--font-heading);
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.action-btn::before {
    content: '';
    position: absolute;
    top: 0; left: -100%; width: 100%; height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
    transition: left 0.6s ease;
}

.action-btn:hover {
    background: #2563EB; /* Bright Stripe/Linear Blue */
    border-color: #2563EB;
    color: #FFFFFF;
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(37, 99, 235, 0.3);
}

.action-btn:hover::before {
    left: 100%;
}

/* =========================================================================
   INPUT & UPLOAD AREA
   ========================================================================= */
.input-area {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    /* Soft gradient matching CapitalClaim bg */
    background: linear-gradient(to top, rgba(250, 250, 250, 1) 70%, rgba(250, 250, 250, 0));
    padding: 30px 20px;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    align-items: center;
    z-index: 50;
}

.upload-zone {
    width: 100%;
    max-width: 600px;
    /* CapitalClaim engine calc-panel style */
    background: var(--glass-bg);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 2px dashed var(--clr-accent-1);
    border-radius: 12px;
    padding: 30px;
    text-align: center;
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    box-shadow: var(--shadow-elevated);
}

.upload-zone:hover {
    background: rgba(255, 255, 255, 0.9);
    border-style: solid;
    transform: translateY(-4px);
}

.file-input { display: none; }

.upload-label {
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    color: var(--clr-primary);
}

.upload-label i { font-size: 2.5rem; color: var(--clr-accent-1); }

.upload-label span {
    font-weight: 700;
    font-family: var(--font-heading);
    font-size: 1.1rem;
}

.upload-label small {
    color: var(--clr-text-muted);
    font-family: var(--font-data);
}

/* =========================================================================
   TYPING & SIGNATURE 
   ========================================================================= */
.typing-indicator {
    padding: 15px 30px;
    background: var(--glass-bg);
    backdrop-filter: blur(16px);
    border: var(--glass-border);
    border-radius: 30px;
    box-shadow: var(--shadow-card);
    color: var(--clr-primary);
    font-weight: 700;
    font-family: var(--font-heading);
    font-size: 0.95rem;
    margin-bottom: 20px;
}

.dots span { animation: blink 1.4s infinite both; }
.dots span:nth-child(2) { animation-delay: 0.2s; }
.dots span:nth-child(3) { animation-delay: 0.4s; }

@keyframes blink {
    0% { opacity: 0.2; }
    20% { opacity: 1; }
    100% { opacity: 0.2; }
}

.signature-zone {
    width: 100%;
    max-width: 450px;
    background: var(--glass-bg);
    backdrop-filter: blur(16px);
    border: var(--glass-border);
    padding: 24px;
    border-radius: 12px;
    box-shadow: var(--shadow-elevated);
}

#signatureCanvas {
    background: #fff;
    border: 1px dashed var(--clr-text-muted);
    border-radius: 8px;
    cursor: crosshair;
    width: 100%;
    touch-action: none;
    margin-bottom: var(--space-sm);
}

.disclaimer {
    font-size: 0.8rem;
    color: var(--clr-text-muted);
    margin-top: var(--space-sm);
}

.hidden { display: none !important; }

/* GSAP Animations Hook fallback */
.fade-in-up {
    animation: fadeInUp 0.5s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}
@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

/* =========================================================================
   ANALYSIS STEPPER (progress during API call)
   ========================================================================= */
.analysis-stepper { padding: 24px 28px !important; }

.stepper-steps {
    display: flex;
    gap: 8px;
}

.stepper-step {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 12px 8px;
    border-radius: 8px;
    background: rgba(0,0,0,0.02);
    border: 1px solid transparent;
    opacity: 0.35;
    transition: all 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}

.stepper-step.active {
    opacity: 1;
    background: rgba(37,99,235,0.06);
    border-color: rgba(37,99,235,0.15);
}

.stepper-step.active .stepper-icon {
    color: var(--clr-accent-1);
    animation: pulse-icon 1.5s ease-in-out infinite;
}

.stepper-icon {
    font-size: 1.5rem;
    color: var(--clr-text-muted);
}

.stepper-label {
    font-size: 0.7rem;
    font-family: var(--font-heading);
    font-weight: 700;
    text-align: center;
    color: var(--clr-text-main);
}

@keyframes pulse-icon {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.15); }
}

/* =========================================================================
   VSO RESULTS DASHBOARD
   ========================================================================= */
.vso-results {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

/* Recommendation Banner */
.rec-banner {
    padding: 20px 24px;
    border-radius: 10px;
    border-left: 5px solid;
}

.rec-banner.rec-danger {
    background: rgba(239,68,68,0.06);
    border-left-color: #ef4444;
}
.rec-banner.rec-warning {
    background: rgba(245,158,11,0.06);
    border-left-color: #f59e0b;
}
.rec-banner.rec-safe {
    background: rgba(34,197,94,0.06);
    border-left-color: #22c55e;
}

.rec-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 8px;
}

.rec-header i {
    font-size: 1.8rem;
}
.rec-danger .rec-header i { color: #ef4444; }
.rec-warning .rec-header i { color: #f59e0b; }
.rec-safe .rec-header i { color: #22c55e; }

.rec-label {
    font-family: var(--font-heading);
    font-size: 1.3rem;
    font-weight: 800;
    letter-spacing: -0.01em;
}
.rec-danger .rec-label { color: #dc2626; }
.rec-warning .rec-label { color: #d97706; }
.rec-safe .rec-label { color: #16a34a; }

.rec-toelichting {
    font-size: 0.95rem;
    line-height: 1.6;
    color: var(--clr-text-main);
    margin: 0;
}

/* Metrics Row */
.metrics-row {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 12px;
}

.metric-card {
    background: var(--clr-bg-deep);
    border: 1px solid rgba(0,0,0,0.05);
    border-radius: 10px;
    padding: 16px;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.metric-label {
    font-family: var(--font-heading);
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--clr-text-muted);
    margin-bottom: 8px;
}

.metric-big {
    font-family: var(--font-data);
    font-size: 2.2rem;
    font-weight: 700;
    color: var(--clr-primary);
    line-height: 1;
}

.metric-money { color: #16a34a; }

.metric-sub {
    font-size: 0.7rem;
    color: var(--clr-text-muted);
    margin-top: 4px;
}

/* Risk Gauge */
.risk-gauge {
    position: relative;
    width: 120px;
    height: 65px;
}

.gauge-svg {
    width: 100%;
    height: auto;
}

.gauge-fill {
    transition: stroke-dashoffset 1.5s cubic-bezier(0.16, 1, 0.3, 1);
}

.gauge-number {
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    font-family: var(--font-data);
    font-size: 1.6rem;
    font-weight: 700;
    color: var(--clr-primary);
}

/* Extracted Data Grid */
.extract-summary {
    background: var(--clr-bg-deep);
    border: 1px solid rgba(0,0,0,0.05);
    border-radius: 10px;
    padding: 20px;
}

.extract-summary h4 {
    font-family: var(--font-heading);
    font-size: 0.9rem;
    font-weight: 800;
    color: var(--clr-primary);
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.extract-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0;
}

.extract-row {
    display: flex;
    justify-content: space-between;
    padding: 8px 12px;
    border-bottom: 1px solid rgba(0,0,0,0.04);
    font-size: 0.85rem;
}

.extract-row:nth-child(odd) { background: rgba(0,0,0,0.015); }

.extract-label {
    color: var(--clr-text-muted);
    font-weight: 600;
}

.extract-value {
    color: var(--clr-text-main);
    font-family: var(--font-data);
    font-weight: 700;
    font-size: 0.8rem;
    text-align: right;
}

/* Issues Section */
.issues-section h4,
.positives-section h4,
.priorities-section h4 {
    font-family: var(--font-heading);
    font-size: 0.9rem;
    font-weight: 800;
    color: var(--clr-primary);
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.issue-card {
    background: #fff;
    border: 1px solid rgba(0,0,0,0.06);
    border-radius: 8px;
    padding: 16px;
    margin-bottom: 10px;
    transition: box-shadow 0.3s, transform 0.3s;
}

.issue-card:hover {
    box-shadow: var(--shadow-card);
    transform: translateY(-2px);
}

.issue-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
    flex-wrap: wrap;
}

.severity-badge {
    font-family: var(--font-data);
    font-size: 0.6rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    padding: 3px 8px;
    border-radius: 4px;
}

.sev-critical { background: #fef2f2; color: #dc2626; border: 1px solid rgba(239,68,68,0.2); }
.sev-high     { background: #fff7ed; color: #ea580c; border: 1px solid rgba(234,88,12,0.2); }
.sev-medium   { background: #fffbeb; color: #d97706; border: 1px solid rgba(217,119,6,0.2); }
.sev-low      { background: #f0fdf4; color: #16a34a; border: 1px solid rgba(22,163,74,0.2); }

.issue-cat {
    font-family: var(--font-heading);
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--clr-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.issue-impact {
    margin-left: auto;
    font-family: var(--font-data);
    font-size: 0.8rem;
    font-weight: 700;
    color: #dc2626;
}

.issue-desc {
    font-size: 0.9rem;
    line-height: 1.6;
    color: var(--clr-text-main);
    margin: 0 0 8px 0;
}

.issue-legal {
    font-size: 0.8rem;
    color: var(--clr-text-muted);
    font-style: italic;
    margin: 0 0 8px 0;
    line-height: 1.5;
    display: flex;
    align-items: flex-start;
    gap: 6px;
}

.issue-legal i {
    flex-shrink: 0;
    margin-top: 2px;
    color: var(--clr-accent-1);
}

.issue-eclis {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
    font-size: 0.75rem;
}

.issue-eclis i {
    color: var(--clr-accent-1);
}

.ecli-link {
    font-family: var(--font-data);
    font-size: 0.65rem;
    font-weight: 700;
    color: var(--clr-accent-1) !important;
    background: rgba(37,99,235,0.06);
    padding: 2px 8px;
    border-radius: 4px;
    border: 1px solid rgba(37,99,235,0.12);
    text-decoration: none;
    transition: background 0.2s, color 0.2s;
    word-break: break-all;
}

.ecli-link:hover {
    background: var(--clr-accent-1);
    color: #fff !important;
}

/* Positive Points */
.positives-section {
    background: rgba(34,197,94,0.04);
    border: 1px solid rgba(34,197,94,0.1);
    border-radius: 10px;
    padding: 16px 20px;
}

.positives-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.positives-list li {
    font-size: 0.85rem;
    padding: 6px 0;
    border-bottom: 1px solid rgba(0,0,0,0.03);
    display: flex;
    align-items: flex-start;
    gap: 8px;
    line-height: 1.5;
}

.positives-list li::before {
    content: '\2713';
    color: #22c55e;
    font-weight: 800;
    flex-shrink: 0;
}

/* Priority Actions */
.priorities-section {
    background: rgba(37,99,235,0.04);
    border: 1px solid rgba(37,99,235,0.1);
    border-radius: 10px;
    padding: 16px 20px;
}

.priorities-list {
    padding-left: 20px;
    margin: 0;
}

.priorities-list li {
    font-size: 0.85rem;
    padding: 6px 0;
    line-height: 1.5;
    color: var(--clr-text-main);
    font-weight: 600;
}

.priorities-list li::marker {
    color: var(--clr-accent-1);
    font-weight: 800;
}

/* CTA Box */
.cta-box {
    background: var(--clr-primary);
    color: #fff;
    padding: 20px 24px;
    border-radius: 10px;
}

.cta-box p {
    font-size: 0.9rem;
    line-height: 1.6;
    margin: 0 0 8px 0;
    color: rgba(255,255,255,0.9);
}

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

.cta-box strong { color: #fff; }

/* =========================================================================
   TEASER / GATE — locked preview before signature
   ========================================================================= */
.vso-teaser {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

/* Blurred issue preview cards */
.issues-preview-locked h4 {
    font-family: var(--font-heading);
    font-size: 0.9rem;
    font-weight: 800;
    color: var(--clr-primary);
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.issue-card-locked {
    background: #fff;
    border: 1px solid rgba(0,0,0,0.06);
    border-radius: 8px;
    padding: 14px 16px;
    margin-bottom: 8px;
    position: relative;
    overflow: hidden;
}

.issue-card-locked .issue-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 6px;
    flex-wrap: wrap;
}

.issue-blurred {
    filter: blur(5px);
    user-select: none;
    pointer-events: none;
    color: var(--clr-text-muted);
    font-size: 0.85rem;
    line-height: 1.5;
}

.issue-blurred p { margin: 0; }

/* Gate CTA */
.gate-cta {
    background: linear-gradient(135deg, #f8fafc, #f1f5f9);
    border: 2px solid var(--clr-accent-1);
    border-radius: 12px;
    padding: 28px;
    text-align: center;
    position: relative;
}

.gate-lock {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--clr-primary), var(--clr-accent-1));
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 16px;
    box-shadow: 0 8px 25px rgba(37, 99, 235, 0.25);
}

.gate-lock i {
    font-size: 1.6rem;
    color: #fff;
}

.gate-cta h4 {
    font-family: var(--font-heading);
    font-size: 1.2rem;
    font-weight: 800;
    color: var(--clr-primary);
    margin-bottom: 8px;
}

.gate-cta > p {
    font-size: 0.9rem;
    color: var(--clr-text-muted);
    line-height: 1.5;
    margin: 0 0 16px 0;
}

.gate-benefits {
    list-style: none;
    padding: 0;
    margin: 0 0 16px 0;
    text-align: left;
    max-width: 380px;
    margin-left: auto;
    margin-right: auto;
}

.gate-benefits li {
    font-size: 0.85rem;
    font-weight: 600;
    padding: 5px 0;
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--clr-text-main);
}

.gate-benefits li i {
    color: #22c55e;
    font-size: 1rem;
    flex-shrink: 0;
}

.gate-free {
    background: rgba(34, 197, 94, 0.08);
    border: 1px solid rgba(34, 197, 94, 0.15);
    border-radius: 8px;
    padding: 12px 16px;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.85rem;
    font-weight: 700;
    color: #16a34a;
    text-align: left;
}

.gate-free i {
    font-size: 1.3rem;
    flex-shrink: 0;
}

/* Status footer (after signature) */
.status-footer {
    background: linear-gradient(135deg, var(--clr-primary), var(--clr-accent-1));
    border-radius: 10px;
    padding: 20px 24px;
    display: flex;
    align-items: center;
    gap: 16px;
    color: #fff;
}

.status-icon {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: rgba(255,255,255,0.15);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.status-icon i {
    font-size: 1.4rem;
    color: #fff;
}

.status-text {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.status-text strong {
    font-family: var(--font-heading);
    font-size: 1rem;
    font-weight: 800;
}

.status-text span {
    font-size: 0.85rem;
    color: rgba(255,255,255,0.8);
    line-height: 1.4;
}

/* =========================================================================
   MOBILE RESPONSIVE
   ========================================================================= */
@media (max-width: 768px) {
    .ai-sidebar { display: none; }
    .mobile-header { display: flex; }
    .chat-window { padding: 20px 15px 160px 15px; }
    .message { max-width: 100%; }
    .metrics-row { grid-template-columns: 1fr; }
    .extract-grid { grid-template-columns: 1fr; }
    .stepper-steps { flex-wrap: wrap; }
    .stepper-step { min-width: calc(50% - 8px); }
    .rec-label { font-size: 1.1rem; }
    .gate-cta { padding: 20px; }
    .status-footer { flex-direction: column; text-align: center; }
}
