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

/* CSS Variables for Light/Dark Mode */
:root {
    /* Light mode colors */
    --bg-gradient: linear-gradient(135deg, #4a90e2 0%, #7b8794 100%);
    --text-primary: #333;
    --text-secondary: #666;
    --text-muted: #999;
    --bg-primary: rgba(255, 255, 255, 0.95);
    --bg-secondary: rgba(255, 255, 255, 0.9);
    --bg-tertiary: rgba(255, 255, 255, 0.1);
    --border-primary: rgba(255, 255, 255, 0.18);
    --border-secondary: rgba(255, 255, 255, 0.1);
    --shadow: rgba(0, 0, 0, 0.1);
    --accent-primary: #4a90e2;
    --accent-secondary: #5ba0f2;
    --danger: #dc3545;
    --success: #28a745;
    --warning: #ffc107;
}

/* Dark mode colors */
body.dark-mode {
    --bg-gradient: linear-gradient(135deg, #1a1a1a 0%, #2d2d2d 100%);
    --text-primary: #e8e8e8;
    --text-secondary: #b8b8b8;
    --text-muted: #888888;
    --bg-primary: rgba(40, 40, 40, 0.95);
    --bg-secondary: rgba(50, 50, 50, 0.9);
    --bg-tertiary: rgba(255, 255, 255, 0.05);
    --border-primary: rgba(255, 255, 255, 0.1);
    --border-secondary: rgba(255, 255, 255, 0.06);
    --shadow: rgba(0, 0, 0, 0.4);
    --accent-primary: #5ba0f2;
    --accent-secondary: #4a90e2;
    --danger: #e74c3c;
    --success: #2ecc71;
    --warning: #f39c12;
}

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

.app-container {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.main-container {
    display: flex;
    flex: 1;
    overflow: hidden;
}

/* Sidebar Styles */
.sidebar {
    width: 200px;
    background: var(--bg-primary);
    backdrop-filter: blur(10px);
    border-right: 1px solid var(--border-primary);
    display: flex;
    flex-direction: column;
    transition: all 0.3s ease;
}

.sidebar.collapsed {
    width: 60px;
    min-width: 60px;
}

.sidebar.collapsed .sidebar-header h3,
.sidebar.collapsed .sidebar-content,
.sidebar.collapsed .tag-filter {
    display: none;
}

.sidebar.collapsed .sidebar-header {
    padding: 15px 8px;
}

.sidebar.collapsed .new-chat-btn {
    width: 36px;
    height: 36px;
    margin: 0 auto;
}

.sidebar-header {
    padding: 15px;
    border-bottom: 1px solid var(--border-secondary);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.sidebar-header h3 {
    margin: 0;
    font-size: 1.1rem;
    font-weight: 600;
    color: #333;
}

.new-chat-btn {
    background: #4a90e2;
    border: none;
    border-radius: 8px;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    cursor: pointer;
    transition: all 0.2s ease;
}

.new-chat-btn:hover {
    background: #357abd;
    transform: scale(1.05);
}

.sidebar-content {
    flex: 1;
    overflow-y: auto;
    padding: 10px;
}

.conversations-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.conversation-item {
    padding: 8px;
    border-radius: 10px;
    transition: all 0.2s ease;
    border: 1px solid transparent;
    display: flex;
    align-items: center;
    gap: 8px;
    position: relative;
}

.conversation-content {
    flex: 1;
    padding: 4px;
    cursor: pointer;
    min-width: 0; /* Allow text truncation */
}

.conversation-item:hover {
    background: rgba(74, 144, 226, 0.1);
    border-color: rgba(74, 144, 226, 0.2);
}

.conversation-item.active {
    background: rgba(74, 144, 226, 0.15);
    border-color: #4a90e2;
}

.conversation-title {
    font-weight: 500;
    color: #333;
    margin-bottom: 4px;
    font-size: 0.9rem;
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.conversation-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.8rem;
    color: #666;
}

.conversation-date {
    font-size: 0.75rem;
}

.sidebar-footer {
    padding: 8px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.toggle-sidebar-btn {
    background: #f8f9fa;
    border: 1px solid #e1e5e9;
    border-radius: 6px;
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    margin: 0 auto;
}

.toggle-sidebar-btn svg {
    transition: transform 0.2s ease;
}

.sidebar.collapsed .toggle-sidebar-btn svg {
    transform: rotate(180deg);
}

.toggle-sidebar-btn:hover {
    background: #e9ecef;
    border-color: #4a90e2;
}

/* Tag Filter Styles */
.tag-filter {
    padding: 10px 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.tag-filter-select {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #e1e5e9;
    border-radius: 8px;
    background: #f8f9fa;
    font-size: 0.9rem;
    color: #333;
    cursor: pointer;
    transition: all 0.2s ease;
}

.tag-filter-select:hover {
    border-color: #4a90e2;
    background: #f0f7ff;
}

.tag-filter-select:focus {
    outline: none;
    border-color: #4a90e2;
    box-shadow: 0 0 0 3px rgba(74, 144, 226, 0.1);
}

/* Conversation Tags */
.conversation-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    margin-top: 4px;
}

.conversation-tag {
    background: rgba(74, 144, 226, 0.1);
    color: #4a90e2;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 0.7rem;
    font-weight: 500;
}

/* Delete Conversation Button */
.delete-conversation-btn {
    background: transparent;
    border: none;
    color: #999;
    cursor: pointer;
    padding: 4px;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: all 0.2s ease;
    flex-shrink: 0;
    width: 24px;
    height: 24px;
}

.conversation-item:hover .delete-conversation-btn {
    opacity: 1;
}

.delete-conversation-btn:hover {
    background: #f8d7da;
    color: #dc3545;
    transform: scale(1.1);
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 1%;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.header {
    background: var(--bg-primary);
    backdrop-filter: blur(10px);
    border-radius: 15px;
    padding: 1% 2%;
    margin-bottom: 1%;
    box-shadow: 0 8px 32px var(--shadow);
    border: 1px solid var(--border-primary);
    display: flex;
    justify-content: space-between;
    align-items: center;
    min-height: 60px;
    max-height: 80px;
    flex-shrink: 0;
}

.logo h1 {
    font-size: 1.5rem;
    font-weight: 700;
    background: linear-gradient(135deg, #2c5aa0, #5a6c7d);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 2px;
}

.logo p {
    color: #666;
    font-size: 0.8rem;
    font-weight: 400;
}

.model-selector select {
    background: #fff;
    border: 2px solid #e1e5e9;
    border-radius: 8px;
    padding: 6px 10px;
    font-size: 0.85rem;
    font-weight: 500;
    color: #333;
    cursor: pointer;
    transition: all 0.3s ease;
    min-width: 160px;
    max-width: 220px;
}

.model-selector select:focus {
    outline: none;
    border-color: #4a90e2;
    box-shadow: 0 0 0 3px rgba(74, 144, 226, 0.1);
}

.chat-container {
    flex: 1;
    background: var(--bg-primary);
    backdrop-filter: blur(10px);
    border-radius: 20px;
    box-shadow: 0 8px 32px var(--shadow);
    border: 1px solid var(--border-primary);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.chat-messages {
    flex: 1;
    padding: 2%;
    overflow-y: auto;
    max-height: calc(100vh - 220px);
    min-height: 200px;
}

.welcome-message {
    text-align: center;
    color: var(--text-secondary);
    margin-top: 50px;
    max-width: 1000px;
    margin-left: auto;
    margin-right: auto;
    padding: 0 20px;
}

.welcome-message h1 {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 20px;
    background: linear-gradient(135deg, #2c5aa0, #5a6c7d);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    color: var(--text-primary);
}

.welcome-message h2 {
    font-size: 2rem;
    font-weight: 600;
    margin-bottom: 10px;
    background: linear-gradient(135deg, #2c5aa0, #5a6c7d);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.welcome-message > p {
    font-size: 1.2rem;
    margin-bottom: 40px;
    line-height: 1.6;
    color: var(--text-primary);
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 25px;
    margin: 40px 0;
    text-align: left;
}

.feature-item {
    background: var(--bg-secondary);
    border: 1px solid var(--border-primary);
    border-radius: 12px;
    padding: 25px;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.feature-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(74, 144, 226, 0.15);
    border-color: var(--accent-primary);
}

.feature-item h3 {
    font-size: 1.3rem;
    font-weight: 600;
    margin-bottom: 10px;
    color: var(--accent-primary);
}

.feature-item p {
    font-size: 0.95rem;
    line-height: 1.5;
    color: var(--text-secondary);
    margin: 0;
}

.cta-section {
    margin-top: 40px;
    padding: 25px;
    background: var(--bg-tertiary);
    border-radius: 12px;
    border: 1px solid var(--border-primary);
}

.cta-section p {
    font-size: 1.1rem;
    margin: 0;
    color: var(--text-primary);
}

.message {
    margin-bottom: 20px;
    animation: fadeIn 0.3s ease-in;
}

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

.message-author {
    font-weight: 600;
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.message-time {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-left: 10px;
}

.message-content {
    background: var(--bg-secondary);
    padding: 15px 20px;
    border-radius: 15px;
    font-size: 1rem;
    line-height: 1.6;
    white-space: pre-wrap;
    word-wrap: break-word;
}

.user-message {
    margin-left: auto;
    max-width: 80%;
}

.user-message .message-author {
    color: #4a90e2;
    text-align: right;
}

.user-message .message-content {
    background: linear-gradient(135deg, #4a90e2, #6c7b87);
    color: white;
    margin-left: auto;
}

.ai-message {
    max-width: 80%;
}

.ai-message .message-author {
    color: #5a6c7d;
}

.ai-message .message-content {
    background: var(--bg-secondary);
    border-left: 4px solid var(--text-secondary);
}

.message-content.streaming {
    background: var(--bg-secondary);
    border-left: 4px solid var(--accent-primary);
}

.typing-indicator {
    color: #4a90e2;
    animation: pulse 1.5s infinite;
    font-size: 1.5em;
    line-height: 1;
}

@keyframes pulse {
    0%, 50%, 100% {
        opacity: 1;
    }
    25%, 75% {
        opacity: 0.3;
    }
}

.chat-input-container {
    padding: 1% 2%;
    border-top: 1px solid var(--border-secondary);
    background: var(--bg-secondary);
    min-height: 80px;
    max-height: 120px;
    flex-shrink: 0;
}

.input-wrapper {
    display: flex;
    align-items: flex-end;
    gap: 1%;
    margin-bottom: 0.5%;
    min-height: 40px;
}

/* File indicators horizontal layout */
.file-indicators {
    display: flex;
    gap: 8px;
    align-items: center;
    flex-wrap: wrap;
    min-width: 0;
}

.image-upload-indicator, .document-upload-indicator {
    display: flex;
    align-items: center;
    gap: 6px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-primary);
    border-radius: 8px;
    padding: 6px 8px;
    position: relative;
    max-width: 200px;
}

.image-upload-indicator {
    background: var(--bg-tertiary);
}

.document-upload-indicator {
    background: var(--bg-secondary);
}

.image-preview {
    max-width: 40px;
    max-height: 40px;
    border-radius: 4px;
    object-fit: cover;
    display: block;
}

.document-info {
    display: flex;
    align-items: center;
    gap: 4px;
}

.document-name {
    font-size: 0.8rem;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 120px;
}

.image-info {
    display: flex;
    align-items: center;
    gap: 4px;
}

.image-name {
    font-size: 0.8rem;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 120px;
}

.remove-file-btn {
    background: rgba(220, 53, 69, 0.1);
    color: #dc3545;
    border: none;
    border-radius: 50%;
    width: 18px;
    height: 18px;
    font-size: 12px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.remove-file-btn:hover {
    background: rgba(220, 53, 69, 0.2);
    transform: scale(1.1);
}

.input-controls-and-text {
    display: flex;
    align-items: flex-end;
    gap: 1%;
    flex: 1;
    min-width: 0;
}

.input-controls {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.attach-image-btn {
    background: #f8f9fa;
    border: 2px solid #e1e5e9;
    border-radius: 8px;
    width: 2rem;
    height: 2rem;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
}

.attach-image-btn:hover {
    border-color: #4a90e2;
    background: #f0f7ff;
}

.attach-image-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    background: #f8f9fa;
}

.attach-document-btn {
    background: #f8f9fa;
    border: 2px solid #e1e5e9;
    border-radius: 8px;
    width: 2rem;
    height: 2rem;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.attach-document-btn:hover {
    border-color: #4a90e2;
    background: #f0f7ff;
}

.attach-document-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    background: #f8f9fa;
}

.web-search-btn {
    background: #f8f9fa;
    border: 2px solid #e1e5e9;
    border-radius: 8px;
    width: 2rem;
    height: 2rem;
    color: black;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
}

.globe-icon {
    filter: grayscale(100%) brightness(0);
    font-size: 16px;
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
    height: 100%;
}

.web-search-btn:hover {
    border-color: #4a90e2;
    background: #f0f7ff;
}

.web-search-btn.active {
    background: #4a90e2;
    border-color: #4a90e2;
    color: white;
}

.web-search-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    background: #f8f9fa;
}

/* Legacy styles - kept for backward compatibility but overridden by new layout */
}

.image-preview img {
    max-width: 100%;
    max-height: 100%;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.remove-image-btn {
    position: absolute;
    top: 5px;
    right: 5px;
    background: #dc3545;
    color: white;
    border: none;
    border-radius: 50%;
    width: 24px;
    height: 24px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    transition: all 0.3s ease;
}

.remove-image-btn:hover {
    background: #c82333;
    transform: scale(1.1);
}

#messageInput {
    flex: 1;
    border: 1px solid var(--border-primary);
    border-radius: 10px;
    padding: 12px 15px;
    font-size: 0.9rem;
    font-family: inherit;
    resize: none;
    min-height: 2rem;
    max-height: 6rem;
    min-width: 0;
    transition: all 0.3s ease;
    background: var(--bg-primary);
    color: var(--text-primary);
}

#messageInput:focus {
    outline: none;
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 3px rgba(74, 144, 226, 0.1);
}

.send-button {
    background: linear-gradient(135deg, #4a90e2, #6c7b87);
    border: none;
    border-radius: 10px;
    width: 2.5rem;
    height: 2.5rem;
    color: white;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.send-button.stop {
    background: linear-gradient(135deg, #dc3545, #c82333);
}

.send-button.stop:hover:not(:disabled) {
    background: linear-gradient(135deg, #c82333, #bd2130);
    box-shadow: 0 5px 15px rgba(220, 53, 69, 0.4);
}

.send-button:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(74, 144, 226, 0.4);
}

.send-button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.character-count {
    text-align: right;
    font-size: 0.7rem;
    color: #999;
    margin-top: 2px;
}

.loading-spinner {
    width: 20px;
    height: 20px;
    border: 2px solid #f3f3f3;
    border-top: 2px solid #4a90e2;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-right: 8px;
    display: inline-block;
}

.loading-message {
    display: flex;
    align-items: center;
    color: #666;
    font-style: italic;
}

.error-message {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
    border-radius: 10px;
    padding: 15px;
    margin: 20px 0;
    text-align: center;
}

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

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

@media (max-width: 768px) {
    .container {
        padding: 0.5%;
    }
    
    /* Mobile header - smaller */
    .header {
        flex-direction: column;
        gap: 0.5%;
        text-align: center;
        padding: 1% 2%;
        margin-bottom: 0.5%;
        height: 10vh;
        min-height: 80px;
    }
    
    .logo h1 {
        font-size: 1rem;
        margin-bottom: 0;
    }
    
    .logo p {
        font-size: 0.7rem;
        margin: 0;
    }
    
    .model-selector select {
        font-size: 0.8rem;
        padding: 1% 2%;
    }
    
    /* Mobile sidebar - much smaller */
    .sidebar {
        width: 20%;
        min-width: 80px;
        max-width: 120px;
    }
    
    .sidebar-header {
        padding: 2% 3%;
    }
    
    .sidebar-header h3 {
        font-size: 0.7rem;
    }
    
    .new-chat-btn {
        width: 1.8rem;
        height: 1.8rem;
    }
    
    .sidebar-content {
        padding: 1%;
    }
    
    .conversation-item {
        padding: 2%;
    }
    
    .conversation-title {
        font-size: 0.65rem;
        -webkit-line-clamp: 1;
    }
    
    .conversation-meta {
        font-size: 0.55rem;
    }
    
    .tag-filter {
        padding: 1% 2%;
    }
    
    .tag-filter-select {
        padding: 1%;
        font-size: 0.6rem;
    }
    
    /* Mobile chat area - maximized */
    .chat-messages {
        padding: 2%;
        height: 66.5vh;
        min-height: 250px;
    }
    
    /* Mobile input area - compact */
    .chat-input-container {
        padding: 1% 2%;
        height: 15vh;
        min-height: 70px;
        max-height: 100px;
    }
    
    .input-wrapper {
        gap: 1%;
        margin-bottom: 0.5%;
        height: 70%;
    }

    /* Mobile file indicators */
    .file-indicators {
        gap: 4px;
        flex-direction: row;
        flex-wrap: wrap;
    }

    .image-upload-indicator, .document-upload-indicator {
        max-width: 150px;
        padding: 4px 6px;
    }

    .image-preview {
        max-width: 30px;
        max-height: 30px;
    }

    .document-name {
        font-size: 0.7rem;
        max-width: 80px;
    }

    .image-name {
        font-size: 0.7rem;
        max-width: 80px;
    }

    .remove-file-btn {
        width: 16px;
        height: 16px;
        font-size: 10px;
    }

    .input-controls-and-text {
        gap: 0.5%;
    }
    
    .attach-image-btn, .attach-document-btn, .web-search-btn {
        width: 1.6rem;
        height: 1.6rem;
        font-size: 0.8rem;
    }
    
    #messageInput {
        padding: 2% 3%;
        min-height: 1.8rem;
        font-size: 0.8rem;
    }
    
    .send-button {
        width: 2rem;
        height: 2rem;
    }
    
    .character-count {
        font-size: 0.65rem;
    }
    
    .user-message,
    .ai-message {
        max-width: 95%;
    }
    
    .welcome-message h1 {
        font-size: 1.8rem;
    }
    
    .welcome-message h2 {
        font-size: 1.3rem;
    }
    
    .welcome-message {
        margin-top: 10%;
        padding: 0 15px;
    }
    
    .features-grid {
        grid-template-columns: 1fr;
        gap: 20px;
        margin: 30px 0;
    }
    
    .feature-item {
        padding: 20px;
    }
    
    .cta-section {
        margin-top: 30px;
        padding: 20px;
    }
    
    /* Mobile collapsed sidebar */
    .sidebar.collapsed {
        width: 40px;
        min-width: 40px;
    }
    
    .sidebar.collapsed .new-chat-btn {
        width: 28px;
        height: 28px;
    }
}

/* Image Generation Styles */
.image-container {
    display: flex;
    flex-direction: column;
    gap: 10px;
    align-items: center;
}

.generated-image {
    max-width: 100%;
    max-height: 400px;
    border-radius: 10px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    cursor: pointer;
    transition: transform 0.3s ease;
}

.generated-image:hover {
    transform: scale(1.05);
}

.download-link {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 8px 16px;
    background: linear-gradient(135deg, #4a90e2, #6c7b87);
    color: white;
    text-decoration: none;
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 500;
    transition: all 0.3s ease;
}

.download-link:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(74, 144, 226, 0.4);
}

/* Header Controls */
.header-controls {
    display: flex;
    align-items: center;
    gap: 15px;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px 12px;
    background: var(--bg-tertiary);
    border-radius: 8px;
    border: 1px solid var(--border-primary);
}

.user-details {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.user-email {
    color: #333;
    font-size: 0.9rem;
    font-weight: 500;
}

.usage-info {
    color: #666;
    font-size: 0.75rem;
    font-weight: 400;
}

.usage-info.unlimited {
    color: #28a745;
}

.usage-info.blocked {
    color: #dc3545;
}

.usage-info.limited {
    color: #ffc107;
}

.login-btn, .logout-btn {
    background: linear-gradient(135deg, #007bff, #0056b3);
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
}

.logout-btn {
    background: linear-gradient(135deg, #dc3545, #c82333);
    padding: 6px 12px;
    font-size: 0.8rem;
}

.login-btn:hover, .logout-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 123, 255, 0.4);
}

.logout-btn:hover {
    box-shadow: 0 5px 15px rgba(220, 53, 69, 0.4);
}

/* Dark Mode Toggle */
.dark-mode-toggle {
    background: var(--bg-secondary);
    border: 1px solid var(--border-primary);
    padding: 8px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-primary);
    margin-right: 8px;
}

.dark-mode-toggle:hover {
    background: var(--bg-tertiary);
    transform: translateY(-1px);
    box-shadow: 0 3px 10px var(--shadow);
}

.dark-mode-toggle svg {
    transition: all 0.3s ease;
}

body.dark-mode .dark-mode-toggle .sun-icon {
    display: none;
}

body.dark-mode .dark-mode-toggle .moon-icon {
    display: block !important;
}

/* Markdown and Code Styling */
.message-content h1,
.message-content h2,
.message-content h3,
.message-content h4,
.message-content h5,
.message-content h6 {
    margin: 1em 0 0.5em 0;
    font-weight: 600;
    color: var(--text-primary);
}

.message-content h1 { font-size: 1.5em; }
.message-content h2 { font-size: 1.3em; }
.message-content h3 { font-size: 1.1em; }

.message-content p {
    margin: 0.5em 0;
    line-height: 1.6;
}

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

.message-content li {
    margin: 0.3em 0;
}

.message-content blockquote {
    border-left: 4px solid var(--accent-primary);
    margin: 1em 0;
    padding: 0.5em 1em;
    background: var(--bg-tertiary);
    font-style: italic;
}

.message-content table {
    border-collapse: collapse;
    margin: 1em 0;
    width: 100%;
}

.message-content th,
.message-content td {
    border: 1px solid var(--border-primary);
    padding: 0.5em;
    text-align: left;
}

.message-content th {
    background: var(--bg-tertiary);
    font-weight: 600;
}

/* Code Styling */
.message-content pre {
    background: #f8f8f8;
    border: 1px solid #e1e1e1;
    border-radius: 8px;
    padding: 1em;
    margin: 1em 0;
    overflow-x: auto;
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
    font-size: 0.9em;
    line-height: 1.4;
}

/* Dark mode code blocks */
body.dark-mode .message-content pre {
    background: #1e1e1e;
    border: 1px solid #404040;
    color: #e8e8e8;
}

.message-content pre code {
    background: none;
    border: none;
    padding: 0;
    font-size: inherit;
}

.message-content .inline-code {
    background: #f0f0f0;
    border: 1px solid #d0d0d0;
    border-radius: 4px;
    padding: 0.2em 0.4em;
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
    font-size: 0.9em;
    color: #333;
}

/* Dark mode inline code */
body.dark-mode .message-content .inline-code {
    background: #2a2a2a;
    border: 1px solid #505050;
    color: #e0e0e0;
}

/* Ensure highlight.js themes work properly */
.message-content .hljs {
    background: #f8f8f8 !important;
    color: #333;
    border-radius: 8px;
}

/* Dark mode highlight.js */
body.dark-mode .message-content .hljs {
    background: #1e1e1e !important;
    color: #e8e8e8;
}

/* Dark mode conversation titles */
body.dark-mode .conversation-title {
    color: var(--text-primary);
}

/* Dark mode sidebar header (Conversations text) */
body.dark-mode .sidebar-header h3 {
    color: var(--text-primary);
}

.document-preview {
    position: relative;
    margin-bottom: 10px;
    display: none;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-primary);
    border-radius: 8px;
    padding: 12px;
}

.document-info {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 0.9rem;
    color: var(--text-primary);
}

.document-name {
    flex: 1;
    margin-right: 10px;
}

.remove-document-btn {
    background: var(--danger);
    color: white;
    border: none;
    border-radius: 50%;
    width: 24px;
    height: 24px;
    cursor: pointer;
    font-size: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.2s;
}

.remove-document-btn:hover {
    background: #c0392b;
}

/* Links */
.message-content a {
    color: var(--accent-primary);
    text-decoration: none;
}

.message-content a:hover {
    text-decoration: underline;
}

/* Horizontal rules */
.message-content hr {
    border: none;
    border-top: 1px solid var(--border-primary);
    margin: 1.5em 0;
}

.verify-email-btn {
    background: linear-gradient(135deg, #28a745, #20c997);
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
}

.verify-email-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(40, 167, 69, 0.4);
}

.model-selector select:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    background: #f8f9fa;
}

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

.modal-content {
    background: white;
    border-radius: 15px;
    padding: 0;
    max-width: 400px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    animation: modalSlideIn 0.3s ease;
}

.modal-header {
    padding: 20px 25px;
    border-bottom: 1px solid #eee;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: linear-gradient(135deg, #4a90e2, #6c7b87);
    color: white;
    border-radius: 15px 15px 0 0;
}

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

.close-modal {
    font-size: 24px;
    cursor: pointer;
    color: white;
    opacity: 0.8;
    transition: opacity 0.3s ease;
}

.close-modal:hover {
    opacity: 1;
}

.modal-body {
    padding: 25px;
}

.verification-step {
    text-align: center;
}

.verification-step p {
    margin-bottom: 20px;
    color: #666;
    line-height: 1.5;
}

.email-input,
.code-input {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid #e1e5e9;
    border-radius: 8px;
    font-size: 1rem;
    margin-bottom: 20px;
    transition: border-color 0.3s ease;
    text-align: center;
}

.email-input:focus,
.code-input:focus {
    outline: none;
    border-color: #4a90e2;
    box-shadow: 0 0 0 3px rgba(74, 144, 226, 0.1);
}

.code-input {
    font-size: 1.5rem;
    letter-spacing: 0.5em;
    font-family: 'Courier New', monospace;
}

.modal-btn {
    background: linear-gradient(135deg, #4a90e2, #6c7b87);
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    width: 100%;
    margin-bottom: 10px;
}

.modal-btn:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(74, 144, 226, 0.4);
}

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

.modal-btn-secondary {
    background: transparent;
    color: #4a90e2;
    border: 2px solid #4a90e2;
    padding: 10px 20px;
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    width: 100%;
}

.modal-btn-secondary:hover {
    background: #4a90e2;
    color: white;
}

.modal-status {
    padding: 15px 25px;
    border-top: 1px solid #eee;
    font-size: 0.9rem;
    text-align: center;
    min-height: 20px;
}

.modal-status.success {
    color: #28a745;
    background: #d4edda;
}

.modal-status.error {
    color: #dc3545;
    background: #f8d7da;
}

.success-message {
    padding: 20px;
    text-align: center;
}

.success-message h4 {
    color: #28a745;
    margin-bottom: 10px;
    font-size: 1.2rem;
}

.success-message p {
    color: #666;
    margin: 0;
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: scale(0.9) translateY(-20px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

/* Settings Button */
.settings-btn {
    background: var(--bg-secondary);
    border: 1px solid var(--border-primary);
    padding: 8px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-primary);
    margin-right: 8px;
}

.settings-btn:hover {
    background: var(--bg-tertiary);
    transform: translateY(-1px);
    box-shadow: 0 3px 10px var(--shadow);
}

/* Settings Modal */
.settings-modal-content {
    max-width: 500px;
    width: 95%;
}

.settings-section {
    margin-bottom: 25px;
}

.settings-section label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: var(--text-primary);
}

.slider {
    width: 100%;
    height: 6px;
    border-radius: 3px;
    background: #ddd;
    outline: none;
    opacity: 0.7;
    transition: opacity 0.2s;
    -webkit-appearance: none;
    appearance: none;
}

.slider:hover {
    opacity: 1;
}

.slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: var(--accent-primary);
    cursor: pointer;
    box-shadow: 0 2px 6px rgba(0,0,0,0.2);
    transition: all 0.2s ease;
}

.slider::-webkit-slider-thumb:hover {
    transform: scale(1.1);
    box-shadow: 0 3px 8px rgba(0,0,0,0.3);
}

.slider::-moz-range-thumb {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: var(--accent-primary);
    cursor: pointer;
    border: none;
    box-shadow: 0 2px 6px rgba(0,0,0,0.2);
}

/* Dark mode slider */
body.dark-mode .slider {
    background: #555;
}

/* Dark mode settings modal styling */
body.dark-mode .settings-modal-content {
    background: var(--bg-primary);
    color: var(--text-primary);
}

body.dark-mode .system-prompt-textarea {
    background: var(--bg-secondary);
    border-color: var(--border-primary);
    color: var(--text-primary);
}

body.dark-mode .system-prompt-textarea:focus {
    border-color: var(--accent-primary);
}

body.dark-mode .setting-description {
    color: var(--text-muted);
}

body.dark-mode .settings-section label {
    color: var(--text-primary);
}

.setting-description {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-top: 5px;
    font-style: italic;
}

.system-prompt-textarea {
    width: 100%;
    min-height: 120px;
    padding: 12px;
    border: 2px solid var(--border-primary);
    border-radius: 8px;
    font-family: inherit;
    font-size: 0.9rem;
    resize: vertical;
    transition: border-color 0.3s ease;
    background: var(--bg-primary);
    color: var(--text-primary);
}

.system-prompt-textarea:focus {
    outline: none;
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 3px rgba(74, 144, 226, 0.1);
}

.settings-actions {
    display: flex;
    gap: 15px;
    margin-top: 30px;
}

.settings-actions .modal-btn,
.settings-actions .modal-btn-secondary {
    flex: 1;
}

/* Close button for settings modal */
.close-settings-modal {
    font-size: 24px;
    cursor: pointer;
    color: white;
    opacity: 0.8;
    transition: opacity 0.3s ease;
}

.close-settings-modal:hover {
    opacity: 1;
}

@media (max-width: 768px) {
    .header-controls {
        flex-direction: row;
        flex-wrap: wrap;
        gap: 6px;
        justify-content: center;
    }
    
    .user-info {
        padding: 4px 6px;
        font-size: 0.7rem;
    }
    
    .user-email {
        font-size: 0.7rem;
    }
    
    .usage-info {
        font-size: 0.6rem;
    }
    
    .settings-btn,
    .dark-mode-toggle {
        padding: 4px;
        margin-right: 4px;
    }
    
    .login-btn, .logout-btn, .verify-email-btn {
        font-size: 0.7rem;
        padding: 4px 8px;
    }
    
    .modal-content {
        width: 95%;
        margin: 10px;
    }

    .settings-modal-content {
        width: 98%;
        margin: 5px;
    }

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

/* =============================================================================
   BILLING AND SUBSCRIPTION STYLES
   ============================================================================= */

.help-btn,
.billing-btn {
    background: var(--bg-secondary);
    border: 1px solid var(--border-primary);
    padding: 8px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-primary);
    margin-right: 8px;
}

.help-btn:hover,
.billing-btn:hover {
    background: var(--bg-tertiary);
    transform: translateY(-1px);
    box-shadow: 0 3px 10px var(--shadow);
}

.billing-modal-content {
    max-width: 800px;
    width: 90%;
    background: var(--bg-color);
    color: var(--text-color);
    border: 1px solid var(--border-color);
}

.billing-section {
    margin-bottom: 30px;
}

.billing-section h4 {
    color: var(--text-color);
    margin-bottom: 15px;
    font-size: 1.1rem;
    font-weight: 600;
}

.current-plan-info {
    padding: 20px;
    background: var(--input-bg);
    border-radius: 8px;
    border: 1px solid var(--border-color);
}

.plan-status {
    font-size: 1rem;
    color: var(--text-color);
}

.plan-status.loading {
    color: var(--text-secondary);
    font-style: italic;
}

.plan-details {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
    margin-top: 15px;
}

.plan-detail {
    display: flex;
    flex-direction: column;
}

.plan-detail-label {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-bottom: 4px;
}

.plan-detail-value {
    font-size: 1rem;
    color: var(--text-color);
    font-weight: 600;
}

.plans-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
}

.plan-card {
    background: var(--input-bg);
    border: 2px solid var(--border-color);
    border-radius: 12px;
    padding: 24px;
    transition: all 0.2s ease;
    position: relative;
    overflow: hidden;
}

.plan-card:hover {
    border-color: var(--accent-primary);
    transform: translateY(-2px);
    box-shadow: 0 4px 20px rgba(0,0,0,0.1);
}

.plan-card.current-plan {
    border-color: var(--accent-primary);
    background: linear-gradient(135deg, var(--input-bg) 0%, rgba(74, 144, 226, 0.05) 100%);
}

.plan-card.current-plan::before {
    content: "Current Plan";
    position: absolute;
    top: 12px;
    right: 12px;
    background: var(--accent-primary);
    color: white;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
}

.plan-name {
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--text-color);
    margin-bottom: 8px;
}

.plan-price {
    font-size: 2rem;
    font-weight: 800;
    color: var(--accent-primary);
    margin-bottom: 6px;
}

.plan-price-period {
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin-bottom: 20px;
}

.plan-features {
    margin-bottom: 20px;
}

.plan-feature {
    display: flex;
    align-items: center;
    margin-bottom: 8px;
    font-size: 0.9rem;
    color: var(--text-color);
}

.plan-feature::before {
    content: "✓";
    color: var(--accent-primary);
    font-weight: bold;
    margin-right: 8px;
}

.plan-action {
    width: 100%;
    padding: 12px 20px;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 0.95rem;
}

.plan-action.primary {
    background: var(--accent-primary);
    color: white;
}

.plan-action.primary:hover {
    background: var(--accent-hover);
    transform: translateY(-1px);
}

.plan-action.secondary {
    background: transparent;
    color: var(--text-secondary);
    border: 2px solid var(--border-color);
}

.plan-action.secondary:hover {
    border-color: var(--accent-primary);
    color: var(--accent-primary);
}

.plan-action:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none !important;
}

.billing-actions {
    display: flex;
    gap: 15px;
    align-items: center;
}

.usage-progress {
    margin: 15px 0;
}

.usage-progress-label {
    display: flex;
    justify-content: space-between;
    margin-bottom: 8px;
    font-size: 0.9rem;
}

.usage-progress-bar {
    width: 100%;
    height: 8px;
    background: var(--border-color);
    border-radius: 4px;
    overflow: hidden;
}

.usage-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--accent-primary), var(--accent-hover));
    border-radius: 4px;
    transition: width 0.3s ease;
}

.usage-progress-fill.warning {
    background: linear-gradient(90deg, #ffa500, #ff8c00);
}

.usage-progress-fill.danger {
    background: linear-gradient(90deg, #ff4444, #cc0000);
}

/* Dark mode adjustments */
[data-theme="dark"] .billing-modal-content {
    background: var(--bg-color);
    color: var(--text-color);
}

[data-theme="dark"] .current-plan-info {
    background: var(--surface-color);
    border-color: var(--border-color);
}

[data-theme="dark"] .plan-card {
    background: var(--surface-color);
    border-color: var(--border-color);
    color: var(--text-color);
}

[data-theme="dark"] .plan-name {
    color: var(--text-color);
}

[data-theme="dark"] .plan-price {
    color: var(--accent-primary);
}

[data-theme="dark"] .plan-price-period {
    color: var(--text-secondary);
}

[data-theme="dark"] .plan-feature {
    color: var(--text-color);
}

[data-theme="dark"] .plan-card:hover {
    box-shadow: 0 4px 20px rgba(255,255,255,0.05);
}

[data-theme="dark"] .plan-card.current-plan {
    background: linear-gradient(135deg, var(--surface-color) 0%, rgba(74, 144, 226, 0.1) 100%);
}

[data-theme="dark"] .plan-action.secondary {
    background: transparent;
    color: var(--text-secondary);
    border-color: var(--border-color);
}

[data-theme="dark"] .plan-action.secondary:hover {
    border-color: var(--accent-primary);
    color: var(--accent-primary);
}

[data-theme="dark"] .usage-progress-bar {
    background: var(--border-color);
}

[data-theme="dark"] .billing-section h4 {
    color: var(--text-color);
}

[data-theme="dark"] .modal-status {
    color: var(--text-color);
}

[data-theme="dark"] .modal-status.error {
    color: #ff6b6b;
}

[data-theme="dark"] .modal-status.success {
    color: #51cf66;
}

[data-theme="dark"] .modal-status.info {
    color: var(--accent-primary);
}

/* Mobile responsiveness */
@media (max-width: 768px) {
    .billing-modal-content {
        width: 95%;
        margin: 10px;
    }
    
    .plans-grid {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .plan-details {
        grid-template-columns: 1fr;
        gap: 10px;
    }
    
    .billing-actions {
        flex-direction: column;
        gap: 10px;
    }
    
    .billing-btn {
        padding: 6px;
        margin-right: 6px;
    }
}

/* Performance Optimizations */
* {
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Reduce repaints */
.message-content,
.chat-messages,
.sidebar,
.modal-content {
    will-change: auto;
    transform: translateZ(0);
}

/* GPU acceleration for animations */
.feature-item:hover,
.modal,
.sidebar.collapsed {
    transform: translateZ(0);
}

/* Optimize scrolling */
.chat-messages {
    scroll-behavior: smooth;
    -webkit-overflow-scrolling: touch;
}

/* Optimize font loading */
@font-face {
    font-family: 'Inter';
    font-display: swap;
}

/* Critical CSS loading optimization */
.app-container {
    contain: layout style paint;
}

/* Image optimization for future images */
img {
    max-width: 100%;
    height: auto;
    loading: lazy;
}

/* Reduce layout thrashing */
.welcome-message h1 {
    contain: layout style;
}

.features-grid {
    contain: layout style;
}

/* Usage Info Styles */
.usage-info {
    font-size: 0.9rem;
    font-weight: 500;
    padding: 4px 8px;
    border-radius: 6px;
    transition: all 0.3s ease;
}

.usage-info.unlimited {
    color: #28a745;
    background: rgba(40, 167, 69, 0.1);
}

.usage-info.blocked {
    color: #dc3545;
    background: rgba(220, 53, 69, 0.1);
}

.usage-info.limited {
    color: #6c757d;
    background: rgba(108, 117, 125, 0.1);
}

.usage-info.trial {
    color: #4a90e2;
    background: linear-gradient(135deg, rgba(74, 144, 226, 0.15), rgba(74, 144, 226, 0.05));
    font-weight: 600;
    border: 1px solid rgba(74, 144, 226, 0.2);
    animation: pulse-trial 2s ease-in-out infinite;
}

@keyframes pulse-trial {
    0%, 100% { 
        transform: scale(1); 
        box-shadow: 0 0 0 0 rgba(74, 144, 226, 0.4);
    }
    50% { 
        transform: scale(1.02);
        box-shadow: 0 0 0 6px rgba(74, 144, 226, 0.1);
    }
}

/* Landing Page Styles */
.landing-page {
    width: 100%;
    min-height: 100vh;
    background: var(--bg-gradient);
    overflow-x: hidden;
}

/* Hide header when landing page is shown */
.body-landing-page .header {
    display: none;
}

/* Hero Section */
.hero-section {
    min-height: 90vh;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 4rem 2rem;
    max-width: 1400px;
    margin: 0 auto;
    gap: 4rem;
}

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

.hero-badge {
    display: inline-block;
    background: linear-gradient(135deg, #ff6b6b, #ee5a24);
    color: white;
    padding: 0.5rem 1rem;
    border-radius: 50px;
    font-weight: 600;
    font-size: 0.9rem;
    margin-bottom: 1.5rem;
    animation: pulse-badge 2s ease-in-out infinite;
}

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

.hero-title {
    font-size: 3.5rem;
    font-weight: 700;
    line-height: 1.1;
    margin-bottom: 1.5rem;
    color: var(--text-primary);
}

.hero-title .highlight {
    color: #ff6b6b;
    position: relative;
    font-weight: 800;
}

.hero-title .highlight::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 0;
    width: 100%;
    height: 3px;
    background: #ff6b6b;
    border-radius: 2px;
}

.hero-subtitle {
    font-size: 1.3rem;
    line-height: 1.6;
    margin-bottom: 2rem;
    color: var(--text-secondary);
}

.hero-subtitle .sub-highlight {
    color: var(--accent-primary);
    font-weight: 600;
}

.hero-cta {
    margin-bottom: 1rem;
}

.hero-cta-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.75rem;
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
    color: white;
    padding: 1rem 2rem;
    border: none;
    border-radius: 12px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    box-shadow: 0 10px 30px rgba(74, 144, 226, 0.3);
}

.hero-cta-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 15px 40px rgba(74, 144, 226, 0.4);
}

.cta-icon {
    font-size: 1.2rem;
}

.hero-trust {
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin-top: 1rem;
}

.trust-icon {
    color: var(--success);
    font-weight: bold;
}

/* Hero Visual */
.hero-visual {
    flex: 1;
    max-width: 500px;
    display: flex;
    justify-content: center;
    align-items: center;
}

.chat-demo {
    background: var(--bg-primary);
    border-radius: 20px;
    padding: 1.5rem;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.2);
    backdrop-filter: blur(10px);
    border: 1px solid var(--border-primary);
    width: 100%;
    max-width: 400px;
}

.demo-message {
    display: flex;
    gap: 0.75rem;
    margin-bottom: 1rem;
    animation: slide-in 0.5s ease-out;
}

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

@keyframes slide-in {
    from { opacity: 0; transform: translateX(-20px); }
    to { opacity: 1; transform: translateX(0); }
}

.demo-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    flex-shrink: 0;
}

.demo-user .demo-avatar {
    background: var(--accent-primary);
    color: white;
}

.demo-ai .demo-avatar {
    background: var(--success);
    color: white;
}

.demo-content {
    flex: 1;
    background: var(--bg-secondary);
    padding: 0.75rem 1rem;
    border-radius: 12px;
    position: relative;
}

.demo-user .demo-content {
    border-bottom-left-radius: 4px;
}

.demo-ai .demo-content {
    border-bottom-right-radius: 4px;
}

.demo-typing {
    display: flex;
    gap: 4px;
    margin-top: 0.5rem;
}

.demo-typing span {
    width: 8px;
    height: 8px;
    background: var(--text-muted);
    border-radius: 50%;
    animation: typing 1.4s ease-in-out infinite;
}

.demo-typing span:nth-child(2) {
    animation-delay: 0.2s;
}

.demo-typing span:nth-child(3) {
    animation-delay: 0.4s;
}

@keyframes typing {
    0%, 60%, 100% { transform: translateY(0); }
    30% { transform: translateY(-10px); }
}

/* Trust Section */
.trust-section {
    padding: 4rem 2rem;
    background: var(--bg-primary);
    backdrop-filter: blur(10px);
}

.trust-content {
    max-width: 1200px;
    margin: 0 auto;
    text-align: center;
}

.trust-content h2 {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 3rem;
    color: var(--text-primary);
}

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

.trust-item {
    background: var(--bg-secondary);
    padding: 2rem;
    border-radius: 16px;
    border: 1px solid var(--border-primary);
    text-align: center;
    transition: transform 0.3s ease;
}

.trust-item:hover {
    transform: translateY(-5px);
}

.trust-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
}

.trust-item h3 {
    font-size: 1.3rem;
    font-weight: 600;
    margin-bottom: 1rem;
    color: var(--text-primary);
}

.trust-item p {
    font-size: 1rem;
    line-height: 1.6;
    color: var(--text-secondary);
}

/* Features Section */
.features-section {
    padding: 4rem 2rem;
    max-width: 1200px;
    margin: 0 auto;
}

.section-header {
    text-align: center;
    margin-bottom: 3rem;
}

.section-header h2 {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 1rem;
    color: var(--text-primary);
}

.section-header p {
    font-size: 1.2rem;
    color: var(--text-secondary);
}

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

.feature-card {
    background: var(--bg-primary);
    padding: 2rem;
    border-radius: 16px;
    border: 1px solid var(--border-primary);
    transition: all 0.3s ease;
    text-align: center;
}

.feature-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
}

.feature-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
}

.feature-card h3 {
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 1rem;
    color: var(--text-primary);
}

.feature-card p {
    font-size: 1rem;
    line-height: 1.6;
    color: var(--text-secondary);
    margin-bottom: 1rem;
}

.feature-models, .feature-formats {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    justify-content: center;
    margin-top: 1rem;
}

.model-tag, .format-tag {
    background: var(--accent-primary);
    color: white;
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 500;
}

.feature-highlight {
    margin-top: 1rem;
    padding: 0.5rem 1rem;
    background: rgba(74, 144, 226, 0.1);
    border-radius: 8px;
    border: 1px solid rgba(74, 144, 226, 0.2);
}

.highlight-text {
    color: var(--accent-primary);
    font-weight: 600;
    font-size: 0.9rem;
}

.pricing-comparison {
    margin-top: 1rem;
    padding: 0.75rem;
    background: rgba(40, 167, 69, 0.1);
    border-radius: 8px;
    border: 1px solid rgba(40, 167, 69, 0.2);
}

.price-comparison {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.9rem;
}

.competitor {
    color: var(--text-secondary);
    text-decoration: line-through;
}

.savings {
    color: var(--success);
    font-weight: 600;
}

/* Pricing Section */
.pricing-section {
    padding: 4rem 2rem;
    background: var(--bg-primary);
    backdrop-filter: blur(10px);
}

.pricing-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
    max-width: 800px;
    margin: 0 auto 3rem;
}

.pricing-card {
    background: var(--bg-secondary);
    border-radius: 20px;
    padding: 2.5rem;
    border: 2px solid var(--border-primary);
    position: relative;
    transition: all 0.3s ease;
}

.pricing-card.popular {
    border-color: var(--accent-primary);
    transform: scale(1.05);
}

.popular-badge {
    position: absolute;
    top: -10px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--accent-primary);
    color: white;
    padding: 0.5rem 1rem;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
}

.pricing-header h3 {
    font-size: 1.8rem;
    font-weight: 700;
    margin-bottom: 1rem;
    color: var(--text-primary);
    text-align: center;
}

.price {
    text-align: center;
    margin-bottom: 0.5rem;
}

.currency {
    font-size: 1.5rem;
    color: var(--text-secondary);
}

.amount {
    font-size: 3.5rem;
    font-weight: 700;
    color: var(--accent-primary);
}

.period {
    font-size: 1.2rem;
    color: var(--text-secondary);
}

.price-description {
    text-align: center;
    color: var(--text-secondary);
    margin-bottom: 2rem;
}

.pricing-features {
    list-style: none;
    margin-bottom: 2rem;
}

.pricing-features li {
    padding: 0.75rem 0;
    border-bottom: 1px solid var(--border-secondary);
    font-size: 0.95rem;
}

.feature-included {
    color: var(--success);
}

.feature-excluded {
    color: var(--danger);
}

.pricing-cta-btn {
    width: 100%;
    padding: 1rem;
    border: none;
    border-radius: 10px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.secondary-btn {
    background: transparent;
    color: var(--text-primary);
    border: 2px solid var(--border-primary);
}

.secondary-btn:hover {
    border-color: var(--accent-primary);
    color: var(--accent-primary);
}

.trust-badges {
    display: flex;
    justify-content: center;
    gap: 2rem;
    flex-wrap: wrap;
    max-width: 600px;
    margin: 0 auto;
}

.trust-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--text-secondary);
    font-size: 0.9rem;
}

/* Final CTA */
.final-cta {
    padding: 4rem 2rem;
    text-align: center;
    background: linear-gradient(135deg, rgba(74, 144, 226, 0.1), rgba(74, 144, 226, 0.05));
}

.cta-content h2 {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 1rem;
    color: var(--text-primary);
}

.cta-content p {
    font-size: 1.2rem;
    color: var(--text-secondary);
    margin-bottom: 2rem;
}

.final-cta-buttons {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
    margin-bottom: 2rem;
}

.final-trust {
    font-size: 0.9rem;
    color: var(--text-secondary);
    max-width: 600px;
    margin: 0 auto;
}

/* Responsive Design */
@media (max-width: 1024px) {
    .hero-section {
        flex-direction: column;
        text-align: center;
        padding: 3rem 1rem;
    }
    
    .hero-title {
        font-size: 2.5rem;
    }
    
    .hero-subtitle {
        font-size: 1.1rem;
    }
    
    .features-grid {
        grid-template-columns: 1fr;
    }
    
    .pricing-cards {
        grid-template-columns: 1fr;
    }
    
    .pricing-card.popular {
        transform: none;
    }
}

@media (max-width: 768px) {
    .hero-title {
        font-size: 2rem;
    }
    
    .hero-subtitle {
        font-size: 1rem;
    }
    
    .section-header h2 {
        font-size: 2rem;
    }
    
    .testimonials {
        grid-template-columns: 1fr;
    }
    
    .proof-stats {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .final-cta-buttons {
        flex-direction: column;
        align-items: center;
    }
    
    .trust-badges {
        gap: 1rem;
    }
}