/* ===================================================================
   CHATBOT INTERFACE - MAIN STYLESHEET
   ================================================================= */

/* ===================================================================
   1. CSS VARIABLES & THEME SYSTEM
   ================================================================= */
:root {
    /* Color Palette - Dark Theme */
    --bg-scrollable-window-dark: #212121;
    --bg-scrollable-window-light: #f7f2ed;
    --user-msg-bg-dark: #3660d3;
    --user-msg-text-dark: #ffffff;
    --user-msg-bg-light: #6c87d1;
    --user-msg-text-light: #ffffff;
    --bot-msg-bg-dark: #374151;
    --bot-msg-bg-light: #ffffff;
    --bot-msg-text-dark: #f3f4f6;
    --bot-msg-text-light: #333538;
    --main-bg-dark: #212121;
    --main-bg-light: #f7f2ed;
    --sidebar-bg-dark: #181818;
    --sidebar-bg-light: #ffeedd;
    --border-dark: #949494;
    --border-light: #c2c2c2;
    --text-dark: #f9fafb;
    --text-light: #1f2124;
    --text-secondary-dark: #9ca3af;
    --text-secondary-light: #6b7280;
    --hover-dark: #374151;
    --hover-light: #f3f4f6;
    --shadow-dark: 0 4px 6px -1px rgba(0, 0, 0, 0.3);
    --shadow-light: 0 4px 6px -1px rgba(0, 0, 0, 0.1);

    /* Layout Variables for Dynamic Sizing */
    --sidebar-width: 320px;
    --sidebar-collapsed-width: 60px;
    --header-height: clamp(60px, 8vh, 80px);
    --input-area-height: clamp(80px, 12vh, 120px);
    /* Add this line */
    --max-content-width: 1000px;

    /* Responsive Breakpoints */
    --mobile-breakpoint: 768px;
    --tablet-breakpoint: 1024px;
    --desktop-breakpoint: 1200px;
}

/* ===================================================================
   2. RESET & BASE STYLES
   ================================================================= */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    font-size: clamp(14px, 1.5vw, 16px);
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', sans-serif;
    background-color: var(--main-bg-dark);
    color: var(--text-dark);
    transition: all 0.3s ease;
    overflow: hidden;
    min-height: 100vh;
}

body.light-theme {
    background-color: var(--main-bg-light);
    color: var(--text-light);
}

/* ===================================================================
   3. MAIN LAYOUT SYSTEM
   ================================================================= */

/* App Container - Main Grid Layout */
.app-container {
    display: grid;
    grid-template-columns: var(--sidebar-width) 1fr;
    height: 100vh;
    overflow: hidden;
    transition: grid-template-columns 0.3s ease;
}

.app-container.sidebar-collapsed {
    grid-template-columns: var(--sidebar-collapsed-width) 1fr;
}

/* ===================================================================
   4. SIDEBAR COMPONENT
   ================================================================= */
.sidebar {
    width: var(--sidebar-width);
    background-color: var(--sidebar-bg-dark);
    display: flex;
    flex-direction: column;
    transition: all 0.3s ease;
    overflow: hidden;
}

.sidebar.collapsed {
    width: var(--sidebar-collapsed-width);
}

.light-theme .sidebar {
    background-color: var(--sidebar-bg-light);
    border-right-color: var(--border-light);
}

.sidebar.collapsed .sidebar-header {
    padding: 1rem 0.5rem;
}

.sidebar.collapsed .new-chat-btn,
.sidebar.collapsed .conversation-list,
.sidebar.collapsed .sidebar-footer {
    display: none;
}

.sidebar.collapsed .sidebar-toggle {
    margin: 0 auto;
}

/* Sidebar Header */
.sidebar-header {
    padding: 1rem;
    display: flex;
    gap: 0.5rem;
    align-items: center;
    min-height: calc(var(--header-height) * 0.8);
}

.light-theme .sidebar-header {
    border-bottom-color: var(--border-light);
}

/* New Chat Button */
.new-chat-btn {
    flex: 1;
    background-color: transparent;
    color: var(--text-dark);
    border: 1px solid var(--border-dark);
    padding: 0.75rem 1rem;
    border-radius: 0.5rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.875rem;
    font-weight: 500;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.light-theme .new-chat-btn {
    color: var(--text-light);
    border-color: var(--border-light);
}

.new-chat-btn:hover {
    background-color: var(--hover-dark);
    transform: translateY(-1px);
}

.light-theme .new-chat-btn:hover {
    background-color: var(--hover-light);
}

.plus-icon {
    font-size: 1.125rem;
    font-weight: bold;
}

/* Sidebar Toggle */
.sidebar-toggle {
    background: none;
    border: none;
    color: var(--text-dark);
    font-size: 1.125rem;
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 0.375rem;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    min-width: 2.5rem;
    height: 2.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

.light-theme .sidebar-toggle {
    color: var(--text-light);
}

.sidebar-toggle:hover {
    background-color: var(--hover-dark);
    transform: scale(1.1) rotate(90deg);
}

.light-theme .sidebar-toggle:hover {
    background-color: var(--hover-light);
}

/* Conversation List */
.conversation-list {
    flex: 1;
    overflow-y: auto;
    padding: 0.5rem;
}

.conversation-item {
    padding: 0.75rem 1rem;
    margin-bottom: 0.25rem;
    border-radius: 0.5rem;
    cursor: pointer;
    transition: all 0.3s ease;
    opacity: 0;
    transform: translateX(-20px);
    animation: slideInFromLeft 0.3s ease-out forwards;
}

.conversation-item:hover {
    background-color: var(--hover-dark);
}

.light-theme .conversation-item:hover {
    background-color: var(--hover-light);
}

.conversation-item.active {
    background-color: var(--user-msg-bg-dark) !important;
    color: white !important;
    opacity: 1 !important;
    transform: translateX(0) !important;
    animation: none !important;
    position: relative;
    overflow: hidden;
}

.conversation-item.active::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    height: 100%;
    width: 6px;
    background: linear-gradient(180deg, #607cf8 0%, #764ba2 100%);
    animation: activeBarSlide 0.3s ease-out;
}

.light-theme .conversation-item.active {
    background-color: var(--user-msg-bg-light) !important;
}

.conversation-title {
    font-weight: 500;
    font-size: 0.875rem;
    margin-bottom: 0.25rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.conversation-preview {
    font-size: 0.75rem;
    color: var(--text-secondary-dark);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.light-theme .conversation-preview {
    color: var(--text-secondary-light);
}

.conversation-item.active .conversation-preview {
    color: rgba(255, 255, 255, 0.8);
}

/* Sidebar Footer */
.sidebar-footer {
    padding: 1rem;
}

.light-theme .sidebar-footer {
    border-top-color: var(--border-light);
}

/* Theme Toggle */
.theme-toggle {
    display: flex;
    justify-content: center;
}

.theme-checkbox {
    display: none;
}

.theme-label {
    background-color: var(--border-dark);
    border-radius: 1.25rem;
    padding: 0.375rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: all 0.3s ease;
    position: relative;
    width: 4rem;
    height: 2rem;
    justify-content: space-between;
}

.light-theme .theme-label {
    background-color: var(--border-light);
}

.theme-icon-dark,
.theme-icon-light {
    font-size: 0.875rem;
    transition: all 0.3s ease;
    z-index: 2;
}

.theme-label::before {
    content: '';
    position: absolute;
    width: 1.5rem;
    height: 1.5rem;
    background-color: var(--text-dark);
    border-radius: 50%;
    transition: all 0.3s ease;
    left: 0.25rem;
    z-index: 1;
}

.light-theme .theme-label::before {
    background-color: var(--text-light);
    transform: translateX(2rem);
}

/* ===================================================================
   5. MAIN CONTENT AREA
   ================================================================= */
.main-content {
    display: flex;
    flex-direction: column;
    overflow: hidden;
    min-width: 0;
    /* Prevents flex item from overflowing */
}

/* Header */
.header {
    display: flex;
    align-items: center;
    padding: 1rem 1.5rem;
    background-color: var(--main-bg-dark);
    min-height: var(--header-height);
    gap: 1rem;
    flex-wrap: wrap;
}

.light-theme .header {
    background-color: var(--main-bg-light);
    border-bottom-color: var(--border-light);
}

.mobile-sidebar-toggle {
    display: none;
    background: none;
    border: none;
    color: var(--text-dark);
    font-size: 1.25rem;
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 0.375rem;
    min-width: 2.5rem;
    height: 2.5rem;
    align-items: center;
    justify-content: center;
}

.light-theme .mobile-sidebar-toggle {
    color: var(--text-light);
}

.bot-name {
    font-size: clamp(1.25rem, 4vw, 1.5rem);
    font-weight: 700;
    text-align: center;
    margin: 0 auto;
    background: var(--bot-msg-text-dark);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    flex-shrink: 0;
}

.light-theme .bot-name {
    background: var(--bot-msg-text-light);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-shrink: 0;
    flex-wrap: wrap;
}

/* Session Timer */
.session-timer {
    display: flex;
    align-items: center;
    background-color: var(--hover-dark);
    padding: 0.5rem 0.75rem;
    border-radius: 0.5rem;
    border: 1px solid var(--border-dark);
    font-size: 0.875rem;
    gap: 0.5rem;
    min-width: fit-content;
    justify-content: center;
}

.light-theme .session-timer {
    background-color: var(--hover-light);
    border-color: var(--border-light);
}

.session-timer .timer-icon {
    animation: none !important;
}

.timer-icon {
    font-size: 1rem;
    opacity: 0.8;
    flex-shrink: 0;
}

.timer-text {
    font-family: monospace;
    font-weight: bold;
    color: var(--text-dark);
    font-size: 0.875rem;
    letter-spacing: 0.03125rem;
    flex-shrink: 0;
}

.light-theme .timer-text {
    color: var(--text-light);
}

/* Participant Display */
.participant-display {
    display: flex;
    align-items: center;
    background-color: var(--hover-dark);
    padding: 0.5rem 0.75rem;
    border-radius: 0.375rem;
    border: 1px solid var(--border-dark);
    font-size: 0.875rem;
    gap: 0.5rem;
    min-width: fit-content;
}

.light-theme .participant-display {
    background-color: var(--hover-light);
    border-color: var(--border-light);
}

/* Save Button */
.save-btn {
    background-color: transparent;
    color: var(--text-dark);
    border: 1px solid var(--border-dark);
    padding: 0.625rem 1rem;
    border-radius: 0.5rem;
    cursor: pointer;
    font-size: 1rem;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    position: relative;
    overflow: hidden;
}

.light-theme .save-btn {
    color: var(--text-light);
    border-color: var(--border-light);
}

.save-btn:hover {
    background-color: var(--hover-dark);
    transform: translateY(-1px);
}

.light-theme .save-btn:hover {
    background-color: var(--hover-light);
}

/* ===================================================================
   6. WELCOME MODAL SYSTEM
   ================================================================= */
.modal {
    display: flex;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    justify-content: center;
    align-items: center;
    backdrop-filter: blur(4px);
    animation: modalFadeIn 0.4s ease-out;
}

.welcome-modal-content {
    max-width: 650px;
    max-height: min(90vh, 800px);
    width: 650px;
    height: auto;
    min-height: 500px;
    padding: 30px;
    display: flex;
    flex-direction: column;
    gap: 20px;
    border-radius: 12px;
    background: var(--main-bg-dark);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    border: 1px solid var(--border-dark);
    animation: modalSlideIn 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.light-theme .welcome-modal-content {
    background: var(--main-bg-light);
    border: 1px solid var(--border-light);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
}

#welcome-title {
    text-align: center;
    margin: 0 0 0.9375rem 0;
    color: var(--text-dark);
    font-size: clamp(1.25rem, 4vw, 1.5rem);
    font-weight: 600;
}

.light-theme #welcome-title {
    color: var(--text-light);
}

.welcome-content-container {
    position: relative;
    min-height: 400px;
    overflow: hidden;
    flex: 1;
    border-radius: 0.5rem;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.05);
    display: flex;
    flex-direction: column;
}

.light-theme .welcome-content-container {
    background: rgba(0, 0, 0, 0.02);
    border: 1px solid rgba(0, 0, 0, 0.05);
}

.welcome-slide-area {
    position: relative;
    flex: 1;
    overflow: hidden;
}

.welcome-slide-content {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    transform: translateX(100%);
    transition: all 0.4s ease;
    padding: 1.5625rem;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    justify-content: center;
    overflow-y: auto;
}

.welcome-slide-content.active {
    opacity: 1;
    transform: translateX(0);
}

.welcome-slide-content.slide-out-left {
    opacity: 0;
    transform: translateX(-100%);
}

.welcome-slide-content.slide-in-right {
    opacity: 0;
    transform: translateX(100%);
}

/* Welcome Content Components */
.welcome-instructions {
    text-align: left;
    padding: 1.25rem;
    border-radius: 0.5rem;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.light-theme .welcome-instructions {
    background: rgba(0, 0, 0, 0.03);
    border: 1px solid rgba(0, 0, 0, 0.1);
}

.welcome-instructions h3 {
    color: var(--text-dark);
    margin: 0 0 1.25rem 0;
    font-size: clamp(1.125rem, 3vw, 1.25rem);
    font-weight: 600;
}

.light-theme .welcome-instructions h3 {
    color: var(--text-light);
}

.welcome-instructions p {
    margin: 0.9375rem 0;
    font-size: clamp(0.875rem, 2.5vw, 1rem);
    line-height: 1.5;
    color: var(--text-dark);
}

.light-theme .welcome-instructions p {
    color: var(--text-light);
}

.welcome-persistent-header {
    background: var(--user-msg-bg-dark);
    color: var(--text-dark);
    padding: 0.9375rem 1.25rem;
    border-radius: 0.5rem;
    margin-bottom: 1.25rem;
    text-align: center;
    font-weight: 600;
    font-size: clamp(1rem, 3vw, 1.125rem);
    border: 1px solid var(--border-dark);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    position: sticky;
    top: 0;
    z-index: 10;
}

.light-theme .welcome-persistent-header {
    background: var(--hover-light);
    color: var(--text-light);
    border: 1px solid var(--border-light);
}

/* Model Info Components */
.model-info-point {
    font-size: clamp(0.875rem, 2.5vw, 1rem);
    line-height: 1.6;
    text-align: left;
}

.slide-title {
    margin: 1.25rem 0 0.9375rem 0;
    text-align: center;
}

.slide-title h3 {
    color: var(--text-dark);
    font-size: clamp(1rem, 3vw, 1.125rem);
    font-weight: 600;
    margin: 0;
    padding: 0.625rem;
    border-radius: 0.5rem;
}

.light-theme .slide-title h3 {
    color: var(--text-light);
}

.slide-content {
    margin: 1.25rem 0;
}

.slide-content ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.slide-content li {
    margin: 0.75rem 0;
    padding: 0.75rem 1rem 0.75rem 1.875rem;
    border-radius: 0.5rem;
    color: var(--text-dark);
    font-size: clamp(0.875rem, 2.5vw, 1.125rem);
    line-height: 1.4;
    position: relative;
}

.light-theme .slide-content li {
    color: var(--text-light);
}

.slide-content li::before {
    content: '•';
    color: var(--user-msg-bg-dark);
    font-size: 1.125rem;
    position: absolute;
    left: 0.75rem;
    top: 0.625rem;
}

.light-theme .slide-content li::before {
    color: var(--user-msg-bg-light);
}

/* Prolific ID Section */
.prolific-id-section {
    text-align: center;
    padding: 1.25rem;
}

.prolific-id-section h3 {
    color: var(--text-dark);
    margin-bottom: 0.9375rem;
    font-size: clamp(1.125rem, 3vw, 1.25rem);
    font-weight: 600;
}

.light-theme .prolific-id-section h3 {
    color: var(--text-light);
}

.prolific-id-section p {
    margin: 15px 0;
    color: var(--text-dark);
}

.light-theme .prolific-id-section p {
    color: var(--text-light);
}

.prolific-note {
    color: var(--text-secondary-dark) !important;
}

.light-theme .prolific-note {
    color: var(--text-secondary-light) !important;
}

.prolific-id-input {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid var(--border-dark);
    border-radius: 8px;
    background-color: var(--main-bg-dark);
    color: #ffffff;
    font-size: 16px;
    font-family: monospace;
    text-align: center;
    margin: 15px 0;
    transition: border-color 0.3s ease;
}

.light-theme .prolific-id-input {
    border-color: var(--border-light);
    background-color: var(--main-bg-light);
    color: var(--text-light);
}

.prolific-id-input:focus {
    outline: none;
    border-color: var(--user-msg-bg-dark);
}

.prolific-id-input.error {
    border-color: #ef4444;
    background-color: rgba(239, 68, 68, 0.05);
}

.error-message {
    font-size: 0.875rem;
    color: #ef4444;
    margin-top: 0.625rem;
    display: none;
}

.error-message.show {
    display: block;
}

/* Welcome Navigation */
.welcome-navigation {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1.25rem;
    margin-top: 0.9375rem;
    padding: 0.9375rem 0 0.3125rem 0;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.light-theme .welcome-navigation {
    border-top-color: rgba(0, 0, 0, 0.1);
}

.welcome-nav-btn {
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 0.5rem;
    font-size: clamp(0.875rem, 2.5vw, 1rem);
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    min-width: 7.5rem;
}

.welcome-nav-btn.primary {
    background: var(--user-msg-bg-dark);
    color: white;
}

.light-theme .welcome-nav-btn.primary {
    background: var(--user-msg-bg-light);
}

.welcome-nav-btn.secondary {
    background: transparent;
    color: var(--text-secondary-dark);
    border: none;
    text-decoration: underline;
    text-underline-offset: 0.25rem;
    min-width: auto;
    padding: 0.5rem 1rem;
}

.light-theme .welcome-nav-btn.secondary {
    color: var(--text-secondary-light);
}

.welcome-nav-btn.primary:hover {
    transform: translateY(-1px);
    opacity: 0.9;
}

.welcome-nav-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

/* Timer and Progress */
.welcome-timer-container {
    display: flex;
    align-items: center;
    justify-content: center;
}

.circular-progress {
    width: 1.875rem;
    height: 1.875rem;
}

.circular-progress svg {
    width: 100%;
    height: 100%;
    transform: rotate(-90deg);
}

.circular-progress .progress-circle-bg {
    fill: none;
    stroke: var(--border-dark);
    stroke-width: 3;
}

.circular-progress .progress-circle {
    fill: none;
    stroke: var(--user-msg-bg-dark);
    stroke-width: 3;
    stroke-linecap: round;
    stroke-dasharray: 75;
    stroke-dashoffset: 75;
    transition: stroke-dashoffset 0.1s linear;
}

.welcome-progress-dots {
    display: flex;
    justify-content: center;
    gap: 0.5rem;
    margin-top: 0.625rem;
    padding: 0.625rem 0;
}

.progress-dot {
    width: 0.5rem;
    height: 0.5rem;
    border-radius: 50%;
    background: var(--border-dark);
    transition: all 0.3s ease;
    cursor: pointer;
}

.progress-dot.active {
    background: var(--text-dark);
    transform: scale(1.2);
}

.progress-dot.completed {
    background: var(--text-secondary-dark);
}

/* ===================================================================
   7. CHAT INTERFACE
   ================================================================= */

/* Chat Container */
.chat-container {
    flex: 1;
    overflow-y: auto;
    background-color: var(--bg-scrollable-window-dark);
    padding: 1.5rem;
}

.light-theme .chat-container {
    background-color: var(--bg-scrollable-window-light);
}

.messages {
    max-width: var(--max-content-width);
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

/* Welcome Message */
.welcome-message {
    text-align: center;
    margin: 3.75rem 0;
    animation: welcomeFadeIn 0.8s ease-out;
}

.welcome-content h2 {
    font-size: clamp(1.5rem, 5vw, 2rem);
    font-weight: 700;
    margin-bottom: 0.75rem;
    background: var(--bot-msg-text-dark);
    -webkit-background-clip: text;
    background-clip: text;
    text-align: center;
}

.light-theme .welcome-content h2 {
    background: var(--bot-msg-text-light);
    -webkit-background-clip: text;
    background-clip: text;
}

.welcome-content p {
    font-size: clamp(1rem, 3vw, 1.125rem);
    color: var(--text-secondary-dark);
}

.light-theme .welcome-content p {
    color: var(--text-secondary-light);
}

.info-item-large {
    padding: 2rem 1.5rem !important;
}

.info-item-large p {
    font-size: 1.125rem !important;
    line-height: 1.6 !important;
    margin: 0 !important;
    color: rgba(229, 231, 235, 0.95) !important;
}

.light-theme .info-item-large p {
    color: rgba(55, 65, 81, 0.9) !important;
}

/* Info items with headers and blue styling */
.info-item-with-header {
    padding: 0 !important;
    background: rgba(249, 250, 251, 0.06) !important;
    border: 1px solid rgba(229, 231, 235, 0.12) !important;
    border-radius: 6px !important;
    overflow: hidden !important;
    position: relative !important;
}

.light-theme .info-item-with-header {
    background: rgba(17, 24, 39, 0.03) !important;
    border: 1px solid rgba(209, 213, 219, 0.2) !important;
}

.info-item-top-bar {
    height: 3px;
    background: linear-gradient(90deg, #3b82f6, #1d4ed8);
    width: 100%;
}

.info-item-content {
    padding: 1.5rem;
    display: flex;
    align-items: flex-start;
    gap: 1rem;
}

.info-item-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #3b82f6;
    box-shadow: 0 0 6px rgba(59, 130, 246, 0.4);
    flex-shrink: 0;
    margin-top: 0.25rem;
}

.info-item-text {
    flex: 1;
}

.info-item-text h4 {
    margin: 0 0 0.5rem 0 !important;
    font-size: 1rem !important;
    font-weight: 600 !important;
    color: rgba(249, 250, 251, 0.95) !important;
}

.light-theme .info-item-text h4 {
    color: rgba(17, 24, 39, 0.9) !important;
}

.info-item-text p {
    margin: 0 !important;
    font-size: 0.9375rem !important;
    line-height: 1.5 !important;
    color: rgba(229, 231, 235, 0.9) !important;
}

.light-theme .info-item-text p {
    color: rgba(55, 65, 81, 0.8) !important;
}

/* Enhanced welcome instructions */
.welcome-instructions {
    text-align: center;
    padding: 2rem 1.5rem;
    border-radius: 8px;
    background: rgba(59, 130, 246, 0.08);
    border: 1px solid rgba(59, 130, 246, 0.15);
    position: relative;
    overflow: hidden;
}

.welcome-instructions::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 3px;
    background: linear-gradient(90deg, #3b82f6, #1d4ed8);
}

.light-theme .welcome-instructions {
    background: rgba(59, 130, 246, 0.05);
    border: 1px solid rgba(59, 130, 246, 0.2);
}

.welcome-instructions h3 {
    color: rgba(249, 250, 251, 0.95);
    margin: 0 0 1rem 0;
    font-size: 1.25rem;
    font-weight: 600;
}

.light-theme .welcome-instructions h3 {
    color: rgba(17, 24, 39, 0.9);
}

.welcome-instructions p {
    margin: 0;
    font-size: 1.0625rem;
    line-height: 1.6;
    color: rgba(229, 231, 235, 0.9);
}

.light-theme .welcome-instructions p {
    color: rgba(55, 65, 81, 0.8);
}

/* Error Modal Styles */
.error-modal-dialog {
    background: var(--main-bg-dark);
    color: var(--text-dark);
    border-radius: 12px;
    max-width: 500px;
    width: 90%;
    margin: 20px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    border: 2px solid #ef4444;
    animation: errorModalSlideIn 0.3s ease-out;
    overflow: hidden;
}

.light-theme .error-modal-dialog {
    background: var(--main-bg-light);
    color: var(--text-light);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.2);
}

.error-modal-header {
    background: linear-gradient(135deg, #ef4444, #dc2626);
    color: white;
    padding: 1rem 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.error-modal-header h3 {
    margin: 0;
    font-size: 1.25rem;
    font-weight: 600;
}

.error-modal-close {
    background: none;
    border: none;
    color: white;
    font-size: 1.5rem;
    cursor: pointer;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: background 0.3s ease;
}

.error-modal-close:hover {
    background: rgba(255, 255, 255, 0.2);
}

.error-modal-body {
    padding: 1.5rem;
}

.error-modal-body>p {
    margin: 0 0 1rem 0;
    font-size: 1rem;
    line-height: 1.5;
}

.error-details {
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.3);
    border-radius: 6px;
    padding: 1rem;
    margin: 1rem 0;
    font-family: monospace;
}

.light-theme .error-details {
    background: rgba(239, 68, 68, 0.05);
}

.error-details strong {
    color: #ef4444;
}

.error-instructions {
    margin-top: 1.5rem;
}

.error-instructions p {
    margin: 0.5rem 0;
    font-weight: 600;
}

.error-instructions ol {
    margin: 0.75rem 0;
    padding-left: 1.25rem;
}

.error-instructions li {
    margin: 0.5rem 0;
    line-height: 1.4;
}

.error-note {
    background: rgba(16, 185, 129, 0.1);
    border: 1px solid rgba(16, 185, 129, 0.3);
    border-radius: 6px;
    padding: 0.75rem;
    margin-top: 1rem;
    font-size: 0.875rem;
    color: #10b981 !important;
    font-style: italic;
}

.light-theme .error-note {
    background: rgba(16, 185, 129, 0.05);
}

.error-modal-footer {
    background: var(--hover-dark);
    padding: 1rem 1.5rem;
    display: flex;
    gap: 1rem;
    justify-content: flex-end;
}

.light-theme .error-modal-footer {
    background: var(--hover-light);
}

.error-button {
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 6px;
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
}

.error-primary {
    background: #ef4444;
    color: white;
}

.error-primary:hover {
    background: #dc2626;
    transform: translateY(-1px);
}

.error-secondary {
    background: transparent;
    color: var(--text-dark);
    border: 1px solid var(--border-dark);
}

.light-theme .error-secondary {
    color: var(--text-light);
    border-color: var(--border-light);
}

.error-secondary:hover {
    background: var(--hover-dark);
    transform: translateY(-1px);
}

.light-theme .error-secondary:hover {
    background: var(--hover-light);
}

@keyframes errorModalSlideIn {
    from {
        opacity: 0;
        transform: translateY(-30px) scale(0.95);
    }

    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* Mobile responsiveness */
@media (max-width: 768px) {
    .error-modal-dialog {
        width: 95%;
        margin: 10px;
    }

    .error-modal-body {
        padding: 1rem;
    }

    .error-modal-footer {
        flex-direction: column;
        gap: 0.5rem;
    }

    .error-button {
        width: 100%;
    }
}

/* Message Components */
.message {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    max-width: 75%;
    animation: messageBounceIn 0.5s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

.message.user {
    align-self: flex-end;
    flex-direction: row-reverse;
}

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

.message-icon {
    width: 2rem;
    height: 2rem;
    border-radius: 50%;
    flex-shrink: 0;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.message-content {
    background-color: var(--bot-msg-bg-dark);
    color: var(--bot-msg-text-dark);
    padding: 1rem 1.25rem;
    border-radius: 1.125rem;
    max-width: 100%;
    word-wrap: break-word;
    line-height: 1.5;
    position: relative;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    font-size: 0.9375rem;
}

.message.user .message-content {
    background: var(--user-msg-bg-dark);
    color: var(--user-msg-text-dark);
}

.light-theme .message.user .message-content {
    background: var(--user-msg-bg-light);
    color: var(--user-msg-text-light);
}

.light-theme .message.bot .message-content {
    background-color: var(--bot-msg-bg-light);
    color: var(--bot-msg-text-light);
    border: 1px solid var(--border-light);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

/* Typing Indicator */
.typing-message {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    max-width: 85%;
    align-self: flex-start;
}

.typing-content {
    background-color: var(--bot-msg-bg-dark);
    padding: 1rem 1.25rem;
    border-radius: 1.125rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.light-theme .typing-content {
    background-color: var(--bot-msg-bg-light);
    border: 1px solid var(--border-light);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.typing-dots {
    display: flex;
    gap: 0.25rem;
    align-items: center;
}

.typing-dot {
    width: 0.5rem;
    height: 0.5rem;
    border-radius: 50%;
    background-color: var(--text-secondary-dark);
    animation: typingBounce 1.4s ease-in-out infinite;
}

.light-theme .typing-dot {
    background-color: var(--text-secondary-light);
}

.typing-dot:nth-child(1) {
    animation-delay: 0ms;
}

.typing-dot:nth-child(2) {
    animation-delay: 200ms;
}

.typing-dot:nth-child(3) {
    animation-delay: 400ms;
}

/* Image Generation Indicator */
.image-generating-text {
    color: var(--text-secondary-dark);
    font-style: italic;
    font-size: 0.9375rem;
    opacity: 0.8;
    animation: fadeInOut 2s ease-in-out infinite;
}

.light-theme .image-generating-text {
    color: var(--text-secondary-light);
}

/* Edit Components */
.edit-btn {
    position: absolute;
    top: -0.5rem;
    right: -0.5rem;
    background-color: var(--border-dark);
    color: var(--text-dark);
    border: none;
    width: 1.5rem;
    height: 1.5rem;
    border-radius: 50%;
    cursor: pointer;
    font-size: 0.75rem;
    opacity: 0;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.light-theme .edit-btn {
    background-color: var(--border-light);
    color: var(--text-light);
}

.message:hover .edit-btn {
    opacity: 1;
}

.edit-btn:hover {
    background-color: var(--user-msg-bg-dark);
    color: white;
    transform: scale(1.2) rotate(15deg);
}

.edit-mode {
    margin-top: 0.75rem;
    padding-top: 0.75rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.light-theme .edit-mode {
    border-top-color: var(--border-light);
}

.edit-input {
    width: 100%;
    padding: 0.75rem;
    border-radius: 0.5rem;
    background-color: var(--main-bg-dark);
    color: var(--text-dark);
    border: 1px solid var(--border-dark);
    font-size: 0.875rem;
    resize: none;
    font-family: inherit;
    margin-bottom: 0.5rem;
}

.light-theme .edit-input {
    border-color: var(--border-light);
    background-color: var(--main-bg-light);
    color: var(--text-light);
}

.edit-buttons {
    display: flex;
    gap: 0.5rem;
    justify-content: flex-end;
}

.edit-confirm,
.edit-cancel {
    padding: 0.5rem 1rem;
    border: none;
    border-radius: 0.375rem;
    cursor: pointer;
    font-size: 0.75rem;
    font-weight: 500;
    transition: all 0.3s ease;
}

.edit-confirm {
    background-color: #10b981;
    color: white;
}

.edit-confirm:hover {
    background-color: #059669;
}

.edit-cancel {
    background-color: #ef4444;
    color: white;
}

.edit-cancel:hover {
    background-color: #dc2626;
}

/* ===================================================================
   8. INPUT AREA
   ================================================================= */
.input-area {
    padding: 1.25rem 1.5rem;
    background-color: var(--main-bg-dark);
    min-height: var(--input-area-height);
}

.light-theme .input-area {
    background-color: var(--main-bg-light);
    border-top-color: var(--border-light);
}

.input-container {
    max-width: var(--max-content-width);
    margin: 0 auto;
    display: flex;
    gap: 0.75rem;
    align-items: flex-end;
}

.message-input {
    flex: 1;
    padding: 1rem 1.25rem;
    border: 2px solid var(--border-dark);
    border-radius: 1.5rem;
    background-color: var(--main-bg-dark);
    color: var(--text-dark);
    font-size: clamp(0.875rem, 2.5vw, 1rem);
    outline: none;
    resize: none;
    font-family: inherit;
    line-height: 1.5;
    min-height: 3.5rem;
    max-height: 12.5rem;
    transition: all 0.3s ease;
}

.light-theme .message-input {
    border-color: var(--border-light);
    background-color: var(--main-bg-light);
    color: var(--text-light);
}

.message-input:focus {
    border-color: var(--user-msg-bg-dark);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1), 0 0 20px rgba(37, 99, 235, 0.1);
}

.send-btn {
    background: linear-gradient(135deg, var(--user-msg-bg-dark), #1d4ed8);
    color: white;
    border: none;
    width: 3.5rem;
    height: 3.5rem;
    border-radius: 50%;
    cursor: pointer;
    font-size: 1.125rem;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 8px rgba(37, 99, 235, 0.3);
    position: relative;
    overflow: hidden;
    flex-shrink: 0;
}

.send-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(37, 99, 235, 0.4);
}

.send-btn:active {
    transform: scale(0.95);
}

.send-icon {
    transform: rotate(0deg);
    transition: transform 0.3s ease;
}

.send-btn:hover .send-icon {
    transform: rotate(10deg);
}

/* ===================================================================
   9. UTILITY COMPONENTS
   ================================================================= */

/* Finish Button - Updated with responsive positioning */
.finish-btn {
    position: fixed;
    bottom: calc(var(--input-area-height, 80px) + 1.5rem);
    /* Stay above input area */
    right: 1.25rem;
    background: linear-gradient(135deg, #dc2626, #b91c1c);
    color: white;
    border: none;
    padding: 0.75rem 1.25rem;
    border-radius: 1.5625rem;
    cursor: pointer;
    font-size: 0.875rem;
    font-weight: 600;
    box-shadow: 0 4px 12px rgba(220, 38, 38, 0.3);
    transition: all 0.3s ease;
    z-index: 100;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    /* Ensure minimum distance from input area */
    margin-bottom: env(safe-area-inset-bottom, 0);
}

.finish-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(220, 38, 38, 0.4);
    background: linear-gradient(135deg, #b91c1c, #991b1b);
}

.finish-btn::before {
    content: '🏁';
    font-size: 1rem;
}

/* Responsive adjustments for finish button */
@media (max-width: 1024px) {
    .finish-btn {
        bottom: calc(var(--input-area-height, 90px) + 1.25rem);
        right: 1rem;
    }
}

@media (max-width: 768px) {
    .finish-btn {
        bottom: calc(var(--input-area-height, 100px) + 1rem);
        right: 1rem;
        padding: 0.625rem 1rem;
        font-size: 0.8125rem;
    }

    .finish-btn::before {
        font-size: 0.875rem;
    }
}

@media (max-width: 480px) {
    .finish-btn {
        bottom: calc(var(--input-area-height, 110px) + 0.75rem);
        right: 0.75rem;
        padding: 0.5rem 0.875rem;
        font-size: 0.75rem;
    }

    .finish-btn::before {
        font-size: 0.8125rem;
    }
}

/* Very small screens - move finish button to top area if needed */
@media (max-width: 380px) {
    .finish-btn {
        top: 1rem;
        bottom: auto;
        right: 1rem;
        padding: 0.5rem 0.875rem;
        font-size: 0.75rem;
    }
}

/* Landscape mobile - adjust positioning */
@media (max-height: 500px) and (orientation: landscape) {
    .finish-btn {
        bottom: calc(var(--input-area-height, 80px) + 0.5rem);
        right: 0.75rem;
        padding: 0.5rem 0.875rem;
    }
}

/* Auto-save Indicator */
.auto-save-indicator {
    position: fixed;
    top: 1.25rem;
    right: 1.25rem;
    background-color: #10b981;
    color: white;
    padding: 0.5rem 1rem;
    border-radius: 1.25rem;
    font-size: 0.75rem;
    font-weight: 500;
    opacity: 0;
    transform: translateX(6.25rem);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 100;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.auto-save-indicator.show {
    opacity: 1;
    transform: translateX(0);
}

/* Notification System */
.notification {
    position: fixed;
    top: 1.25rem;
    left: 50%;
    transform: translateX(-50%);
    padding: 0.75rem 1.5rem;
    border-radius: 0.5rem;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
    z-index: 2000;
    animation: slideIn 0.3s ease-out;
    font-weight: 500;
}

.notification.notification-warning {
    background: #ef4444;
    color: white;
}

.notification.notification-info {
    background: #10b981;
    color: white;
}

/* ===================================================================
   10. MODALS & OVERLAYS
   ================================================================= */

/* Modal Backdrop */
.modal-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    z-index: 3000;
    display: flex;
    justify-content: center;
    align-items: center;
    backdrop-filter: blur(4px);
}

/* Finish Confirmation Dialog */
.finish-confirmation-dialog {
    background: var(--main-bg-dark);
    color: var(--text-dark);
    padding: 1.875rem;
    border-radius: 0.75rem;
    max-width: 31.25rem;
    margin: 1.25rem;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    border: 1px solid var(--border-dark);
}

.light-theme .finish-confirmation-dialog {
    background: var(--main-bg-light);
    color: var(--text-light);
    border-color: var(--border-light);
}

.finish-confirmation-dialog h3 {
    margin: 0 0 1.25rem 0;
    color: inherit;
}

.finish-confirmation-dialog p {
    margin: 0.9375rem 0;
    line-height: 1.5;
}

.finish-warning {
    font-weight: bold;
    color: #f59e0b !important;
}

.finish-buttons {
    display: flex;
    gap: 0.9375rem;
    justify-content: flex-end;
    margin-top: 1.5625rem;
}

.finish-button {
    border: none;
    padding: 0.625rem 1.25rem;
    border-radius: 0.375rem;
    cursor: pointer;
    font-weight: 500;
    transition: all 0.3s ease;
}

.finish-cancel {
    background: #6b7280;
    color: white;
}

.finish-cancel:hover {
    background: #4b5563;
}

.finish-confirm {
    background: #dc2626;
    color: white;
}

.finish-confirm:hover {
    background: #b91c1c;
}

/* Loading Indicator */
.finish-loading-indicator {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: var(--main-bg-dark);
    color: var(--text-dark);
    padding: 1.875rem;
    border-radius: 0.75rem;
    z-index: 3500;
    text-align: center;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    border: 1px solid var(--border-dark);
}

.light-theme .finish-loading-indicator {
    background: var(--main-bg-light);
    color: var(--text-light);
    border-color: var(--border-light);
}

.loading-spinner {
    width: 2.5rem;
    height: 2.5rem;
    border: 4px solid var(--border-dark);
    border-top: 4px solid var(--user-msg-bg-dark);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 0.9375rem auto;
}

.light-theme .loading-spinner {
    border-color: var(--border-light);
    border-top-color: var(--user-msg-bg-light);
}

/* Image Modal */
.image-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 2000;
    cursor: pointer;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.image-modal.show {
    opacity: 1;
    visibility: visible;
}

.image-modal img {
    max-width: 90%;
    max-height: 90%;
    border-radius: 0.5rem;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
    transform: scale(0.9);
    transition: transform 0.3s ease;
}

.image-modal.show img {
    transform: scale(1);
}

.image-modal .close-button {
    position: absolute;
    top: 1.25rem;
    right: 1.25rem;
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    font-size: 1.5rem;
    width: 2.5rem;
    height: 2.5rem;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.3s ease;
}

.image-modal .close-button:hover {
    background: rgba(255, 255, 255, 0.3);
}

/* Sidebar Backdrop for Mobile */
.sidebar-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 99;
    display: none;
    transition: opacity 0.3s ease;
    opacity: 0;
}

.sidebar-backdrop.show {
    display: block;
    opacity: 1;
}

/* ===================================================================
   11. MARKDOWN CONTENT STYLING
   ================================================================= */
.message-content h1,
.message-content h2,
.message-content h3,
.message-content h4,
.message-content h5,
.message-content h6 {
    margin: 1rem 0 0.5rem 0;
    font-weight: 600;
}

.message-content h1 {
    font-size: 1.5em;
}

.message-content h2 {
    font-size: 1.3em;
}

.message-content h3 {
    font-size: 1.1em;
}

.message-content ul,
.message-content ol {
    margin: 0.5rem 0;
    padding-left: 1.25rem;
}

.message-content li {
    margin: 0.25rem 0;
}

.message-content code {
    background-color: rgba(0, 0, 0, 0.1);
    padding: 0.125rem 0.25rem;
    border-radius: 0.25rem;
    font-family: 'Courier New', monospace;
    font-size: 0.9em;
}

.light-theme .message-content code {
    background-color: rgba(0, 0, 0, 0.05);
}

.message-content pre {
    background-color: rgba(0, 0, 0, 0.1);
    padding: 0.75rem;
    border-radius: 0.5rem;
    overflow-x: auto;
    margin: 0.5rem 0;
}

.light-theme .message-content pre {
    background-color: rgba(0, 0, 0, 0.05);
}

.message-content blockquote {
    border-left: 4px solid var(--user-msg-bg-dark);
    margin: 0.5rem 0;
    padding-left: 1rem;
    font-style: italic;
    opacity: 0.8;
}

.message-content p {
    margin: 0.5rem 0;
}

.message-content p:first-child {
    margin-top: 0;
}

.message-content p:last-child {
    margin-bottom: 0;
}

.message-content img {
    max-width: 100%;
    height: auto;
    border-radius: 0.75rem;
    margin: 0.75rem 0;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    cursor: pointer;
    display: block;
}

.light-theme .message-content img {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.message-content img:hover {
    transform: scale(1.02);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.2);
}

.message-content a {
    color: var(--user-msg-bg-dark);
    text-decoration: underline;
}

.light-theme .message-content a {
    color: var(--user-msg-bg-light);
}

/* ===================================================================
   12. SCROLLBAR STYLING
   ================================================================= */
.chat-container::-webkit-scrollbar,
.conversation-list::-webkit-scrollbar {
    width: 0.375rem;
}

.chat-container::-webkit-scrollbar-track,
.conversation-list::-webkit-scrollbar-track {
    background: transparent;
}

.chat-container::-webkit-scrollbar-thumb,
.conversation-list::-webkit-scrollbar-thumb {
    background-color: var(--border-dark);
    border-radius: 0.1875rem;
    transition: background-color 0.3s ease;
}

.light-theme .chat-container::-webkit-scrollbar-thumb,
.light-theme .conversation-list::-webkit-scrollbar-thumb {
    background-color: var(--border-light);
}

.chat-container::-webkit-scrollbar-thumb:hover,
.conversation-list::-webkit-scrollbar-thumb:hover {
    background-color: var(--user-msg-bg-dark);
}

/* ===================================================================
   13. ANIMATIONS & KEYFRAMES
   ================================================================= */
@keyframes slideInFromLeft {
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes messageBounceIn {
    0% {
        opacity: 0;
        transform: translateY(1.25rem) scale(0.9);
    }

    50% {
        transform: translateY(-0.3125rem) scale(1.02);
    }

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

@keyframes typingBounce {

    0%,
    60%,
    100% {
        transform: translateY(0);
        opacity: 0.4;
    }

    30% {
        transform: translateY(-0.625rem);
        opacity: 1;
    }
}

@keyframes fadeInOut {

    0%,
    100% {
        opacity: 0.5;
    }

    50% {
        opacity: 1;
    }
}

@keyframes welcomeFadeIn {
    from {
        opacity: 0;
        transform: translateY(1.25rem);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes modalFadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translateY(-1.875rem) scale(0.9);
    }

    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

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

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

@keyframes slideIn {
    from {
        transform: translateX(-50%) translateY(-1.25rem);
        opacity: 0;
    }

    to {
        transform: translateX(-50%) translateY(0);
        opacity: 1;
    }
}

@keyframes slideOut {
    from {
        transform: translateX(-50%) translateY(0);
        opacity: 1;
    }

    to {
        transform: translateX(-50%) translateY(-1.25rem);
        opacity: 0;
    }
}

@keyframes activeBarSlide {
    from {
        height: 0;
    }

    to {
        height: 100%;
    }
}

/* ===================================================================
   14. RESPONSIVE DESIGN
   ================================================================= */

/* Tablet and Small Desktop */
@media (max-width: 1024px) {
    :root {
        --sidebar-width: 260px;
        --max-content-width: 700px;
    }

    .header {
        padding: 0.75rem 1rem;
    }

    .chat-container {
        padding: 1rem;
    }

    .messages {
        gap: 0.75rem;
    }

    .message {
        max-width: 85%;
    }
}

/* Mobile and Small Tablet */
@media (max-width: 768px) {
    :root {
        --header-height: clamp(55px, 7vh, 70px);
    }

    /* Mobile Layout - Sidebar Overlay */
    .app-container {
        grid-template-columns: 1fr;
    }

    .sidebar {
        position: fixed;
        left: calc(-1 * var(--sidebar-width));
        top: 0;
        height: 100vh;
        z-index: 100;
        transition: left 0.3s ease;
        width: var(--sidebar-width);
    }

    .sidebar.open {
        left: 0;
    }

    .sidebar.collapsed {
        left: calc(-1 * var(--sidebar-width));
        width: var(--sidebar-width);
    }

    .mobile-sidebar-toggle {
        display: flex;
    }

    /* Header Adjustments */
    .header {
        padding: 0.75rem 1rem;
        gap: 0.75rem;
    }

    .bot-name {
        font-size: clamp(1.125rem, 5vw, 1.25rem);
    }

    .header-actions {
        gap: 0.5rem;
    }

    .session-timer {
        font-size: 0.75rem;
        padding: 0.375rem 0.5rem;
        min-width: 5.3125rem;
    }

    .timer-icon {
        font-size: 0.875rem;
    }

    .timer-text {
        font-size: 0.75rem;
    }

    .participant-display {
        font-size: 0.75rem;
        padding: 0.375rem 0.5rem;
    }

    /* Chat Adjustments */
    .chat-container {
        padding: 0.75rem;
    }

    .messages {
        gap: 0.75rem;
    }

    .message {
        max-width: 95%;
    }

    .message-icon {
        width: 1.75rem;
        height: 1.75rem;
    }

    .message-content {
        padding: 0.875rem 1rem;
        font-size: 0.875rem;
    }

    /* Input Area */
    .input-area {
        padding: 1rem;
    }

    .input-container {
        gap: 0.5rem;
    }

    .message-input {
        min-height: 3rem;
        padding: 0.875rem 1rem;
    }

    .send-btn {
        width: 3rem;
        height: 3rem;
        font-size: 1rem;
    }

    /* Finish Button */
    .finish-btn {
        bottom: 0.9375rem;
        right: 0.9375rem;
        padding: 0.625rem 1rem;
        font-size: 0.8125rem;
    }

    .finish-btn::before {
        font-size: 0.875rem;
    }

    /* Welcome Modal */
    .welcome-modal-content {
        width: 95vw;
        height: 85vh;
        max-width: none;
        max-height: none;
        padding: 1.25rem;
    }

    .welcome-content-container {
        min-height: 300px;
    }

    .welcome-navigation {
        flex-direction: column;
        gap: 0.9375rem;
    }

    .welcome-nav-btn.primary {
        width: 100%;
    }

    /* Image Modal */
    .image-modal img {
        max-width: 95%;
        max-height: 95%;
    }

    .image-modal .close-button {
        top: 0.625rem;
        right: 0.625rem;
        width: 2.1875rem;
        height: 2.1875rem;
        font-size: 1.25rem;
    }
}

/* Very Small Mobile */
@media (max-width: 480px) {
    :root {
        --sidebar-width: min(280px, 85vw);
    }

    .timer-icon {
        display: none;
    }

    .session-timer {
        min-width: 4.375rem;
    }

    .participant-display span:first-child {
        display: none;
    }

    .header-actions {
        flex-wrap: wrap;
    }

    .welcome-slide-content {
        padding: 1rem;
    }

    .slide-content li {
        padding: 0.625rem 0.75rem 0.625rem 1.625rem;
        font-size: 0.875rem;
    }

    .slide-title h3 {
        font-size: 1rem;
    }

    .model-header-persistent,
    .welcome-persistent-header {
        font-size: 1rem;
        padding: 0.75rem 1rem;
    }
}

/* Landscape Mobile Optimization */
@media (max-height: 500px) and (orientation: landscape) {
    .welcome-modal-content {
        max-height: 90vh;
        padding: 1rem;
    }

    .welcome-content-container {
        min-height: 12.5rem;
    }

    .header {
        min-height: 3.75rem;
    }

    .welcome-slide-content {
        padding: 1rem;
    }
}

/* High DPI Displays */
@media (-webkit-min-device-pixel-ratio: 2),
(min-resolution: 2dppx) {

    .message-icon,
    .finish-btn::before {
        image-rendering: -webkit-optimize-contrast;
        image-rendering: crisp-edges;
    }
}

/* Reduced Motion */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* Dark Mode Preference */
@media (prefers-color-scheme: dark) {
    :root {
        color-scheme: dark;
    }
}

/* ===================================================================
   SOPHISTICATED WELCOME EXPERIENCE
   ================================================================= */

.welcome-experience {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: 10000;
    display: none;
    opacity: 0;
    transition: opacity 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.welcome-experience.active {
    opacity: 1;
}

.welcome-backdrop {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background:
        linear-gradient(135deg,
            rgb(20, 25, 30) 0%,
            rgba(30, 35, 40) 25%,
            rgba(45, 50, 55) 50%,
            rgba(65, 70, 75) 75%,
            rgba(80, 85, 90) 100%);
    backdrop-filter: blur(2px);
    box-shadow: inset 0 0 100px rgba(0, 0, 0, 0.3);
}

.light-theme .welcome-backdrop {
    background:
        linear-gradient(135deg,
            rgba(248, 250, 252, 0.97) 0%,
            rgba(241, 245, 249, 0.95) 25%,
            rgba(226, 232, 240, 0.97) 50%,
            rgba(203, 213, 225, 0.95) 75%,
            rgba(156, 163, 175, 0.97) 100%);
}

.welcome-backdrop::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background-image:
        repeating-linear-gradient(45deg,
            transparent,
            transparent 40px,
            rgba(255, 255, 255, 0.015) 40px,
            rgba(255, 255, 255, 0.015) 80px),
        repeating-linear-gradient(-45deg,
            transparent,
            transparent 40px,
            rgba(255, 255, 255, 0.01) 40px,
            rgba(255, 255, 255, 0.01) 80px);
    animation: slowScroll 15s linear infinite;
}

.light-theme .welcome-backdrop::before {
    background-image:
        repeating-linear-gradient(45deg,
            transparent,
            transparent 40px,
            rgba(0, 0, 0, 0.02) 40px,
            rgba(0, 0, 0, 0.02) 80px),
        repeating-linear-gradient(-45deg,
            transparent,
            transparent 40px,
            rgba(0, 0, 0, 0.015) 40px,
            rgba(0, 0, 0, 0.015) 80px);
}

@keyframes slowScroll {
    0% {
        transform: translate(0, 0);
    }

    100% {
        transform: translate(-80px, -80px);
    }
}

.welcome-backdrop::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background:
        radial-gradient(circle at 15% 85%, rgba(59, 130, 246, 0.08) 0%, transparent 50%),
        radial-gradient(circle at 85% 15%, rgba(99, 102, 241, 0.06) 0%, transparent 50%);
    animation: gentleGlow 20s ease-in-out infinite;
}

@keyframes gentleGlow {

    0%,
    100% {
        opacity: 0.3;
    }

    50% {
        opacity: 0.6;
    }
}

.welcome-container {
    position: relative;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    padding: 1rem;
    max-width: 1000px;
    margin: 0 auto;
    min-height: 100vh;
    box-sizing: border-box;
}

/* Progress System - Made Responsive */
.progress-system {
    position: relative;
    top: -20px;
    left: 0;
    transform: none;
    display: flex;
    align-items: center;
    gap: 1.5rem;
    margin: 2rem 0 1rem 0;
    flex-shrink: 0;
    width: 100%;
    justify-content: center;
}

.progress-track {
    width: 200px;
    height: 1px;
    background: rgba(156, 163, 175, 0.3);
    border-radius: 1px;
    overflow: hidden;
}

.light-theme .progress-track {
    background: rgba(107, 114, 128, 0.2);
}

.progress-indicator {
    height: 100%;
    background: linear-gradient(90deg, #3b82f6, #1d4ed8);
    border-radius: 1px;
    width: 16.67%;
    transition: width 0.8s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
}

.progress-indicator::after {
    content: '';
    position: absolute;
    top: -2px;
    right: -2px;
    width: 5px;
    height: 5px;
    background: #3b82f6;
    border-radius: 50%;
    box-shadow: 0 0 6px rgba(59, 130, 246, 0.6);
}

.progress-counter {
    font-size: 0.875rem;
    font-weight: 400;
    color: rgba(156, 163, 175, 0.8);
    font-variant-numeric: tabular-nums;
}

.light-theme .progress-counter {
    color: rgba(107, 114, 128, 0.7);
}

.step-separator {
    margin: 0 0.25rem;
    opacity: 0.4;
}

/* Content Stage - Made Flexible */
.content-stage {
    flex: 1;
    width: 100%;
    max-width: 700px;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
    min-height: 0;
    margin: 1rem 0;
}

.content-panel {
    position: absolute;
    width: 100%;
    height: auto;
    max-height: 100%;
    opacity: 0;
    transform: translateX(100px);
    transition: all 0.6s cubic-bezier(0.4, 0, 0.2, 1);
    overflow-y: auto;
    display: flex;
    align-items: center;
    justify-content: center;
}

.content-panel.active {
    opacity: 1;
    transform: translateX(0);
}

.content-panel.exit-left {
    opacity: 0;
    transform: translateX(-100px);
}

/* Content Card System - Grey Theme */
.content-card {
    background: var(--bot-msg-text-light);
    border: 1px solid rgba(229, 231, 235, 0.15);
    border-radius: 8px;
    padding: 2rem;
    text-align: center;
    box-shadow:
        0 1px 3px rgba(0, 0, 0, 0.12),
        0 20px 40px rgba(0, 0, 0, 0.15);
    width: 100%;
    max-width: 600px;
    margin: 0 auto;
    max-height: 100%;
    overflow-y: auto;
}

.light-theme .content-card {
    background: rgba(255, 255, 255, 0.9);
    border: 1px solid rgba(229, 231, 235, 0.3);
    box-shadow:
        0 1px 3px rgba(0, 0, 0, 0.08),
        0 20px 40px rgba(0, 0, 0, 0.08);
}

/* Typography System */
.content-title {
    font-size: 2.5rem;
    font-weight: 600;
    color: rgba(249, 250, 251, 0.95);
    margin: 0 0 1rem 0;
    letter-spacing: -0.02em;
    line-height: 1.2;
}

.light-theme .content-title {
    color: rgba(17, 24, 39, 0.9);
}

.content-subtitle {
    font-size: 1.125rem;
    color: rgba(209, 213, 219, 0.8);
    margin: 0 0 2rem 0;
    font-weight: 400;
    line-height: 1.5;
}

.light-theme .content-subtitle {
    color: rgba(75, 85, 99, 0.7);
}

.content-body {
    font-size: 1rem;
    color: rgba(229, 231, 235, 0.9);
    line-height: 1.6;
    margin: 1.5rem 0;
}

.light-theme .content-body {
    color: rgba(55, 65, 81, 0.8);
}

/* Model Introduction */
.model-hero {
    display: flex;
    align-items: center;
    gap: 2rem;
    margin: 2rem 0;
    padding: 2rem;
    background: rgba(59, 131, 246, 0.356);
    border-radius: 6px;
    border: 1px solid rgba(59, 130, 246, 0.15);
    justify-content: center;
}

.model-avatar {
    width: 80px;
    height: 80px;
    border-radius: 8px;
    background: linear-gradient(135deg, #3b82f6, #1d4ed8);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    font-weight: 600;
    color: white;
    box-shadow: 0 2px 8px rgba(59, 130, 246, 0.2);
    flex-shrink: 0;
}

.model-info h3 {
    margin: 0 0 0.5rem 0;
    font-size: 1.5rem;
    font-weight: 600;
    color: rgba(249, 250, 251, 0.95);
}

.light-theme .model-info h3 {
    color: rgba(17, 24, 39, 0.9);
}

.model-info p {
    margin: 0;
    color: rgba(209, 213, 219, 0.8);
    font-size: 1rem;
}

.light-theme .model-info p {
    color: rgba(75, 85, 99, 0.7);
}

/* Information Grid */
.info-grid {
    display: grid;
    gap: 1.5rem;
    margin: 2rem 0;
}

.info-item {
    padding: 1.5rem;
    background: rgba(249, 250, 251, 0.06);
    border: 1px solid rgba(229, 231, 235, 0.12);
    border-radius: 6px;
    text-align: left;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.light-theme .info-item {
    background: rgba(17, 24, 39, 0.03);
    border: 1px solid rgba(209, 213, 219, 0.2);
}

.info-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 3px;
    height: 100%;
    background: linear-gradient(180deg, #3b82f6, #1d4ed8);
    transform: scaleY(0);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.info-item:hover::before {
    transform: scaleY(1);
}

.info-item:hover {
    background: rgba(249, 250, 251, 0.08);
    border-color: rgba(229, 231, 235, 0.2);
    transform: translateY(-1px);
}

.light-theme .info-item:hover {
    background: rgba(17, 24, 39, 0.05);
    border-color: rgba(209, 213, 219, 0.3);
}

.info-item h4 {
    margin: 0 0 0.75rem 0;
    font-size: 1.125rem;
    font-weight: 600;
    color: rgba(249, 250, 251, 0.95);
}

.light-theme .info-item h4 {
    color: rgba(17, 24, 39, 0.9);
}

.info-item p {
    margin: 0;
    color: rgba(229, 231, 235, 0.9);
    line-height: 1.6;
}

.light-theme .info-item p {
    color: rgba(55, 65, 81, 0.8);
}

.info-item-large {
    padding: 2rem 1.5rem !important;
}

.info-item-large p {
    font-size: 1.125rem !important;
    line-height: 1.6 !important;
    margin: 0 !important;
    color: rgba(229, 231, 235, 0.95) !important;
}

.light-theme .info-item-large p {
    color: rgba(55, 65, 81, 0.9) !important;
}

/* Info items with headers and blue styling */
.info-item-with-header {
    padding: 0 !important;
    background: rgba(249, 250, 251, 0.06) !important;
    border: 1px solid rgba(229, 231, 235, 0.12) !important;
    border-radius: 6px !important;
    overflow: hidden !important;
    position: relative !important;
}

.light-theme .info-item-with-header {
    background: rgba(17, 24, 39, 0.03) !important;
    border: 1px solid rgba(209, 213, 219, 0.2) !important;
}

.info-item-top-bar {
    height: 3px;
    background: linear-gradient(90deg, #3b82f6, #1d4ed8);
    width: 100%;
}

.info-item-content {
    padding: 1.5rem;
    display: flex;
    align-items: flex-start;
    gap: 1rem;
}

.info-item-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #3b82f6;
    box-shadow: 0 0 6px rgba(59, 130, 246, 0.4);
    flex-shrink: 0;
    margin-top: 0.25rem;
}

.info-item-text {
    flex: 1;
}

.info-item-text h4 {
    margin: 0 0 0.5rem 0 !important;
    font-size: 1rem !important;
    font-weight: 600 !important;
    color: rgba(249, 250, 251, 0.95) !important;
}

.light-theme .info-item-text h4 {
    color: rgba(17, 24, 39, 0.9) !important;
}

.info-item-text p {
    margin: 0 !important;
    font-size: 0.9375rem !important;
    line-height: 1.5 !important;
    color: rgba(229, 231, 235, 0.9) !important;
}

.light-theme .info-item-text p {
    color: rgba(55, 65, 81, 0.8) !important;
}

/* Enhanced welcome instructions */
.welcome-instructions {
    text-align: center;
    padding: 2rem 1.5rem;
    border-radius: 8px;
    background: rgba(59, 130, 246, 0.08);
    border: 1px solid rgba(59, 130, 246, 0.15);
    position: relative;
    overflow: hidden;
}

.welcome-instructions::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 3px;
    background: linear-gradient(90deg, #3b82f6, #1d4ed8);
}

.light-theme .welcome-instructions {
    background: rgba(59, 130, 246, 0.05);
    border: 1px solid rgba(59, 130, 246, 0.2);
}

.welcome-instructions h3 {
    color: rgba(249, 250, 251, 0.95);
    margin: 0 0 1rem 0;
    font-size: 1.25rem;
    font-weight: 600;
}

.light-theme .welcome-instructions h3 {
    color: rgba(17, 24, 39, 0.9);
}

.welcome-instructions p {
    margin: 0;
    font-size: 1.0625rem;
    line-height: 1.6;
    color: rgba(229, 231, 235, 0.9);
}

.light-theme .welcome-instructions p {
    color: rgba(55, 65, 81, 0.8);
}

/* Feature Grid - Updated for Color Coding */
.feature-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
    margin: 2rem 0;
}

.feature-card {
    padding: 2rem;
    background: rgba(249, 250, 251, 0.06);
    border: 1px solid rgba(229, 231, 235, 0.12);
    border-radius: 6px;
    text-align: center;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.light-theme .feature-card {
    background: rgba(17, 24, 39, 0.03);
    border: 1px solid rgba(209, 213, 219, 0.2);
}

.feature-card.strength {
    border-top: 2px solid #10b981;
}

.feature-card.weakness {
    border-top: 2px solid #e21a0c;
}

.feature-card.use-case {
    border-top: 2px solid #8b5cf6;
    grid-column: 1 / -1;
    max-width: 400px;
    margin: 0 auto;
}

.feature-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 1px;
    transform: scaleX(0);
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.feature-card.strength::before {
    background: #10b981;
}

.feature-card.weakness::before {
    background: #e21a0c;
}

.feature-card.use-case::before {
    background: #8b5cf6;
}

.feature-card:hover::before {
    transform: scaleX(1);
}

.feature-card:hover {
    background: rgba(249, 250, 251, 0.08);
    border-color: rgba(229, 231, 235, 0.2);
    transform: translateY(-2px);
}

.light-theme .feature-card:hover {
    background: rgba(17, 24, 39, 0.05);
    border-color: rgba(209, 213, 219, 0.3);
}

.feature-indicator {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    margin: 0 auto 1rem auto;
}

.feature-card.strength .feature-indicator {
    background: #10b981;
    box-shadow: 0 0 8px rgba(16, 185, 129, 0.4);
}

.feature-card.weakness .feature-indicator {
    background: #e21a0c;
    box-shadow: 0 0 8px rgba(245, 11, 11, 0.4);
}

.feature-card.use-case .feature-indicator {
    background: #8b5cf6;
    box-shadow: 0 0 8px rgba(139, 92, 246, 0.4);
}

.feature-card h4 {
    margin: 0 0 0.75rem 0;
    font-size: 1.125rem;
    font-weight: 600;
    color: rgba(249, 250, 251, 0.95);
}

.light-theme .feature-card h4 {
    color: rgba(17, 24, 39, 0.9);
}

.feature-card p {
    margin: 0;
    color: rgba(229, 231, 235, 0.9);
    line-height: 1.5;
    font-size: 0.9375rem;
}

.light-theme .feature-card p {
    color: rgba(55, 65, 81, 0.8);
}

/* ID Input System */
.id-input-system {
    max-width: 400px;
    margin: 2rem auto;
}

.input-group {
    position: relative;
    margin: 1.5rem 0;
}

.input-field {
    width: 100%;
    padding: 1rem 1.25rem;
    font-size: 1rem;
    font-family: ui-monospace, 'SF Mono', 'Monaco', 'Cascadia Code', monospace;
    background: rgba(249, 250, 251, 0.08);
    border: 1px solid rgba(229, 231, 235, 0.2);
    border-radius: 6px;
    color: rgba(249, 250, 251, 0.95);
    text-align: center;
    letter-spacing: 0.05em;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.light-theme .input-field {
    background: rgba(255, 255, 255, 0.95);
    border-color: rgba(209, 213, 219, 0.3);
    color: rgba(17, 24, 39, 0.9);
}

.input-field:focus {
    outline: none;
    border-color: #3b82f6;
    background: rgba(249, 250, 251, 0.12);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.light-theme .input-field:focus {
    background: rgba(255, 255, 255, 0.98);
}

.input-field.error {
    border-color: #ef4444;
    background: rgba(239, 68, 68, 0.05);
}

.input-field.success {
    border-color: #10b981;
    background: rgba(16, 185, 129, 0.05);
}

.input-hint {
    font-size: 0.875rem;
    color: rgba(209, 213, 219, 0.7);
    text-align: center;
    margin-top: 0.75rem;
}

.light-theme .input-hint {
    color: rgba(75, 85, 99, 0.6);
}

.input-error {
    font-size: 0.875rem;
    color: #ef4444;
    text-align: center;
    margin-top: 0.5rem;
    opacity: 0;
    transform: translateY(-10px);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.input-error.show {
    opacity: 1;
    transform: translateY(0);
}

/* ===================================================================
   SLEEK CIRCULAR TIMER - Apple/Google Style
   ================================================================= */

.circular-timer {
    position: absolute;
    bottom: 6.5rem;
    /* Raised up from buttons */
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.75rem;
    opacity: 0;
    transition: opacity 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    z-index: 10;
}

.circular-timer.visible {
    opacity: 1;
}

.timer-wheel {
    position: relative;
    width: 2.5rem;
    height: 2.5rem;
}

.timer-wheel svg {
    width: 100%;
    height: 100%;
    transform: rotate(-90deg);
}

.timer-background {
    fill: none;
    stroke: rgba(156, 163, 175, 0.2);
    stroke-width: 2;
}

.light-theme .timer-background {
    stroke: rgba(107, 114, 128, 0.25);
}

.timer-progress-circle {
    fill: none;
    stroke: #3b82f6;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-dasharray: 94.25;
    /* 2 * π * 15 (radius) */
    stroke-dashoffset: 94.25;
    transition: stroke-dashoffset 0.08s ease-out;
}

.light-theme .timer-progress-circle {
    stroke: #2563eb;
}

.timer-center {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 1.25rem;
    height: 1.25rem;
    background: rgba(59, 130, 246, 0.08);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #3b82f6;
    font-size: 0.625rem;
    font-weight: 600;
    font-variant-numeric: tabular-nums;
    transition: all 0.2s ease-out;
}

.light-theme .timer-center {
    background: rgba(37, 99, 235, 0.06);
    color: #2563eb;
}

.timer-label {
    font-size: 0.6875rem;
    color: rgba(156, 163, 175, 0.7);
    font-weight: 500;
    text-align: center;
    letter-spacing: 0.02em;
    text-transform: uppercase;
}

.light-theme .timer-label {
    color: rgba(107, 114, 128, 0.6);
}

/* Completion state */
.timer-complete .timer-center {
    background: rgba(16, 185, 129, 0.08);
    color: #10b981;
}

.light-theme .timer-complete .timer-center {
    background: rgba(16, 185, 129, 0.06);
    color: #059669;
}

.timer-complete .timer-progress-circle {
    stroke: #10b981;
}

.light-theme .timer-complete .timer-progress-circle {
    stroke: #059669;
}

/* Subtle countdown animation */
.timer-countdown {
    transition: transform 0.15s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.timer-countdown.update {
    transform: scale(1.15);
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .circular-timer {
        bottom: 4rem;
    }

    .timer-wheel {
        width: 2.25rem;
        height: 2.25rem;
    }

    .timer-center {
        width: 1.125rem;
        height: 1.125rem;
        font-size: 0.5625rem;
    }

    .timer-label {
        font-size: 0.625rem;
    }
}

@media (max-height: 600px) {
    .circular-timer {
        bottom: 3.5rem;
    }

    .timer-wheel {
        width: 2rem;
        height: 2rem;
    }

    .timer-center {
        width: 1rem;
        height: 1rem;
        font-size: 0.5rem;
    }

    .timer-label {
        font-size: 0.5625rem;
    }
}

@media (max-height: 500px) and (orientation: landscape) {
    .circular-timer {
        bottom: 3rem;
        gap: 0.5rem;
    }
}

/* Navigation System - Made Responsive */
.navigation-system {
    position: relative;
    bottom: 0;
    left: 0;
    transform: none;
    display: flex;
    gap: 1rem;
    margin: 1rem 0 2rem 0;
    opacity: 1;
    /* Changed from 0 to 1 to always show */
    transition: opacity 0.3s ease;
    flex-shrink: 0;
    width: 100%;
    max-width: 400px;
    justify-content: center;
}

.navigation-system.visible {
    opacity: 1;
}

.nav-button {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.875rem 1.5rem;
    border: none;
    border-radius: 6px;
    font-size: 0.9375rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.nav-button:disabled {
    opacity: 0.4;
    cursor: not-allowed;
    transform: none !important;
}

.nav-primary {
    background: linear-gradient(135deg, #3b82f6, #1d4ed8);
    color: white;
    box-shadow: 0 2px 8px rgba(59, 130, 246, 0.25);
}

.nav-primary:hover:not(:disabled) {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
}

.nav-icon {
    width: 18px;
    height: 18px;
    fill: currentColor;
}

.nav-secondary {
    background: rgba(249, 250, 251, 0.15);
    color: rgba(249, 250, 251, 0.8);
    border: 1px solid rgba(229, 231, 235, 0.25);
}

.light-theme .nav-secondary {
    background: rgba(17, 24, 39, 0.08);
    color: rgba(17, 24, 39, 0.7);
    border-color: rgba(209, 213, 219, 0.3);
}

.nav-secondary:hover:not(:disabled) {
    background: rgba(249, 250, 251, 0.2);
    transform: translateY(-1px);
}

.light-theme .nav-secondary:hover:not(:disabled) {
    background: rgba(17, 24, 39, 0.12);
}

.nav-icon {
    width: 18px;
    height: 18px;
    fill: currentColor;
}

.loading-dots {
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.loading-dot {
    width: 4px;
    height: 4px;
    border-radius: 50%;
    background: currentColor;
    animation: loadingBounce 1.4s ease-in-out infinite;
}

.loading-dot:nth-child(1) {
    animation-delay: 0ms;
}

.loading-dot:nth-child(2) {
    animation-delay: 200ms;
}

.loading-dot:nth-child(3) {
    animation-delay: 400ms;
}

@keyframes loadingBounce {

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

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

/* Enhanced Animations */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(30px);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes scaleIn {
    from {
        opacity: 0;
        transform: scale(0.95);
    }

    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* Responsive Design */
@media (max-height: 800px) {
    .welcome-container {
        padding: 0.75rem;
    }

    .progress-system {
        margin: 1rem 0 0.75rem 0;
    }

    .content-card {
        padding: 1.5rem;
    }

    .navigation-system {
        margin: 0.75rem 0 1rem 0;
    }
}

@media (max-height: 700px) {
    .content-card {
        padding: 1.25rem;
        max-height: calc(100vh - 200px);
    }

    .content-title {
        font-size: 2rem;
        margin-bottom: 0.75rem;
    }

    .content-subtitle {
        font-size: 1rem;
        margin-bottom: 1.5rem;
    }

    .info-grid {
        gap: 1rem;
        margin: 1.5rem 0;
    }

    .feature-grid {
        gap: 1rem;
        margin: 1.5rem 0;
    }
}

@media (max-height: 600px) {
    .welcome-container {
        padding: 0.5rem;
        justify-content: center;
    }

    .progress-system {
        margin: 0.75rem 0 0.5rem 0;
    }

    .content-stage {
        margin: 0.5rem 0;
    }

    .content-card {
        padding: 1rem;
        max-height: calc(100vh - 160px);
    }

    .navigation-system {
        margin: 0.5rem 0 0.75rem 0;
    }

    .content-title {
        font-size: 1.75rem;
    }

    .model-hero {
        flex-direction: column;
        gap: 1rem;
        margin: 1rem 0;
        padding: 1.5rem;
    }
}

/* Mobile and Small Tablet */
@media (max-width: 768px) {
    .welcome-container {
        padding: 1rem;
    }

    .progress-system {
        flex-direction: column;
        gap: 0.75rem;
        margin: 1.5rem 0 1rem 0;
    }

    .progress-track {
        width: 200px;
    }

    .content-card {
        padding: 1.5rem;
        margin: 0;
    }

    .content-title {
        font-size: 2rem;
    }

    .content-subtitle {
        font-size: 1rem;
    }

    .model-hero {
        flex-direction: column;
        text-align: center;
        gap: 1.5rem;
        margin: 1.5rem 0;
        padding: 1.5rem;
    }

    .feature-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    .feature-card.use-case {
        grid-column: 1;
    }

    .navigation-system {
        flex-direction: column;
        width: 100%;
        max-width: 300px;
        gap: 0.75rem;
        margin: 1rem 0 1.5rem 0;
    }

    .nav-button {
        justify-content: center;
        width: 100%;
    }
}

/* Very Small Mobile and Landscape */
@media (max-width: 480px),
(max-height: 500px) and (orientation: landscape) {
    .welcome-container {
        padding: 0.75rem;
    }

    .progress-system {
        margin: 1rem 0 0.75rem 0;
    }

    .content-card {
        padding: 1.25rem;
    }

    .content-title {
        font-size: 1.75rem;
    }

    .model-hero {
        padding: 1.25rem;
        margin: 1.25rem 0;
    }

    .navigation-system {
        margin: 0.75rem 0 1.25rem 0;
    }
}

/* Extra small screens */
@media (max-width: 380px) {
    .content-card {
        padding: 1rem;
    }

    .content-title {
        font-size: 1.5rem;
    }

    .progress-track {
        width: 150px;
    }
}

/* Landscape mobile optimization */
@media (max-height: 500px) and (orientation: landscape) {
    .welcome-container {
        justify-content: flex-start;
        padding-top: 0.5rem;
        padding-bottom: 0.5rem;
    }

    .progress-system {
        margin: 0.5rem 0 0.25rem 0;
    }

    .content-stage {
        margin: 0.25rem 0;
    }

    .content-card {
        max-height: calc(100vh - 140px);
        padding: 1rem;
    }

    .navigation-system {
        margin: 0.25rem 0 0.5rem 0;
    }

    .model-hero {
        flex-direction: row;
        gap: 1rem;
        margin: 1rem 0;
        padding: 1rem;
    }

    .feature-grid {
        grid-template-columns: 1fr 1fr;
    }

    .feature-card.use-case {
        grid-column: 1 / -1;
    }
}

/* ===================================================================
   TASK TABS SYSTEM
   ================================================================= */

/* Sidebar Layout */
.sidebar {
    width: var(--sidebar-width);
    background-color: var(--sidebar-bg-dark);
    display: flex;
    flex-direction: column;
    transition: all 0.3s ease;
    overflow: hidden;
    position: relative;
}

/* Sidebar Header - Contains tabs and collapse button */
.sidebar-header {
    padding: 1rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    flex-shrink: 0;
}

.light-theme .sidebar-header {
    border-bottom-color: var(--border-light);
}

/* Task Tabs */
.task-tabs {
    display: flex;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 8px;
    padding: 3px;
    border: none;
}

.light-theme .task-tabs {
    background: rgba(0, 0, 0, 0.03);
}

.task-tab {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0.75rem 0.5rem;
    background: transparent;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    color: var(--text-secondary-dark);
    position: relative;
    overflow: hidden;
}

.light-theme .task-tab {
    color: var(--text-secondary-light);
}

.task-tab:hover {
    background: rgba(255, 255, 255, 0.08);
    color: var(--text-dark);
    transform: translateY(-1px);
}

.light-theme .task-tab:hover {
    background: rgba(0, 0, 0, 0.08);
    color: var(--text-light);
}

.task-tab.active {
    background: var(--user-msg-bg-dark);
    color: white;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    transform: translateY(-1px);
}

.light-theme .task-tab.active {
    background: var(--user-msg-bg-light);
}

.task-icon {
    font-size: 1.25rem;
    line-height: 1;
    transition: all 0.3s ease;
}

.task-tab.active .task-icon {
    transform: scale(1.15);
}

/* Sidebar Toggle - Remove border */
.sidebar-toggle {
    background: none;
    border: none;
    /* Remove border */
    color: var(--text-dark);
    font-size: 1.125rem;
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 0.375rem;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    width: 100%;
    height: 2.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    align-self: center;
}

.light-theme .sidebar-toggle {
    color: var(--text-light);
}

.sidebar-toggle:hover {
    background-color: var(--hover-dark);
    transform: scale(1.05);
}

.light-theme .sidebar-toggle:hover {
    background-color: var(--hover-light);
}

/* Conversation Section - Contains everything below tabs */
.conversation-section {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

/* Task Header - Remove chat count */
.task-header {
    display: flex;
    justify-content: center;
    align-items: center;
    border-bottom: 1px solid var(--border-dark);
    padding: 0.75rem 1rem;
    background: var(--sidebar-bg-dark);
    flex-shrink: 0;
}

.light-theme .task-header {
    background: var(--sidebar-bg-light);
}

.task-title {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-dark);
}

.light-theme .task-title {
    color: var(--text-light);
}

/* New Chat Container - With divider */
.new-chat-container {
    padding: 0.75rem 1rem;
    background: rgba(255, 255, 255, 0.01);
    flex-shrink: 0;
}

.light-theme .new-chat-container {
    border-bottom-color: var(--border-light);
    background: rgba(0, 0, 0, 0.01);
}

.new-chat-btn {
    width: 100%;
    background-color: transparent;
    color: var(--text-dark);
    border: 1px solid var(--border-dark);
    padding: 0.75rem 1rem;
    border-radius: 0.5rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.875rem;
    font-weight: 500;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.light-theme .new-chat-btn {
    color: var(--text-light);
    border-color: var(--border-light);
}

.new-chat-btn:hover {
    background-color: var(--hover-dark);
    transform: translateY(-1px);
}

.light-theme .new-chat-btn:hover {
    background-color: var(--hover-light);
}

.plus-icon {
    font-size: 1.125rem;
    font-weight: bold;
}

.new-chat-label {
    font-weight: 500;
}

/* Conversation List */
.conversation-list {
    flex: 1;
    overflow-y: auto;
    padding: 0.5rem;
}

/* Sidebar Footer - Fixed to bottom */
.sidebar-footer {
    padding: 1rem;
    border-top: 1px solid var(--border-dark);
    margin-top: auto;
    /* This pushes it to the bottom */
    flex-shrink: 0;
}

.light-theme .sidebar-footer {
    border-top-color: var(--border-light);
}

/* Collapsed Sidebar Styles */
.sidebar.collapsed {
    width: var(--sidebar-collapsed-width);
}

.sidebar.collapsed .sidebar-header {
    padding: 1rem 0.5rem;
    align-items: center;
}

.sidebar.collapsed .task-tabs {
    display: none;
}

.sidebar.collapsed .conversation-section {
    display: none;
}

.sidebar.collapsed .sidebar-footer {
    display: none;
}

.sidebar.collapsed .sidebar-toggle {
    width: 2.5rem;
    background: var(--hover-dark);
    display: flex;
    /* Ensure it's always visible */
}

.light-theme .sidebar.collapsed .sidebar-toggle {
    background: var(--hover-light);
}

/* Responsive Design */
@media (max-width: 768px) {
    .new-chat-label {
        display: inline;
        /* Keep label on mobile */
    }
}

@media (max-width: 480px) {
    .task-tab {
        padding: 0.5rem 0.25rem;
    }

    .new-chat-container {
        padding: 0.5rem;
    }
}

/* ===================================================================
   EMPTY STATE STYLING
   ================================================================= */

/* Empty State Styling */
.empty-task-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 2rem 1rem;
    text-align: center;
    color: var(--text-secondary-dark);
    min-height: 200px;
}

.light-theme .empty-task-state {
    color: var(--text-secondary-light);
}

.empty-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
    opacity: 0.5;
}

.empty-task-state p {
    margin: 0.5rem 0;
    font-size: 0.875rem;
    line-height: 1.4;
}

.empty-task-state p:first-of-type {
    font-weight: 600;
    color: var(--text-dark);
}

.light-theme .empty-task-state p:first-of-type {
    color: var(--text-light);
}

/* ===================================================================
   REDESIGNED MODEL COMPARISON SYSTEM - Clean & Streamlined
   ================================================================= */

/* Welcome Experience - Proper Sizing */
.welcome-experience {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: 10000;
    display: none;
    opacity: 0;
    transition: opacity 0.6s cubic-bezier(0.4, 0, 0.2, 1);
    overflow: hidden;
}

.welcome-container {
    width: 100%;
    height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    padding: 2rem 2rem 8rem 2rem;
    max-width: 1400px;
    margin: 0 auto;
    box-sizing: border-box;
    overflow: hidden;
}

/* Progress System - Moved to top */
.progress-system {
    margin: 2rem 0 1rem 0;
    flex-shrink: 0;
}

/* Content Stage - Flexible sizing */
.content-stage {
    flex: 1;
    width: 100%;
    max-width: 1200px;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: visible;
    min-height: 0;
    margin: 0;
}

/* Content Panel - Better sizing */
.content-panel {
    position: absolute;
    width: 100%;
    height: 100%;
    opacity: 0;
    transform: translateX(100px);
    transition: all 0.6s cubic-bezier(0.4, 0, 0.2, 1);
    overflow: visible;
    display: flex;
    align-items: center;
    justify-content: center;
}

.content-panel.active {
    opacity: 1;
    transform: translateX(0);
}

/* Content Card - Responsive sizing */
.content-card {
    background: rgba(249, 250, 251, 0.06);
    border: 1px solid rgba(229, 231, 235, 0.12);
    border-radius: 16px;
    padding: 2rem;
    text-align: center;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    width: 100%;
    max-width: 800px;
    margin: 0 auto;
    max-height: calc(100vh - 200px);
    overflow-y: auto;
}

/* Comparison Panel - Full redesign */
.comparison-panel {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding: 1rem;
    box-sizing: border-box;
    overflow: visible;
    top: -50px;
}

.comparison-container {
    width: 100%;
    max-width: 1200px;
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
    height: 100%;
}

.comparison-container.showing-cards {
    padding-bottom: 2rem;
    /* Space for continue button */
}


.comparison-title {
    text-align: center;
    margin: 0 0 1.5rem 0;
    opacity: 0;
    animation: fadeInUp 0.8s ease-out forwards;
    flex-shrink: 0;
    padding-bottom: 40px;
    position: relative;
    top: -2px;
}

.comparison-title h2 {
    font-size: clamp(2rem, 3.5vw, 2.5rem);
    /* Increased size */
    font-weight: 600;
    color: rgba(249, 250, 251, 0.95);
    margin: 0 0 0.5rem 0;
    letter-spacing: -0.02em;
}

.comparison-title p {
    font-size: clamp(1.125rem, 2.5vw, 1.25rem);
    /* Increased size */
    color: rgba(209, 213, 219, 0.9);
    /* Improved readability */
    margin: 0;
    font-weight: 400;
}

/* Model Cards - Card-based Design */
.model-comparison-container {
    display: flex;
    gap: 1.5rem;
    width: 100%;
    max-width: 1000px;
    margin: 0 auto 2rem auto;
    opacity: 0;
    animation: fadeInUp 1s ease-out 1s forwards;
    flex-shrink: 0;
    transition: all 1s cubic-bezier(0.4, 0, 0.2, 1);
}

.model-comparison-container.shrink {
    transform: scale(0.75) translateY(-40px);
    margin-bottom: 1rem;
}

.model-card {
    flex: 1;
    background: rgba(20, 20, 20, 0.4);
    border: 2px solid rgba(255, 255, 255, 0.08);
    border-radius: 16px;
    padding: 1.5rem;
    position: relative;
    transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    backdrop-filter: blur(10px);
}

.light-theme .model-card {
    background: rgba(255, 255, 255, 0.8);
    border-color: rgba(0, 0, 0, 0.1);
}

.model-card.highlighted {
    border-color: #f59e0b;
    box-shadow: 0 0 30px rgba(31, 20, 1, 0.4);
    background: rgba(245, 158, 11, 0.08);
    transform: scale(1.02);
}

.model-header-card {
    text-align: center;
    margin-bottom: 1.5rem;
}

.model-name-card {
    font-size: 1.75rem;
    /* Increased size */
    font-weight: 700;
    color: rgba(249, 250, 251, 0.95);
    margin: 0 0 0.25rem 0;
    letter-spacing: -0.01em;
}

.light-theme .model-name-card {
    color: rgba(17, 24, 39, 0.9);
}

.model-year-card {
    font-size: 1.5rem;
    color: rgba(226, 228, 231, 0.8);
    margin: 0;
}

.light-theme .model-year-card {
    color: rgba(75, 85, 99, 0.7);
}

/* Capability Items in Cards */
.capability-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin: 1rem 0;
    opacity: 0;
    transform: translateY(10px);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.capability-item.show {
    opacity: 1;
    transform: translateY(0);
}

.capability-item-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 1rem;
    /* Increased size */
    font-weight: 500;
    color: rgba(249, 250, 251, 0.9);
    /* Better readability */
}

.light-theme .capability-item-label {
    color: rgba(17, 24, 39, 0.8);
}

.capability-item-value {
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.capability-icon-small {
    font-size: 1.125rem;
    /* Slightly bigger */
    opacity: 0.8;
}

.capability-icons-inline {
    display: flex;
    align-items: center;
}

.capability-icon-item-inline {
    gap: 0.25rem;
}

.capability-item[data-capability="reasoning"] .capability-icon-item-inline {
    gap: 0.5rem;
}

.capability-icon-item-inline {
    font-size: 1.3rem;
    opacity: 0.2;
    /* Grayed out by default */
    transform: scale(0.9);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    filter: grayscale(0.8);
    /* Make unlit icons gray */
}

.capability-icon-item-inline.lit {
    opacity: 1;
    transform: scale(1);
    filter: none;
    /* Remove grayscale for lit icons */
}

.capability-icon-item-inline.bulb {
    color: #ffd700;
}

.capability-icon-item-inline.bulb.lit {
    filter: drop-shadow(0 0 4px rgba(255, 215, 0, 0.6));
    text-shadow: 0 0 8px rgba(255, 215, 0, 0.5);
}

.capability-icon-item-inline.bolt {
    color: #60a5fa;
}

.capability-icon-item-inline.bolt.lit {
    filter: drop-shadow(0 0 4px rgba(96, 165, 250, 0.6));
    text-shadow: 0 0 8px rgba(96, 165, 250, 0.5);
}

.capability-icon-item-inline.bulb:not(.lit) {
    color: #666666;
    filter: grayscale(1) brightness(0.6);
}

.capability-icon-item-inline.bolt:not(.lit) {
    color: #666666;
    filter: grayscale(1) brightness(0.6);
}

.knowledge-date-inline {
    font-size: 1rem;
    font-weight: 600;
    padding: 0.375rem 0.75rem;
}

/* LMArena Section in Cards */
.lmarena-section-card {
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    padding-top: 1rem;
    margin-top: 1rem;
}

.light-theme .lmarena-section-card {
    border-top-color: rgba(0, 0, 0, 0.1);
}

.lmarena-title-card {
    font-size: 0.875rem;
    /* Increased size */
    font-weight: 600;
    color: rgba(249, 250, 251, 0.8);
    /* Better readability */
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 0.75rem;
    text-align: center;
}

.light-theme .lmarena-title-card {
    color: rgba(17, 24, 39, 0.7);
}

.ranking-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin: 0.5rem 0;
    opacity: 0;
    transform: translateY(10px);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.ranking-item.show {
    opacity: 1;
    transform: translateY(0);
}

.ranking-label-card {
    font-size: 1rem;
    color: rgba(255, 255, 255, 0.8);
}

.light-theme .ranking-label-card {
    color: rgba(75, 85, 99, 0.7);
}

.ranking-value-card {
    position: relative;
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.rank-text-card {
    font-size: 1rem;
    /* Increased size */
    font-weight: 700;
    color: #f59e0b;
    /* Changed to gold/yellow */
}

.light-theme .rank-text-card {
    color: #d97706;
}

/* Capability Cards Header */
.capability-cards-header {
    opacity: 0;
    visibility: hidden;
    transform: translateY(30px);
    transition: all 0.6s cubic-bezier(0.4, 0, 0.2, 1);
    text-align: center;
}

.capability-cards-header.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.capability-cards-header h3 {
    font-size: 1.125rem;
    font-weight: 600;
    color: rgba(249, 250, 251, 0.9);
    margin: 0;
}

.light-theme .capability-cards-header h3 {
    color: rgba(17, 24, 39, 0.8);
}

.model-comparison-container.compact {
    transform: scale(0.7) translateY(-60px);
    margin-bottom: 1rem;
    transition: all 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.capability-cards {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.5rem;
    width: 100%;
    max-width: 900px;
    margin: 1rem auto 0 auto;
    opacity: 0;
    visibility: hidden;
    transform: translateY(30px);
    transition: all 0.8s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    /* Change from absolute */
    top: auto;
    /* Remove the top: 100% */
}

.capability-cards.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
    position: relative;
    top: auto;
}

.capability-card {
    background: rgba(249, 250, 251, 0.06);
    border: 1px solid rgba(229, 231, 235, 0.12);
    border-radius: 12px;
    padding: 1.5rem;
    text-align: center;
    position: relative;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.light-theme .capability-card {
    background: rgba(255, 255, 255, 0.8);
    border: 1px solid rgba(229, 231, 235, 0.3);
}

.capability-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

.strength-card {
    border-top: 3px solid #10b981;
}

.weakness-card {
    border-top: 3px solid #ef4444;
}

.usecase-card {
    border-top: 3px solid #8b5cf6;
}

.card-indicator {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    margin: 0 auto 1rem auto;
}

.strength-card .card-indicator {
    background: #10b981;
    box-shadow: 0 0 8px rgba(16, 185, 129, 0.4);
}

.weakness-card .card-indicator {
    background: #ef4444;
    box-shadow: 0 0 8px rgba(239, 68, 68, 0.4);
}

.usecase-card .card-indicator {
    background: #8b5cf6;
    box-shadow: 0 0 8px rgba(139, 92, 246, 0.4);
}

.capability-card h4 {
    font-size: 1.125rem;
    /* Increased size */
    font-weight: 600;
    color: rgba(249, 250, 251, 0.95);
    margin: 0 0 0.75rem 0;
}

.light-theme .capability-card h4 {
    color: rgba(17, 24, 39, 0.9);
}

.capability-card p {
    font-size: 1.05rem;
    /* Increased size */
    color: rgba(233, 236, 240, 0.9);
    /* Better readability */
    margin: 0;
    line-height: 1.5;
}

.light-theme .capability-card p {
    color: rgba(75, 85, 99, 0.8);
}

.assignment-popup {
    position: absolute;
    top: 60px;
    left: 50%;
    transform: translateX(-50%);
    opacity: 0;
    pointer-events: none;
    z-index: 20;
}

.assignment-popup.show {
    opacity: 1;
    pointer-events: auto;
    animation: none;
}

.assignment-popup.persistent {
    animation: persistentPulse 3s ease-in-out infinite;
}

.popup-content {
    background: rgba(245, 158, 11, 0.95);
    color: white;
    padding: 0.875rem 1.75rem;
    /* Slightly bigger */
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(245, 158, 11, 0.3);
    position: relative;
    font-size: 1rem;
    /* Increased size */
    font-weight: 500;
    white-space: nowrap;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    backdrop-filter: blur(10px);
}

.popup-content::after {
    content: '';
    position: absolute;
    bottom: -6px;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 0;
    border-left: 8px solid transparent;
    border-right: 8px solid transparent;
    border-top: 8px solid rgba(245, 158, 11, 0.95);
}

/* Navigation System - Fixed positioning */
.navigation-system {
    position: fixed;
    bottom: 2rem;
    left: 80%;
    transform: translateX(-50%);
    display: flex;
    gap: 1rem;
    opacity: 1;
    z-index: 20;
    /* Higher z-index to stay above cards */
}

.nav-button {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 1rem 2rem;
    border: none;
    border-radius: 12px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
    backdrop-filter: blur(10px);
}

.nav-button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none !important;
}

.nav-primary {
    background: linear-gradient(135deg, #3b82f6, #1d4ed8);
    color: white;
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
}

.nav-primary:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(59, 130, 246, 0.4);
}

.nav-icon {
    width: 18px;
    height: 18px;
    fill: currentColor;
}

/* Animations */
@keyframes popupBounce {
    0% {
        opacity: 0;
        transform: translateX(-50%) translateY(10px) scale(0.8);
    }

    60% {
        opacity: 1;
        transform: translateX(-50%) translateY(-5px) scale(1.05);
    }

    80% {
        transform: translateX(-50%) translateY(0) scale(1);
    }

    100% {
        opacity: 1;
        /* Changed to stay visible */
        transform: translateX(-50%) translateY(0) scale(1);
    }
}

@keyframes persistentPulse {

    0%,
    100% {
        transform: translateX(-50%) scale(1);
    }

    50% {
        transform: translateX(-50%) scale(1.05);
    }
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Responsive Design */
@media (max-width: 1024px) {
    .model-comparison-container {
        gap: 1rem;
    }

    .model-card {
        padding: 1.25rem;
    }
}

@media (max-width: 768px) {
    .welcome-container {
        padding: 1rem 1rem 6rem 1rem;
    }

    .model-comparison-container {
        flex-direction: column;
        gap: 1rem;
        max-width: 400px;
    }

    .capability-cards {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    .comparison-title h2 {
        font-size: 1.75rem;
    }

    .nav-button {
        padding: 0.875rem 1.5rem;
        font-size: 0.875rem;
    }
}

@media (max-width: 480px) {
    .model-card {
        padding: 1rem;
    }

    .capability-card {
        padding: 1rem;
    }
}

/* Animation for lit icons */
.capability-icon-item-inline.animate-in {
    animation: iconLightUp 0.4s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

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

    50% {
        transform: scale(1.2);
    }

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