/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    height: 100%;
    overflow: hidden;
}

:root {
    /* Skill Bridge Talent Brand Colors */
    --sbt-purple-dark: #6B46C1;
    --sbt-purple-darker: #553C9A;
    --sbt-purple-light: #805AD5;
    --sbt-white: #FFFFFF;
    --sbt-black: #1A202C;
    --sbt-gray: #4A5568;

    /* Legacy colors (will be replaced) */
    --primary-color: #6B46C1;
    --primary-dark: #553C9A;
    --secondary-color: #64748b;
    --success-color: #10b981;
    --warning-color: #f59e0b;
    --danger-color: #ef4444;
    --background: #f8fafc;
    --surface: #ffffff;
    --border: #e2e8f0;
    --text-primary: #1e293b;
    --text-secondary: #64748b;
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu', 'Cantarell', sans-serif;
    background: #f5f5f7;
    height: 100%;
    min-height: 100vh;
    max-height: 100vh;
    padding: 0;
    margin: 0;
    color: var(--text-primary);
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

/* ========================================
   SKILL BRIDGE TALENT BRAND HEADER
   ======================================== */

/* Brand Header Container - COMPACT & STICKY */
.sbt-brand-header {
    background: linear-gradient(135deg, var(--sbt-purple-dark) 0%, var(--sbt-purple-darker) 100%);
    padding: 14px 40px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    border-bottom: 2px solid var(--sbt-purple-light);
    position: sticky;
    top: 0;
    z-index: 1000;
    flex-shrink: 0;
}

/* Main Content Area - SCROLLABLE */
.sbt-main-content {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 20px;
    padding-bottom: 200px;  /* Space for input section + footer */
    min-height: 0;  /* Allow flexbox to shrink properly */
}

.sbt-brand-container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    max-width: 1400px;
    margin: 0 auto;
    gap: 20px;
}

/* LEFT SIDE: Logo + Text */
.sbt-brand-left {
    display: flex;
    align-items: center;
    gap: 16px;
}

/* RIGHT SIDE: Progress Tracker */
.sbt-brand-right {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    gap: 16px;
}

/* Logout Button */
.logout-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    background: rgba(255, 255, 255, 0.15);
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 6px;
    color: white;
    text-decoration: none;
    font-size: 13px;
    font-weight: 500;
    transition: all 0.2s;
    cursor: pointer;
}

.logout-btn:hover {
    background: rgba(255, 255, 255, 0.25);
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.logout-btn span {
    font-size: 16px;
}

/* Logo Styling - White Transparent Logo (No Filters Needed) */
.sbt-brand-logo {
    height: 65px;
    width: auto;
    object-fit: contain;
    margin-right: 4px;
    /* NO filters - logo is already white and transparent */
}

.sbt-brand-logo:hover {
    transform: scale(1.05);
}

/* Brand Text */
.sbt-brand-text {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.sbt-company-name {
    font-size: 20px;
    font-weight: 700;
    letter-spacing: 1.5px;
    color: var(--sbt-white);
    margin: 0;
    line-height: 1.2;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

.sbt-app-name {
    font-size: 12px;
    font-weight: 400;
    color: rgba(255, 255, 255, 0.85);
    margin: 0;
    letter-spacing: 0.3px;
    line-height: 1.2;
}

/* Compact Progress Tracker (Right Side) */
.progress-tracker-compact {
    display: flex;
    align-items: center;
    gap: 12px;
}

.progress-step-compact {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
}

.progress-dot-compact {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.25);
    border: 2px solid rgba(255, 255, 255, 0.4);
    transition: all 0.3s ease;
    position: relative;
}

.progress-step-compact.active .progress-dot-compact {
    background: var(--sbt-purple-light);
    border-color: var(--sbt-white);
    width: 14px;
    height: 14px;
    box-shadow: 0 0 8px rgba(128, 90, 213, 0.6);
}

.progress-step-compact.completed .progress-dot-compact {
    background: rgba(16, 185, 129, 0.9);
    border-color: rgba(16, 185, 129, 1);
}

.progress-step-compact.completed .progress-dot-compact::after {
    content: '✓';
    position: absolute;
    color: white;
    font-size: 8px;
    font-weight: bold;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

.progress-step-compact span {
    font-size: 9px;
    color: rgba(255, 255, 255, 0.7);
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    white-space: nowrap;
}

.progress-step-compact.active span {
    color: var(--sbt-white);
    font-weight: 600;
}

/* Responsive Design */
@media (max-width: 1024px) {
    .sbt-brand-right {
        display: none;
    }
}

@media (max-width: 768px) {
    .sbt-brand-header {
        padding: 12px 20px;
    }

    .sbt-brand-logo {
        height: 50px;
    }

    .sbt-company-name {
        font-size: 16px;
        letter-spacing: 1px;
    }

    .sbt-app-name {
        font-size: 11px;
    }
}

@media (max-width: 480px) {
    .sbt-brand-left {
        gap: 8px;
    }

    .sbt-brand-logo {
        height: 40px;
    }

    .sbt-company-name {
        font-size: 14px;
    }

    .sbt-app-name {
        font-size: 10px;
    }
}

.container {
    max-width: 1400px;
    width: calc(100% - 40px);
    margin: 10px auto;
    padding: 0;
    background: transparent;
    border-radius: 0;
    box-shadow: none;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    min-height: calc(100vh - 120px);
}

/* Compressed Header */
header {
    background: linear-gradient(135deg, var(--sbt-purple-dark) 0%, var(--sbt-purple-darker) 100%);
    color: white;
    padding: 16px 24px 12px;
}

.header-content {
    text-align: center;
    margin-bottom: 10px;
}

header h1 {
    font-size: 24px;
    font-weight: 700;
    letter-spacing: -0.5px;
}

.subtitle {
    font-size: 13px;
    opacity: 0.95;
    font-weight: 500;
}

/* Compact Progress Tracker */
.progress-tracker {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 600px;
    margin: 0 auto;
    padding: 0 16px;
}

.progress-step {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    position: relative;
}

.progress-dot {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.3);
    border: 2px solid rgba(255, 255, 255, 0.5);
    transition: all 0.3s ease;
    position: relative;
}

.progress-step.active .progress-dot {
    background: var(--sbt-purple-light);
    border-color: var(--sbt-purple-light);
    box-shadow: 0 0 0 3px rgba(128, 90, 213, 0.4);
    transform: scale(1.1);
}

.progress-step.completed .progress-dot {
    background: var(--sbt-purple-darker);
    border-color: var(--sbt-purple-darker);
}

.progress-step.completed .progress-dot::after {
    content: '✓';
    position: absolute;
    color: white;
    font-size: 14px;
    font-weight: bold;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

.progress-step span {
    font-size: 11px;
    font-weight: 600;
    opacity: 0.9;
}

.progress-line {
    flex: 1;
    height: 2px;
    background: rgba(255, 255, 255, 0.3);
    margin: 0 -8px;
    margin-bottom: 16px;
}

/* Quality Indicators (Step 5.3) */
.quality-badge {
    position: absolute;
    top: -8px;
    right: -12px;
    min-width: 32px;
    padding: 2px 6px;
    border-radius: 10px;
    font-size: 10px;
    font-weight: 700;
    text-align: center;
    color: white;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
    transition: all 0.3s ease;
    z-index: 10;
}

/* Status-based colors */
.quality-badge.quality-incomplete {
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
    border: 1px solid rgba(255, 255, 255, 0.3);
}

.quality-badge.quality-good {
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
    border: 1px solid rgba(255, 255, 255, 0.3);
}

.quality-badge.quality-excellent {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    border: 1px solid rgba(255, 255, 255, 0.3);
}

/* Hover effect for quality badges */
.quality-badge:hover {
    transform: scale(1.1);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
    cursor: help;
}

/* Main Content Area - EXPANDED */
.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

#chat-container {
    flex: 1;
    padding: 16px 20px;
    overflow-y: auto;
    background: transparent;
    min-height: 300px;
}

#chat-messages {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
    max-width: 720px;
    margin: 0 auto;
    padding: 1rem 20px;
}

/* Message Styles - Base (minimal - specific styles in .user and .assistant) */
.message {
    animation: slideIn 0.3s ease;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.message.user {
    background: #8b5cf6;
    color: white;
    max-width: 70%;
    min-width: 60px;
    width: fit-content;
    margin-left: auto;
    margin-right: 0.5rem;
    padding: 0.5rem 0.875rem;
    border-radius: 1rem;
    border-bottom-right-radius: 0.25rem;
    box-shadow: 0 1px 2px rgba(0,0,0,0.06);
    line-height: 1.5;
    font-size: 0.9375rem;
    align-self: flex-end;
}

.message.assistant {
    display: flex;
    gap: 0.75rem;
    align-items: flex-start;
    align-self: flex-start;
    background: transparent;
    padding: 0;
    border: none;
    box-shadow: none;
    max-width: 85%;
}

.message-avatar {
    width: 1.75rem;
    height: 1.75rem;
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    margin-top: 0.25rem;
    color: white;
    font-size: 0.75rem;
}

.message-content {
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: 0.875rem;
    border-top-left-radius: 0.25rem;
    padding: 0.75rem 1rem;
    box-shadow: 0 1px 2px rgba(0,0,0,0.04);
    color: #334155;
    line-height: 1.5;
    font-size: 0.9375rem;
    font-family: Georgia, "Times New Roman", Times, serif;
    width: fit-content;
    max-width: 100%;
}

/* Streaming State - Smooth Transitions */
[data-streaming="true"] .message-content {
    background-color: var(--surface);
    opacity: 0.95;
}

[data-streaming="false"] .message-content {
    opacity: 1;
}

/* Assistant message typography - Claude-style formatting */
.message.assistant p,
.message-content p {
    margin: 0 0 1em 0;
    line-height: 1.6;
}

.message.assistant p:last-child,
.message-content p:last-child {
    margin-bottom: 0;
}

/* Welcome Heading - Brand Styled */
.message.assistant .welcome-heading,
.message-content .welcome-heading {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu', 'Cantarell', sans-serif;
    font-size: 24px;
    font-weight: 700;
    letter-spacing: 0.5px;
    color: var(--sbt-black);
    margin-bottom: 1em;
    line-height: 1.3;
}

.message.assistant .welcome-heading .brand-name,
.message-content .welcome-heading .brand-name {
    color: var(--sbt-purple-dark);
    font-weight: 700;
}

.message.assistant strong,
.message-content strong {
    font-weight: 700;
    color: #1a1a1a;
}

.message.assistant ul,
.message.assistant ol,
.message-content ul,
.message-content ol {
    margin: 0.6em 0 1em 1.5em;
    padding: 0;
}

.message.assistant li,
.message-content li {
    margin: 0.3em 0;
    line-height: 1.5;
}

.message.assistant h1,
.message.assistant h2,
.message.assistant h3,
.message-content h1,
.message-content h2,
.message-content h3 {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', sans-serif;
    font-weight: 600;
    margin: 1em 0 0.5em 0;
    line-height: 1.3;
}

.message.assistant h1,
.message-content h1 {
    font-size: 1.5em;
}

.message.assistant h2,
.message-content h2 {
    font-size: 1.3em;
}

.message.assistant h3,
.message-content h3 {
    font-size: 1.1em;
}

/* System/Initialization Message - Matches loading indicator style */
.message.system {
    display: none;  /* Hide the old yellow style completely */
}

/* Initialization Indicator - Same style as loading indicator */
.init-indicator {
    display: flex;
    justify-content: flex-start;
    padding: 0 20px;
    max-width: 720px;
    margin: 0 auto;
    animation: slideIn 0.3s ease;
}

.init-indicator .agent-loading-pill {
    display: inline-flex;
    align-items: center;
    gap: 1rem;
    padding: 0.625rem 1.25rem;
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: 1.25rem;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}

.init-indicator .agent-loading-name {
    font-size: 0.8125rem;
    font-weight: 600;
    color: #7c3aed;
    letter-spacing: 0.01em;
}

.init-indicator .agent-loading-content {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.init-indicator .agent-loading-dots {
    display: flex;
    align-items: center;
    gap: 0.2rem;
}

.init-indicator .agent-loading-dot {
    width: 0.375rem;
    height: 0.375rem;
    background: #8b5cf6;
    border-radius: 50%;
    animation: wave 1.4s ease-in-out infinite;
}

.init-indicator .agent-loading-dot:nth-child(1) { animation-delay: 0s; }
.init-indicator .agent-loading-dot:nth-child(2) { animation-delay: 0.12s; }
.init-indicator .agent-loading-dot:nth-child(3) { animation-delay: 0.24s; }
.init-indicator .agent-loading-dot:nth-child(4) { animation-delay: 0.36s; }
.init-indicator .agent-loading-dot:nth-child(5) { animation-delay: 0.48s; }

.init-indicator .agent-loading-message {
    font-size: 0.8125rem;
    color: #64748b;
    font-weight: 400;
}

/* ============================================
   LOADING INDICATOR - Single Unified Pill
   ============================================ */

#loading-indicator {
    display: none;
    justify-content: flex-start;
    padding: 0 20px;
    max-width: 720px;
    margin: 0 auto;
}

#loading-indicator.agent-loading {
    display: flex;
}

/* Single unified pill container */
.agent-loading-pill {
    display: inline-flex;
    align-items: center;
    gap: 1rem;
    padding: 0.625rem 1.25rem;
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: 1.25rem;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}

/* Agent name label */
.agent-loading-name {
    font-size: 0.8125rem;
    font-weight: 600;
    color: #7c3aed;
    letter-spacing: 0.01em;
}

/* Dots + message container */
.agent-loading-content {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

/* Dots container */
.agent-loading-dots {
    display: flex;
    align-items: center;
    gap: 0.2rem;
}

/* Individual dot - WAVE animation */
.agent-loading-dot {
    width: 0.375rem;
    height: 0.375rem;
    background: #8b5cf6;
    border-radius: 50%;
    animation: wave 1.4s ease-in-out infinite;
}

.agent-loading-dot:nth-child(1) { animation-delay: 0s; }
.agent-loading-dot:nth-child(2) { animation-delay: 0.12s; }
.agent-loading-dot:nth-child(3) { animation-delay: 0.24s; }
.agent-loading-dot:nth-child(4) { animation-delay: 0.36s; }
.agent-loading-dot:nth-child(5) { animation-delay: 0.48s; }

/* Status message */
.agent-loading-message {
    font-size: 0.8125rem;
    color: #64748b;
    font-weight: 400;
}

/* WAVE ANIMATION - translateY for bouncing effect */
@keyframes wave {
    0%, 100% {
        transform: translateY(0);
        opacity: 0.4;
    }
    50% {
        transform: translateY(-6px);
        opacity: 1;
    }
}

/* Legacy spinner - kept for backward compatibility */
.loading-spinner {
    width: 20px;
    height: 20px;
    border: 2px solid var(--border);
    border-top-color: var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* OLD Input Section - DEPRECATED (kept for backward compatibility) */
.input-section {
    display: none;  /* Hidden - using new .sbt-input-section instead */
}

.input-area {
    display: none;  /* Hidden - using new .sbt-input-container instead */
}

/* OLD user-input styles - DEPRECATED */
#user-input-old {
    flex: 1;
    padding: 12px 14px;
    border: 1px solid var(--border);
    border-radius: 8px;
    font-size: 14px;
    font-family: inherit;
    resize: none;
    transition: border-color 0.2s;
    line-height: 1.5;
    height: 70px;
    max-height: 120px;
}

#user-input-old:focus {
    outline: none;
    border-color: var(--primary-color);
}

/* User Input - Base Styling */
#user-input {
    flex: 1;
    padding: 0.75rem 1rem;
    border: 1px solid var(--border);
    border-radius: 1.5rem;
    font-size: 1rem;
    background: #f8fafc;
    color: var(--text-primary);
    outline: none;
    transition: border-color 0.15s ease, box-shadow 0.15s ease, background-color 0.15s ease;
}

#user-input::placeholder {
    color: #94a3b8;
}

#user-input:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(124, 58, 237, 0.1);
    background: white;
}

#user-input:disabled {
    background: var(--background);
    cursor: not-allowed;
    opacity: 0.6;
}

#send-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 12px 20px;
    border: none;
    border-radius: 8px;
    background: linear-gradient(135deg, var(--sbt-purple-dark) 0%, var(--sbt-purple-darker) 100%);
    color: white;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
    height: 44px;
    box-shadow: 0 4px 12px rgba(107, 70, 193, 0.3);
}

#send-btn:hover:not(:disabled) {
    background: linear-gradient(135deg, var(--sbt-purple-darker) 0%, var(--sbt-purple-light) 100%);
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(107, 70, 193, 0.4);
}

#send-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

.shortcut {
    font-size: 11px;
    opacity: 0.8;
    padding: 2px 5px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 3px;
}

/* Compact Action Panel */
.action-panel {
    background: white;
    border-top: 1px solid var(--border);
    padding: 14px 20px;
}

.status-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
    font-size: 12px;
    color: var(--text-secondary);
    padding: 0 4px;
}

#message-count {
    font-weight: 600;
}

#phase-indicator {
    font-weight: 600;
    color: var(--sbt-purple-dark);
}

.action-buttons {
    display: flex;
    gap: 12px;
    justify-content: center;
    align-items: center;
}

/* Unified Button Styling - All 40px height */
.upload-btn,
.primary-btn,
.secondary-btn {
    height: 40px;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    border: none;
    outline: none;
    white-space: nowrap;
}

/* Upload Document - Subtle style */
.upload-btn {
    background: #f3f4f6;
    color: #374151;
    border: 1px solid #d1d5db;
    padding: 0 16px;
    min-width: 160px;
}

.upload-btn:hover {
    background: #e5e7eb;
    border-color: #9ca3af;
}

/* Generate Summary - Primary action */
.primary-btn {
    background: linear-gradient(135deg, var(--sbt-purple-dark) 0%, var(--sbt-purple-darker) 100%);
    color: white;
    padding: 0 24px;
    min-width: 240px;
    font-weight: 600;
    border: none;
    box-shadow: 0 4px 12px rgba(107, 70, 193, 0.3);
}

.primary-btn:hover:not(:disabled) {
    background: linear-gradient(135deg, var(--sbt-purple-darker) 0%, var(--sbt-purple-light) 100%);
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(107, 70, 193, 0.4);
}

.primary-btn:disabled {
    background: #9ca3af;
    cursor: not-allowed;
    opacity: 0.6;
    transform: none;
    box-shadow: none;
}

/* Start New Session - Outline style */
.secondary-btn {
    background: white;
    color: var(--sbt-purple-dark);
    border: 2px solid var(--sbt-purple-dark);
    padding: 0 16px;
    min-width: 160px;
}

.secondary-btn:hover:not(:disabled) {
    background: var(--sbt-purple-dark);
    border-color: var(--sbt-purple-dark);
    color: white;
}

.secondary-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    background: #e0e0e0;
    border-color: #b0b0b0;
    color: #888;
}

/* Compact Footer */
footer {
    background: var(--surface);
    border-top: 1px solid var(--border);
    padding: 12px 20px;
}

.footer-content {
    text-align: center;
    color: var(--text-secondary);
}

.footer-content p {
    font-size: 12px;
    line-height: 1.5;
    margin: 2px 0;
}

.footer-content strong {
    color: var(--text-primary);
}

.footer-note {
    font-size: 11px;
    opacity: 0.85;
}

/* Modal Styles */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    animation: fadeIn 0.2s ease;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.modal-content {
    background: var(--surface);
    border-radius: 12px;
    max-width: 500px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
    box-shadow: var(--shadow-xl);
    animation: slideUp 0.3s ease;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.modal-header {
    padding: 20px;
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h2 {
    font-size: 20px;
    color: var(--text-primary);
}

.modal-close {
    width: 30px;
    height: 30px;
    border: none;
    background: var(--background);
    border-radius: 6px;
    font-size: 22px;
    cursor: pointer;
    color: var(--text-secondary);
    transition: all 0.2s;
}

.modal-close:hover {
    background: var(--danger-color);
    color: white;
}

.modal-body {
    padding: 20px;
}

.modal-body p {
    margin-bottom: 14px;
    line-height: 1.5;
    font-size: 14px;
}

.modal-body ul {
    margin: 14px 0;
    padding-left: 20px;
}

.modal-body li {
    margin-bottom: 8px;
    line-height: 1.5;
    font-size: 14px;
}

.modal-note {
    margin-top: 14px;
    padding: 10px;
    background: var(--background);
    border-left: 3px solid var(--primary-color);
    font-size: 13px;
    border-radius: 4px;
}

.modal-footer {
    padding: 20px;
    border-top: 1px solid var(--border);
    display: flex;
    gap: 10px;
}

.modal-footer .primary-btn,
.modal-footer .secondary-btn {
    flex: 1;
}

/* Scrollbar Styling */
#chat-container::-webkit-scrollbar,
#drive-results::-webkit-scrollbar {
    width: 6px;
}

#chat-container::-webkit-scrollbar-track,
#drive-results::-webkit-scrollbar-track {
    background: var(--background);
}

#chat-container::-webkit-scrollbar-thumb,
#drive-results::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 3px;
}

#chat-container::-webkit-scrollbar-thumb:hover,
#drive-results::-webkit-scrollbar-thumb:hover {
    background: var(--secondary-color);
}

/* Responsive Design */
@media (max-width: 768px) {
    body {
        padding: 0;
    }
    
    .container {
        border-radius: 0;
        height: 100vh;
    }
    
    header {
        padding: 14px 16px 10px;
    }
    
    header h1 {
        font-size: 20px;
    }
    
    .progress-tracker {
        padding: 0 8px;
    }
    
    .progress-step span {
        font-size: 10px;
    }
    
    .progress-dot {
        width: 20px;
        height: 20px;
    }
    
    .message {
        max-width: 90%;
        font-size: 13px;
    }
    
    .input-section,
    .action-panel {
        padding: 10px 14px;
    }
    
    .action-buttons {
        flex-direction: column;
        width: 100%;
    }
    
    .upload-btn,
    .primary-btn,
    .secondary-btn {
        max-width: 100%;
        width: 100%;
        min-width: auto;
    }
    
    #user-input {
        font-size: 16px; /* Prevents zoom on iOS */
        height: 60px;
    }
}

/* Print Styles */
@media print {
    body {
        background: white;
    }
    
    .container {
        box-shadow: none;
    }
    
    .input-section,
    .action-panel,
    footer {
        display: none;
    }
}

/* ============== VOICE MODE ============== */

.voice-toggle-btn {
    padding: 10px 20px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 20px;
    cursor: pointer;
    font-weight: 600;
    margin-bottom: 10px;
    transition: all 0.3s ease;
}

.voice-toggle-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

.voice-toggle-btn.active {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
}

.voice-container {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 12px;
    padding: 24px;
    color: white;
    margin-bottom: 20px;
}

.voice-container.hidden {
    display: none;
}

.voice-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 16px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
}

.voice-status {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 20px;
}

.status-light {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: #9ca3af;
}

.status-light.connecting {
    background: #fbbf24;
    animation: pulse 2s infinite;
}

.status-light.listening {
    background: #10b981;
    animation: pulse 2s infinite;
}

.status-light.speaking {
    background: #3b82f6;
    animation: pulse 2s infinite;
}

.status-light.error {
    background: #ef4444;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

.voice-transcript {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 8px;
    padding: 20px;
    min-height: 300px;
    max-height: 400px;
    overflow-y: auto;
    margin-bottom: 20px;
    color: #1f2937;
}

.transcript-bubble {
    margin-bottom: 12px;
    animation: fadeIn 0.3s ease-in;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.transcript-bubble.user {
    text-align: right;
}

.transcript-bubble .speaker {
    font-size: 12px;
    font-weight: 600;
    margin-bottom: 4px;
    color: #6b7280;
}

.transcript-bubble .text {
    display: inline-block;
    background: #f3f4f6;
    padding: 10px 14px;
    border-radius: 10px;
    font-size: 14px;
    max-width: 80%;
}

.transcript-bubble.user .text {
    background: #ddd6fe;
}

.transcript-bubble.assistant .text {
    background: #e0e7ff;
}

.voice-controls {
    display: flex;
    justify-content: center;
    gap: 12px;
    margin-bottom: 20px;
}

.voice-btn {
    padding: 14px 28px;
    border: none;
    border-radius: 50px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.voice-btn.start {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: white;
}

.voice-btn.stop {
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
    color: white;
}

.voice-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.2);
}

.voice-btn.hidden {
    display: none;
}

.voice-instructions {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    padding: 16px;
}

.voice-instructions p {
    margin: 0 0 8px 0;
    font-weight: 600;
}

.voice-instructions ul {
    margin: 0;
    padding-left: 20px;
}

.voice-instructions li {
    margin: 4px 0;
    font-size: 14px;
}

.hidden {
    display: none;
}

/* ============================================================================
   PROGRESSIVE ARTIFACTS PANEL - Step 4.1
   ============================================================================ */

.artifacts-panel {
    display: none;
    background: rgba(255, 255, 255, 0.95);
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    margin: 20px 0;
    overflow: hidden;
    transition: all 0.3s ease;
}

/* Show artifacts panel only when explicitly activated */
.artifacts-panel.show,
.artifacts-panel.active {
    display: block;
}

.artifacts-panel.collapsed .artifacts-content {
    max-height: 0;
    overflow: hidden;
}

.panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    cursor: pointer;
}

.panel-header h3 {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
}

.toggle-btn {
    background: rgba(0, 0, 0, 0.1);
    border: 2px solid rgba(0, 0, 0, 0.2);
    border-radius: 50%;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.toggle-btn:hover {
    background: rgba(0, 0, 0, 0.2);
    border-color: rgba(0, 0, 0, 0.3);
    transform: scale(1.1);
}

.toggle-icon {
    font-size: 24px;
    font-weight: bold;
    color: #374151;
    line-height: 1;
}

.artifacts-content {
    padding: 20px;
    max-height: 600px;
    overflow-y: auto;
    transition: max-height 0.3s ease;
}

.artifact-card {
    background: white;
    border-radius: 8px;
    padding: 20px;
    border: 1px solid #e5e7eb;
}

.artifact-card h1 {
    font-size: 22px;
    color: #667eea;
    margin: 0 0 8px 0;
    padding-bottom: 8px;
    border-bottom: 2px solid #764ba2;
}

.artifact-card h2 {
    font-size: 18px;
    color: #764ba2;
    margin: 20px 0 12px 0;
    padding-bottom: 6px;
    border-bottom: 1px solid #e5e7eb;
}

.artifact-card h3 {
    font-size: 16px;
    color: #667eea;
    margin: 16px 0 8px 0;
}

.artifact-card p {
    margin: 8px 0;
    line-height: 1.6;
    color: #374151;
}

.artifact-card .last-updated {
    font-size: 13px;
    color: #6b7280;
    font-style: italic;
    margin: 4px 0 16px 0;
}

.artifact-card ul,
.artifact-card ol {
    margin: 8px 0;
    padding-left: 24px;
}

.artifact-card li {
    margin: 6px 0;
    line-height: 1.5;
    color: #374151;
}

.artifact-card strong {
    color: #1f2937;
    font-weight: 600;
}

.artifact-card em {
    color: #6b7280;
}

.artifact-card hr {
    border: none;
    border-top: 1px solid #e5e7eb;
    margin: 16px 0;
}

.artifact-loading {
    text-align: center;
    color: #6b7280;
    padding: 40px 20px;
    font-style: italic;
}

/* ============================================================================
   ARTIFACT TABS - Step 4.2
   ============================================================================ */

.artifact-tabs {
    display: flex;
    background: #f3f4f6;
    border-bottom: 1px solid #e5e7eb;
}

.tab-btn {
    flex: 1;
    padding: 12px 20px;
    border: none;
    background: transparent;
    color: #6b7280;
    font-weight: 500;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s ease;
    border-bottom: 3px solid transparent;
}

.tab-btn:hover {
    background: rgba(102, 126, 234, 0.1);
    color: #667eea;
}

.tab-btn.active {
    color: #667eea;
    background: white;
    border-bottom-color: #667eea;
    font-weight: 600;
}

.artifact-card {
    display: none;
}

.artifact-card.active {
    display: block;
}

/* ============================================================================
   FLOATING ARTIFACTS PANEL - Mobile-First
   ============================================================================ */

.artifacts-panel {
    position: fixed;
    right: -420px;
    top: 0;
    width: 400px;
    height: 100vh;
    background: white;
    box-shadow: -4px 0 20px rgba(0,0,0,0.15);
    transition: right 0.3s ease-in-out;
    z-index: 1000;
    overflow-y: auto;
    padding: 20px;
}

.artifacts-panel.open {
    right: 0;
}

@media (max-width: 768px) {
    .artifacts-panel {
        right: auto;
        bottom: -70vh;
        left: 0;
        width: 100%;
        height: 70vh;
        border-radius: 16px 16px 0 0;
        transition: bottom 0.3s ease-in-out;
    }

    .artifacts-panel.open {
        bottom: 0;
        right: auto;
    }
}

/* ========================================
   FINAL POLISH - PROFESSIONAL TOUCHES
   ======================================== */

/* Smooth Scrolling */
html {
    scroll-behavior: smooth;
}

/* Enhanced Typography */
body {
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Links */
a {
    color: var(--sbt-purple-dark);
    text-decoration: none;
    transition: color 0.2s ease;
}

a:hover {
    color: var(--sbt-purple-light);
    text-decoration: underline;
}

/* Focus States (Accessibility) */
button:focus,
input:focus,
textarea:focus,
select:focus {
    outline: 3px solid var(--sbt-purple-light);
    outline-offset: 2px;
}

/* Loading States */
.loading {
    position: relative;
}

.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 40px;
    height: 40px;
    border: 4px solid rgba(107, 70, 193, 0.2);
    border-top-color: var(--sbt-purple-dark);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: translate(-50%, -50%) rotate(360deg); }
}

/* Error Messages */
.error-message {
    background: #fee;
    border-left: 4px solid #c33;
    color: #c33;
    padding: 12px 16px;
    border-radius: 4px;
    margin: 10px 0;
}

/* Success Messages */
.success-message {
    background: #efe;
    border-left: 4px solid #3c3;
    color: #3c3;
    padding: 12px 16px;
    border-radius: 4px;
    margin: 10px 0;
}

/* Enhanced Card Shadows */
.card,
.message-card,
.artifact-card {
    transition: box-shadow 0.3s ease, transform 0.2s ease;
}

.card:hover,
.message-card:hover,
.artifact-card:hover {
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.12);
    transform: translateY(-2px);
}

/* Print Styles */
@media print {
    .sbt-brand-header,
    .btn-primary,
    .btn-secondary,
    .secondary-btn,
    .upload-btn,
    button {
        display: none;
    }

    body {
        background: white;
        color: black;
    }

    .container {
        box-shadow: none;
        border: 1px solid #ccc;
    }
}

/* Responsive Enhancements */
@media (max-width: 1440px) {
    .container {
        width: 92%;
    }
}

@media (max-width: 1024px) {
    .container {
        width: 90%;
    }
    
    .sbt-brand-container {
        padding: 0 20px;
    }
}

@media (max-width: 480px) {
    .container {
        width: 100%;
        margin: 10px auto;
        border-radius: 8px;
    }
}

/* ========================================
   FIXED INPUT SECTION - Light Glass Design
   ======================================== */

.sbt-input-section {
    position: fixed;
    bottom: 70px;
    left: 50%;
    transform: translateX(-50%);
    width: calc(100% - 48px);
    max-width: 800px;
    z-index: 999;
    background: rgba(255, 255, 255, 0.7);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid rgba(139, 92, 246, 0.2);
    border-radius: 16px;
    padding: 10px 14px;
    box-shadow:
        0 4px 24px rgba(107, 70, 193, 0.08),
        0 1px 3px rgba(0, 0, 0, 0.05);
}

.sbt-input-container {
    display: flex;
    gap: 10px;
    align-items: flex-end;
}

.sbt-input-container textarea {
    flex: 1;
    padding: 10px 14px;
    background: rgba(255, 255, 255, 0.8);
    border: 1px solid rgba(139, 92, 246, 0.25);
    border-radius: 12px;
    font-size: 14px;
    font-family: inherit;
    color: #1e293b;
    resize: none;
    transition: all 0.2s ease;
    line-height: 1.5;
    min-height: 40px;
    max-height: 100px;
}

.sbt-input-container textarea::placeholder {
    color: #94a3b8;
}

.sbt-input-container textarea:focus {
    outline: none;
    background: #fff;
    border-color: var(--sbt-purple-light);
    box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.1);
}

.sbt-input-container textarea:disabled {
    background: rgba(255, 255, 255, 0.4);
    color: #94a3b8;
    cursor: not-allowed;
}

.sbt-input-container button {
    padding: 10px 20px;
    background: linear-gradient(135deg, var(--sbt-purple-light) 0%, var(--sbt-purple-dark) 100%);
    color: white;
    border: none;
    border-radius: 10px;
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 6px;
    min-height: 40px;
    box-shadow: 0 2px 8px rgba(107, 70, 193, 0.3);
}

.sbt-input-container button:hover:not(:disabled) {
    background: linear-gradient(135deg, var(--sbt-purple-dark) 0%, var(--sbt-purple-darker) 100%);
    transform: translateY(-1px);
    box-shadow: 0 4px 16px rgba(107, 70, 193, 0.4);
}

.sbt-input-container button:disabled {
    opacity: 0.4;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.sbt-input-container button .shortcut {
    font-size: 11px;
    opacity: 0.8;
    background: rgba(255, 255, 255, 0.2);
    padding: 2px 6px;
    border-radius: 4px;
}

/* ========================================
   TOOLBAR ACTIONS - Rounded Pill Buttons
   ======================================== */

.toolbar-actions {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 0.5rem;
    padding: 0.5rem 0;
}

.toolbar-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.625rem 1rem;
    background: #f1f5f9;
    color: #475569;
    border: 1px solid #e2e8f0;
    border-radius: 9999px;
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.15s ease;
}

.toolbar-btn:hover {
    background: #ede9fe;
    color: var(--primary-color);
    border-color: #c4b5fd;
}

.toolbar-btn:disabled {
    background: #f8fafc;
    color: #cbd5e1;
    border-color: #f1f5f9;
    cursor: not-allowed;
}

.toolbar-btn.primary {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

.toolbar-btn.primary:hover {
    background: var(--primary-dark);
    border-color: var(--primary-dark);
}

.toolbar-btn svg {
    width: 1rem;
    height: 1rem;
}

/* ========================================
   STICKY ACTION FOOTER
   ======================================== */

.sbt-action-footer {
    position: fixed;  /* Changed from sticky to fixed - always visible at bottom */
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 1000;  /* Above input section */
    background: linear-gradient(180deg, rgba(107, 70, 193, 0.95) 0%, rgba(85, 60, 154, 0.95) 100%);
    border-top: 2px solid rgba(128, 90, 213, 0.5);
    padding: 12px 20px;
    box-shadow: 0 -2px 8px rgba(0, 0, 0, 0.1);
    backdrop-filter: blur(10px);
    /* Fix footer visibility - ensure content not cut off */
    height: auto;
    min-height: 70px;  /* Increased from 60px */
    max-height: 120px;
    overflow: visible;  /* Important - don't clip content */
}

.sbt-footer-container {
    max-width: 1400px;
    margin: 0 auto;
    display: flex;
    gap: 12px;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
}

.footer-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    background: rgba(255, 255, 255, 0.15);
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 8px;
    color: white;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.footer-btn:hover:not(:disabled) {
    background: rgba(255, 255, 255, 0.25);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.footer-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    background: rgba(100, 100, 100, 0.3);
    border-color: rgba(150, 150, 150, 0.3);
    transform: none;
}

.footer-btn-primary {
    background: rgba(128, 90, 213, 0.9);
    border: 1px solid rgba(255, 255, 255, 0.5);
}

.footer-btn-primary:hover {
    background: rgba(128, 90, 213, 1);
}

.footer-btn span {
    font-size: 16px;
}

@media (max-width: 768px) {
    .sbt-input-section {
        width: calc(100% - 24px);
        padding: 8px 12px;
        bottom: 65px;
        border-radius: 12px;
    }

    .sbt-input-container {
        gap: 8px;
    }

    .sbt-input-container textarea {
        font-size: 16px;  /* Prevents zoom on iOS */
        padding: 10px 12px;
        min-height: 38px;
    }

    .sbt-input-container button {
        padding: 10px 16px;
        font-size: 14px;
        min-height: 38px;
    }

    .sbt-action-footer {
        padding: 10px 15px;
        min-height: 60px;
    }

    .sbt-footer-container {
        gap: 8px;
    }

    .footer-btn {
        padding: 8px 16px;
        font-size: 13px;
    }

    .footer-btn span {
        font-size: 14px;
    }
}

@media (max-width: 480px) {
    .sbt-input-section {
        width: calc(100% - 16px);
        border-radius: 10px;
    }

    .footer-btn {
        padding: 8px 12px;
        font-size: 12px;
        flex: 1;
        min-width: 140px;
    }
}

/* ============================================
   WELCOME MESSAGE - Tighter Spacing
   Applied via .welcome-message class
   ============================================ */

.message.assistant.welcome-message .message-content {
    padding: 0.5rem 0.875rem;
}

.message.assistant.welcome-message .message-content p {
    margin: 0 0 0.35em 0 !important;
    line-height: 1.35 !important;
}

.message.assistant.welcome-message .message-content ul,
.message.assistant.welcome-message .message-content ol {
    margin: 0.2em 0 0.35em 1.25em !important;
}

.message.assistant.welcome-message .message-content li {
    margin: 0.08em 0 !important;
    line-height: 1.3 !important;
}

.message.assistant.welcome-message .message-content h2,
.message.assistant.welcome-message .message-content h3,
.message.assistant.welcome-message .message-content strong {
    margin-top: 0.4em !important;
    margin-bottom: 0.15em !important;
}

.message.assistant.welcome-message .message-content .welcome-heading {
    font-size: 19px !important;
    margin-bottom: 0.3em !important;
}
