/**
 * AI Compare Page Styles
 * 6-column side-by-side AI comparison with minimizable windows
 */

/* ==================== CSS Variables ==================== */
:root {
    --compare-header-height: 60px;
    --compare-input-height: 80px;
    --collapsed-sidebar-width: 50px;
    --collapsed-topbar-height: 50px;
}

/* ==================== Base Layout ==================== */
.compare-container {
    display: flex;
    flex-direction: column;
    height: 100vh;
    max-height: 100vh;
    background: var(--bg-primary, #f8fafc);
    overflow: hidden;
}

.compare-container.hidden {
    display: none;
}

/* ==================== Header ==================== */
.compare-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem 1.5rem;
    background: linear-gradient(135deg, #1e293b 0%, #334155 100%);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    height: var(--compare-header-height);
    flex-shrink: 0;
}

.header-brand {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.sneos-logo {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: white;
    text-decoration: none;
    font-size: 1.25rem;
    font-weight: 700;
}

.sneos-logo i {
    color: #fbbf24;
    font-size: 1.5rem;
}

.feature-badge {
    background: rgba(255, 255, 255, 0.15);
    color: white;
    padding: 0.25rem 0.75rem;
    border-radius: 16px;
    font-size: 0.875rem;
    font-weight: 500;
}

.premium-badge {
    background: linear-gradient(135deg, #fbbf24, #f59e0b);
    color: #1e293b;
    padding: 0.25rem 0.75rem;
    border-radius: 16px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.premium-badge.hidden {
    display: none;
}

/* ==================== Chat Windows Container ==================== */
.chat-windows-container {
    display: flex;
    flex: 1 1 0;
    min-height: 0;
    position: relative;
    overflow: hidden;
}

/* ==================== Collapsed Sidebar (Desktop - Left) ==================== */
.collapsed-sidebar {
    display: none;
    flex-direction: column;
    min-width: var(--collapsed-sidebar-width);
    background: #f1f5f9;
    border-right: 1px solid #e2e8f0;
    order: -1;
}

.collapsed-sidebar.has-items {
    display: flex;
}

.collapsed-strip {
    writing-mode: vertical-rl;
    text-orientation: mixed;
    padding: 1rem 0.5rem;
    cursor: pointer;
    color: white;
    font-weight: 600;
    font-size: 0.875rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    transition: all 0.3s ease;
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
    min-height: 120px;
}

.collapsed-strip:hover {
    min-width: calc(var(--collapsed-sidebar-width) + 10px);
    filter: brightness(1.1);
}

.collapsed-strip:last-child {
    border-bottom: none;
}

.collapsed-text {
    white-space: nowrap;
}

.restore-icon {
    font-size: 1rem;
    opacity: 0.8;
}

/* Collapsed Strip Colors */
.collapsed-strip-chatgpt { background: linear-gradient(180deg, #10a37f, #1a7f64); }
.collapsed-strip-claude { background: linear-gradient(180deg, #cc785c, #d4915c); }
.collapsed-strip-gemini { background: linear-gradient(180deg, #4285f4, #34a853); }
.collapsed-strip-grok { background: linear-gradient(180deg, #2d3436, #636e72); }
.collapsed-strip-deepseek { background: linear-gradient(180deg, #6366f1, #8b5cf6); }
.collapsed-strip-mistral { background: linear-gradient(180deg, #ff6b6b, #ee5a52); }

/* ==================== Chat Windows Grid ==================== */
.chat-windows-grid {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 1px;
    flex: 1;
    background: #e2e8f0;
    transition: grid-template-columns 0.3s ease;
}

/* Dynamic column adjustment when models are hidden */
.chat-windows-grid.has-hidden-1 { grid-template-columns: repeat(5, 1fr); }
.chat-windows-grid.has-hidden-2 { grid-template-columns: repeat(4, 1fr); }
.chat-windows-grid.has-hidden-3 { grid-template-columns: repeat(3, 1fr); }
.chat-windows-grid.has-hidden-4 { grid-template-columns: repeat(2, 1fr); }
.chat-windows-grid.has-hidden-5 { grid-template-columns: 1fr; }

/* ==================== Individual Chat Window ==================== */
.chat-window {
    display: flex;
    flex-direction: column;
    background: white;
    min-width: 0;
    overflow: hidden;
}

.chat-window.hidden {
    display: none;
}

/* Chat Header */
.chat-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem 1rem;
    color: white;
    font-weight: 600;
    flex-shrink: 0;
}

.chat-header-left {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex: 1;
    min-width: 0;
    overflow: hidden;
}

.model-name {
    font-size: 0.9rem;
}

.model-badge {
    font-size: 0.7rem;
    opacity: 0.8;
    font-weight: 400;
}

/* Web Search Globe Button (per model) */
.web-search-btn {
    background: rgba(255, 255, 255, 0.15);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: rgba(255, 255, 255, 0.7);
    width: 26px;
    height: 26px;
    border-radius: 6px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.85rem;
    margin-left: 0.5rem;
    transition: all 0.2s ease;
}

.web-search-btn:hover {
    background: rgba(255, 255, 255, 0.25);
    color: white;
}

.web-search-btn.active {
    background: rgba(34, 197, 94, 0.3);
    border-color: rgba(34, 197, 94, 0.5);
    color: #22c55e;
}

.web-search-btn.active:hover {
    background: rgba(34, 197, 94, 0.4);
}

/* Global Web Search Toggle (in input area) */
#global-web-search-btn.active {
    background: rgba(34, 197, 94, 0.3) !important;
    border-color: rgba(34, 197, 94, 0.5) !important;
    color: #22c55e !important;
}

#global-web-search-btn.partial {
    background: rgba(251, 191, 36, 0.3) !important;
    border-color: rgba(251, 191, 36, 0.5) !important;
    color: #fbbf24 !important;
}

.minimize-button {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    width: 28px;
    height: 28px;
    border-radius: 6px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.minimize-button:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: scale(1.1);
}

/* Header Colors */
.chat-header-chatgpt { background: linear-gradient(135deg, #10a37f, #1a7f64); }
.chat-header-claude { background: linear-gradient(135deg, #cc785c, #d4915c); }
.chat-header-gemini { background: linear-gradient(135deg, #4285f4, #34a853); }
.chat-header-grok { background: linear-gradient(135deg, #2d3436, #636e72); }
.chat-header-deepseek { background: linear-gradient(135deg, #6366f1, #8b5cf6); }
.chat-header-mistral { background: linear-gradient(135deg, #ff6b6b, #ee5a52); }

/* Chat Messages Area */
.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 1rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    min-height: 0;
}

/* Message Styling */
.message {
    display: flex;
    flex-direction: column;
    max-width: 100%;
}

.user-message {
    align-items: flex-end;
    animation: messageAppearUser 0.4s cubic-bezier(0.16, 1, 0.3, 1) forwards;
    will-change: transform, opacity;
}

.ai-message {
    align-items: flex-start;
    animation: messageAppearAI 0.5s cubic-bezier(0.16, 1, 0.3, 1) forwards;
    will-change: transform, opacity, filter;
}

/* Apple-style animation - User message: subtle slide up with scale */
@keyframes messageAppearUser {
    0% {
        opacity: 0;
        transform: translateY(8px) scale(0.98);
    }
    100% {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* Apple-style animation - AI message: elegant blur-to-focus with scale */
@keyframes messageAppearAI {
    0% {
        opacity: 0;
        transform: translateY(12px) scale(0.96);
        filter: blur(4px);
    }
    50% {
        filter: blur(0);
    }
    100% {
        opacity: 1;
        transform: translateY(0) scale(1);
        filter: blur(0);
    }
}

/* Subtle hover effect on AI messages */
.ai-message .message-content {
    transition: box-shadow 0.3s ease;
}

.ai-message:hover .message-content {
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
}

[data-theme="dark"] .ai-message:hover .message-content {
    box-shadow: 0 2px 16px rgba(255, 255, 255, 0.06);
}

.message-content {
    padding: 0.75rem 1rem;
    border-radius: 12px;
    max-width: 95%;
    word-wrap: break-word;
    overflow-wrap: break-word;
    line-height: 1.5;
    font-size: 0.9rem;
}

.user-message .message-content {
    background: #e2e8f0;
    color: #1e293b;
    border-radius: 12px 12px 4px 12px;
}

.ai-message .message-content {
    background: #f8fafc;
    border-left: 3px solid #e2e8f0;
    border-radius: 4px 12px 12px 12px;
}

/* AI Message Border Colors */
.ai-message-chatgpt .message-content { border-left-color: #10a37f; }
.ai-message-claude .message-content { border-left-color: #cc785c; }
.ai-message-gemini .message-content { border-left-color: #4285f4; }
.ai-message-grok .message-content { border-left-color: #2d3436; }
.ai-message-deepseek .message-content { border-left-color: #6366f1; }
.ai-message-mistral .message-content { border-left-color: #ff6b6b; }

/* Message Action Buttons */
.message-actions {
    display: flex;
    align-items: center;
    gap: 4px;
    margin-top: 8px;
    opacity: 0;
    transition: opacity 150ms ease;
}

.ai-message:hover .message-actions {
    opacity: 1;
}

/* Always show on mobile */
@media (max-width: 768px) {
    .message-actions {
        opacity: 1;
    }
}

.action-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border: none;
    background: transparent;
    color: #9ca3af;
    cursor: pointer;
    border-radius: 4px;
    transition: all 0.15s ease;
    padding: 0;
}

.action-btn:hover {
    background: rgba(0, 0, 0, 0.05);
    color: #374151;
}

.action-btn.copied {
    color: #22c55e;
}

.action-btn svg {
    width: 16px;
    height: 16px;
}

[data-theme="dark"] .action-btn {
    color: #6b7280;
}

[data-theme="dark"] .action-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #d1d5db;
}

/* Loading State */
.loading-indicator {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1rem;
    background: #f8fafc;
    border-radius: 12px;
    color: #64748b;
    font-size: 0.875rem;
}

.loading-dots {
    display: flex;
    gap: 4px;
}

.loading-dot {
    width: 6px;
    height: 6px;
    background: #94a3b8;
    border-radius: 50%;
    animation: loadingPulse 1.4s ease-in-out infinite;
}

.loading-dot:nth-child(1) { animation-delay: 0s; }
.loading-dot:nth-child(2) { animation-delay: 0.2s; }
.loading-dot:nth-child(3) { animation-delay: 0.4s; }

@keyframes loadingPulse {
    0%, 80%, 100% { transform: scale(0.8); opacity: 0.5; }
    40% { transform: scale(1.2); opacity: 1; }
}

/* Error State */
.error-message {
    color: #ef4444;
    background: #fef2f2;
    padding: 0.75rem 1rem;
    border-radius: 8px;
    font-size: 0.875rem;
    border-left: 3px solid #ef4444;
}

/* Empty State */
.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    color: #94a3b8;
    text-align: center;
    padding: 2rem;
}

.empty-state i {
    font-size: 2.5rem;
    margin-bottom: 1rem;
    opacity: 0.5;
}

.empty-state p {
    font-size: 0.875rem;
}

/* ==================== Modern Input Container (DeepSeek-Inspired) ==================== */
.modern-input-wrapper {
    max-width: 900px;
    margin: 0 auto;
    padding: 16px 20px 20px;
    width: 100%;
    flex-shrink: 0;
}

.input-container-modern {
    background: linear-gradient(145deg, #ffffff 0%, #f8fafc 100%);
    border: 1px solid rgba(0, 0, 0, 0.08);
    border-radius: 24px;
    display: flex;
    flex-direction: column;
    padding: 0;
    box-shadow:
        0 4px 6px -1px rgba(0, 0, 0, 0.05),
        0 10px 15px -3px rgba(0, 0, 0, 0.08),
        0 20px 25px -5px rgba(0, 0, 0, 0.05),
        inset 0 1px 0 rgba(255, 255, 255, 0.8);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.input-container-modern::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg,
        transparent 0%,
        rgba(251, 191, 36, 0.4) 25%,
        rgba(245, 158, 11, 0.4) 50%,
        rgba(251, 191, 36, 0.4) 75%,
        transparent 100%);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.input-container-modern:focus-within::before {
    opacity: 1;
}

.input-container-modern:focus-within {
    border-color: rgba(251, 191, 36, 0.35);
    box-shadow:
        0 4px 6px -1px rgba(0, 0, 0, 0.05),
        0 10px 15px -3px rgba(251, 191, 36, 0.1),
        0 20px 25px -5px rgba(245, 158, 11, 0.08),
        0 0 0 4px rgba(251, 191, 36, 0.1),
        inset 0 1px 0 rgba(255, 255, 255, 0.8);
}

.input-top-row {
    display: flex;
    align-items: flex-start;
    padding: 18px 20px 8px;
}

.input-field-container {
    flex: 1;
    position: relative;
    display: flex;
    align-items: flex-start;
}

.chat-input-field {
    width: 100%;
    border: none;
    outline: none;
    background: transparent;
    font-size: 15px;
    line-height: 1.6;
    padding: 0;
    color: #1f2937;
    resize: none;
    height: auto;
    min-height: 24px;
    max-height: 200px;
    overflow-y: hidden;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', sans-serif;
    transition: height 0.15s ease;
    box-sizing: border-box;
}

.chat-input-field:focus {
    overflow-y: auto;
}

.chat-input-field::placeholder {
    color: #9ca3af;
    font-weight: 400;
}

.chat-input-field:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.input-bottom-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 12px 12px;
    background: transparent;
    gap: 8px;
}

.input-buttons-group {
    display: flex;
    align-items: center;
    gap: 4px;
    flex: 1;
}

.button-with-label {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 3px;
    cursor: pointer;
    padding: 6px 10px;
    border-radius: 12px;
    transition: all 0.2s ease;
    user-select: none;
}

.button-with-label * {
    pointer-events: none;
}

.button-with-label:hover {
    background-color: rgba(251, 191, 36, 0.08);
}

.button-with-label.disabled {
    cursor: not-allowed;
    opacity: 0.4;
}

.button-with-label.disabled:hover {
    background-color: transparent;
}

.send-btn-wrapper {
    margin-left: auto;
}

.send-btn-wrapper:hover {
    background-color: transparent;
}

.button-label {
    font-size: 0.65rem;
    color: #6b7280;
    text-align: center;
    white-space: nowrap;
    font-weight: 500;
    pointer-events: none;
    letter-spacing: 0.01em;
    text-transform: uppercase;
}

.input-btn {
    width: 34px;
    height: 34px;
    border-radius: 10px;
    border: none;
    background: transparent;
    color: #64748b;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    text-decoration: none;
    position: relative;
    font-size: 1rem;
}

.input-btn svg {
    width: 18px;
    height: 18px;
}

.input-btn:hover {
    background: rgba(251, 191, 36, 0.1);
    color: #d97706;
}

.upload-btn:hover {
    background: rgba(251, 191, 36, 0.12);
    color: #d97706;
}

.upload-btn.has-file {
    background: rgba(34, 197, 94, 0.1);
    color: #22c55e;
}

.toggle-btn {
    width: 34px;
    height: 34px;
    border-radius: 10px;
    border: none;
    background: transparent;
    color: #64748b;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    font-size: 1rem;
}

.toggle-btn i {
    font-size: 16px;
}

.toggle-btn:hover {
    background: rgba(251, 191, 36, 0.1);
    color: #d97706;
}

.toggle-btn.active {
    background: linear-gradient(135deg, #fbbf24, #f59e0b);
    color: #1e293b;
    box-shadow: 0 2px 8px rgba(251, 191, 36, 0.35);
}

.toggle-btn.active:hover {
    background: linear-gradient(135deg, #fcd34d, #fbbf24);
    color: #1e293b;
}

.toggle-button-style.active {
    background-color: rgba(251, 191, 36, 0.1);
}

.clear-btn:hover {
    background: rgba(239, 68, 68, 0.08);
    color: #ef4444;
}

.send-btn {
    width: 42px;
    height: 42px;
    border-radius: 12px;
    border: none;
    background: linear-gradient(135deg, #fbbf24 0%, #f59e0b 100%);
    color: #1e293b;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    flex-shrink: 0;
    box-shadow: 0 4px 12px rgba(251, 191, 36, 0.35);
}

.send-btn svg {
    width: 18px;
    height: 18px;
    transition: transform 0.2s ease;
}

.send-btn:hover:not(.disabled) {
    background: linear-gradient(135deg, #fcd34d 0%, #fbbf24 100%);
    box-shadow: 0 6px 20px rgba(251, 191, 36, 0.5);
    transform: translateY(-1px);
}

.send-btn:hover:not(.disabled) svg {
    transform: translate(2px, -2px);
}

.send-btn:active:not(.disabled) {
    transform: translateY(0);
    box-shadow: 0 2px 8px rgba(251, 191, 36, 0.3);
}

.send-btn.disabled {
    background: #e5e7eb;
    color: #9ca3af;
    cursor: not-allowed;
    opacity: 0.6;
    box-shadow: none;
}

.send-btn.loading {
    pointer-events: none;
}

.loading-spinner {
    width: 18px;
    height: 18px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: white;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Input Divider Line */
.input-divider {
    height: 1px;
    background: linear-gradient(90deg,
        transparent 0%,
        rgba(0, 0, 0, 0.06) 20%,
        rgba(0, 0, 0, 0.06) 80%,
        transparent 100%);
    margin: 0 16px;
}

/* Premium Popup */
.premium-popup {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1001;
    backdrop-filter: blur(4px);
}

.premium-popup.hidden {
    display: none;
}

.premium-popup-content {
    background: white;
    padding: 2rem;
    border-radius: 16px;
    max-width: 400px;
    width: 90%;
    text-align: center;
    position: relative;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.3);
}

.popup-close-btn {
    position: absolute;
    top: 12px;
    right: 12px;
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: #9ca3af;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
}

.popup-close-btn:hover {
    background: #f3f4f6;
    color: #374151;
}

.premium-popup-icon {
    font-size: 2.5rem;
    margin-bottom: 1rem;
}

.premium-popup-content h3 {
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
    color: #1f2937;
}

.premium-popup-content p {
    color: #6b7280;
    margin-bottom: 1.5rem;
}

/* Legacy input styles (kept for compatibility) */
.input-container {
    padding: 1rem 1.5rem;
    background: white;
    border-top: 1px solid #e2e8f0;
    flex-shrink: 0;
}

.input-wrapper {
    display: flex;
    gap: 1rem;
    max-width: 1400px;
    margin: 0 auto;
    align-items: flex-end;
    width: 100%;
}

#prompt-input {
    flex: 1;
    padding: 0.75rem 1rem;
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    font-size: 1rem;
    resize: none;
    font-family: inherit;
    transition: border-color 0.2s ease;
    min-height: 56px;
    max-height: 150px;
}

#prompt-input:focus {
    outline: none;
    border-color: #3b82f6;
}

#prompt-input::placeholder {
    color: #94a3b8;
}

.send-button {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    background: linear-gradient(135deg, #3b82f6, #8b5cf6);
    color: white;
    border: none;
    border-radius: 12px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
    height: 48px;
}

.send-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.4);
}

.send-button:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.send-button i {
    font-size: 1.1rem;
}

/* ==================== Premium Gate Modal ==================== */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    backdrop-filter: blur(4px);
}

.modal.hidden {
    display: none;
}

.modal-content {
    background: white;
    padding: 2.5rem;
    border-radius: 16px;
    max-width: 450px;
    width: 90%;
    text-align: center;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.3);
}

.modal-content h2 {
    font-size: 1.75rem;
    margin-bottom: 1rem;
    background: linear-gradient(135deg, #3b82f6, #8b5cf6);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.modal-content p {
    color: #64748b;
    margin-bottom: 2rem;
    line-height: 1.6;
}

.modal-content .btn {
    display: inline-block;
    padding: 0.875rem 2rem;
    border-radius: 10px;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.2s ease;
    margin: 0.5rem;
}

.modal-content .btn-primary {
    background: linear-gradient(135deg, #3b82f6, #8b5cf6);
    color: white;
}

.modal-content .btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.4);
}

.modal-content .btn-secondary {
    background: #f1f5f9;
    color: #475569;
}

.modal-content .btn-secondary:hover {
    background: #e2e8f0;
}

.premium-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
}

/* ==================== Responsive Design ==================== */

/* Tablet (3 columns) */
@media (max-width: 1400px) {
    .chat-windows-grid {
        grid-template-columns: repeat(3, 1fr);
    }

    .chat-windows-grid.has-hidden-1 { grid-template-columns: repeat(3, 1fr); }
    .chat-windows-grid.has-hidden-2 { grid-template-columns: repeat(3, 1fr); }
    .chat-windows-grid.has-hidden-3 { grid-template-columns: repeat(2, 1fr); }
    .chat-windows-grid.has-hidden-4 { grid-template-columns: repeat(2, 1fr); }
    .chat-windows-grid.has-hidden-5 { grid-template-columns: 1fr; }
}

/* Mobile (1 column, top bar for collapsed) */
@media (max-width: 768px) {
    /* Prevent double-tap zoom on all interactive elements */
    button,
    .btn,
    .sidebar-icon,
    .minimize-button,
    .collapsed-strip,
    .input-btn,
    .toggle-btn,
    .send-btn {
        touch-action: manipulation;
        -webkit-tap-highlight-color: transparent;
    }

    /* Hide 3-AI switch button on mobile */
    #switch-mode-btn {
        display: none;
    }

    .chat-windows-container {
        flex-direction: column;
    }

    .collapsed-sidebar {
        flex-direction: row;
        min-width: auto;
        min-height: var(--collapsed-topbar-height);
        border-right: none;
        border-bottom: 1px solid #e2e8f0;
        overflow-x: auto;
        order: -1;
    }

    .collapsed-strip {
        writing-mode: horizontal-tb;
        text-orientation: initial;
        padding: 0.5rem 1rem;
        min-height: auto;
        min-width: auto;
        flex: 0 0 auto;
        border-bottom: none;
        border-right: 1px solid rgba(255, 255, 255, 0.2);
    }

    .collapsed-strip:last-child {
        border-right: none;
    }

    .collapsed-strip:hover {
        min-width: auto;
    }

    .chat-windows-grid {
        grid-template-columns: 1fr;
    }

    .chat-windows-grid.has-hidden-1,
    .chat-windows-grid.has-hidden-2,
    .chat-windows-grid.has-hidden-3,
    .chat-windows-grid.has-hidden-4,
    .chat-windows-grid.has-hidden-5 {
        grid-template-columns: 1fr;
    }

    .compare-header {
        padding: 0.5rem 1rem;
    }

    .feature-badge {
        display: none;
    }

    .input-container {
        padding: 0.75rem 1rem;
    }

    .input-wrapper {
        flex-direction: column;
        gap: 0.75rem;
    }

    #prompt-input {
        width: 100%;
        min-height: 56px;
        font-size: 16px; /* Prevents iOS zoom on focus */
    }

    .send-button {
        width: 100%;
        justify-content: center;
    }

    .header-brand {
        gap: 0.5rem;
    }

    .sneos-logo {
        font-size: 1rem;
    }

    /* Hide toggle label on mobile, show only slider */
    .toggle-label {
        display: none;
    }

    .live-search-toggle {
        margin-left: 0.5rem;
        padding-left: 0.5rem;
    }

    /* Modern Input - Mobile (DeepSeek-Inspired) */
    .modern-input-wrapper {
        padding: 12px 12px 16px;
    }

    .input-container-modern {
        border-radius: 20px;
    }

    .input-top-row {
        padding: 14px 16px 6px;
    }

    .input-bottom-row {
        padding: 6px 10px 10px;
    }

    .input-buttons-group {
        gap: 2px;
    }

    .button-with-label {
        padding: 4px 8px;
    }

    .input-btn {
        width: 30px;
        height: 30px;
        border-radius: 8px;
    }

    .input-btn svg {
        width: 16px;
        height: 16px;
    }

    .toggle-btn {
        width: 30px;
        height: 30px;
        border-radius: 8px;
    }

    .toggle-btn i {
        font-size: 14px;
    }

    .send-btn {
        width: 38px;
        height: 38px;
        border-radius: 10px;
    }

    .send-btn svg {
        width: 16px;
        height: 16px;
    }

    .button-label {
        font-size: 0.6rem;
    }

    .chat-input-field {
        font-size: 16px; /* Prevents iOS zoom */
    }
}

/* Extra small screens */
@media (max-width: 576px) {
    .modern-input-wrapper {
        padding: 8px 8px 12px;
    }

    .input-container-modern {
        border-radius: 16px;
    }

    .input-top-row {
        padding: 12px 14px 4px;
    }

    .input-bottom-row {
        padding: 4px 8px 8px;
    }

    .input-buttons-group {
        gap: 0;
    }

    .button-with-label {
        padding: 3px 6px;
    }

    .input-btn {
        width: 28px;
        height: 28px;
    }

    .input-btn svg {
        width: 15px;
        height: 15px;
    }

    .toggle-btn {
        width: 28px;
        height: 28px;
    }

    .toggle-btn i {
        font-size: 13px;
    }

    .send-btn {
        width: 36px;
        height: 36px;
    }

    .button-label {
        font-size: 0.55rem;
    }
}

/* ==================== Dark Mode ==================== */
[data-theme="dark"] .compare-container {
    background: var(--bg-primary, #0f172a);
}

[data-theme="dark"] .compare-header {
    background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
}

[data-theme="dark"] .collapsed-sidebar {
    background: #1e293b;
    border-right-color: #334155;
}

[data-theme="dark"] .chat-windows-grid {
    background: #334155;
}

[data-theme="dark"] .chat-window {
    background: #0f172a;
}

[data-theme="dark"] .chat-messages {
    background: #0f172a;
}

[data-theme="dark"] .user-message .message-content {
    background: #334155;
    color: #f1f5f9;
}

[data-theme="dark"] .ai-message .message-content {
    background: #1e293b;
    color: #e2e8f0;
}

[data-theme="dark"] .input-container {
    background: #1e293b;
    border-top-color: #334155;
}

[data-theme="dark"] #prompt-input {
    background: #0f172a;
    border-color: #334155;
    color: #f1f5f9;
}

[data-theme="dark"] #prompt-input:focus {
    border-color: #3b82f6;
}

[data-theme="dark"] #prompt-input::placeholder {
    color: #64748b;
}

[data-theme="dark"] .modal-content {
    background: #1e293b;
}

[data-theme="dark"] .modal-content p {
    color: #94a3b8;
}

[data-theme="dark"] .modal-content .btn-secondary {
    background: #334155;
    color: #e2e8f0;
}

[data-theme="dark"] .modal-content .btn-secondary:hover {
    background: #475569;
}

[data-theme="dark"] .empty-state {
    color: #64748b;
}

[data-theme="dark"] .loading-indicator {
    background: #1e293b;
    color: #94a3b8;
}

[data-theme="dark"] .error-message {
    background: rgba(239, 68, 68, 0.1);
}

/* Dark Mode - Modern Input (DeepSeek-Inspired) */
[data-theme="dark"] .input-container-modern {
    background: linear-gradient(145deg, #1e1e2e 0%, #181825 100%);
    border-color: rgba(99, 102, 241, 0.15);
    box-shadow:
        0 4px 6px -1px rgba(0, 0, 0, 0.2),
        0 10px 15px -3px rgba(0, 0, 0, 0.25),
        0 20px 25px -5px rgba(0, 0, 0, 0.15),
        inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

[data-theme="dark"] .input-container-modern::before {
    background: linear-gradient(90deg,
        transparent 0%,
        rgba(251, 191, 36, 0.5) 25%,
        rgba(245, 158, 11, 0.5) 50%,
        rgba(251, 191, 36, 0.5) 75%,
        transparent 100%);
}

[data-theme="dark"] .input-container-modern:focus-within {
    border-color: rgba(251, 191, 36, 0.4);
    box-shadow:
        0 4px 6px -1px rgba(0, 0, 0, 0.2),
        0 10px 15px -3px rgba(251, 191, 36, 0.15),
        0 20px 25px -5px rgba(245, 158, 11, 0.1),
        0 0 0 4px rgba(251, 191, 36, 0.12),
        inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

[data-theme="dark"] .input-bottom-row {
    background: transparent;
}

[data-theme="dark"] .chat-input-field {
    color: #e4e4e7;
}

[data-theme="dark"] .chat-input-field::placeholder {
    color: #71717a;
}

[data-theme="dark"] .button-with-label:hover {
    background-color: rgba(251, 191, 36, 0.1);
}

[data-theme="dark"] .button-label {
    color: #71717a;
}

[data-theme="dark"] .input-btn {
    color: #a1a1aa;
}

[data-theme="dark"] .input-btn:hover {
    background: rgba(251, 191, 36, 0.15);
    color: #fbbf24;
}

[data-theme="dark"] .toggle-btn {
    color: #a1a1aa;
}

[data-theme="dark"] .toggle-btn:hover {
    background: rgba(251, 191, 36, 0.15);
    color: #fbbf24;
}

[data-theme="dark"] .toggle-btn.active {
    background: linear-gradient(135deg, #fbbf24, #f59e0b);
    color: #1e293b;
    box-shadow: 0 2px 12px rgba(251, 191, 36, 0.4);
}

[data-theme="dark"] .toggle-btn.active:hover {
    background: linear-gradient(135deg, #fcd34d, #fbbf24);
    color: #1e293b;
}

[data-theme="dark"] .toggle-button-style.active {
    background-color: rgba(251, 191, 36, 0.15);
}

[data-theme="dark"] .send-btn:not(.disabled) {
    background: linear-gradient(135deg, #fbbf24 0%, #f59e0b 100%);
    color: #1e293b;
    box-shadow: 0 4px 15px rgba(251, 191, 36, 0.4);
}

[data-theme="dark"] .send-btn:hover:not(.disabled) {
    background: linear-gradient(135deg, #fcd34d 0%, #fbbf24 100%);
    box-shadow: 0 6px 25px rgba(251, 191, 36, 0.5);
}

[data-theme="dark"] .send-btn.disabled {
    background: #27272a;
    color: #52525b;
    box-shadow: none;
}

[data-theme="dark"] .input-divider {
    background: linear-gradient(90deg,
        transparent 0%,
        rgba(255, 255, 255, 0.06) 20%,
        rgba(255, 255, 255, 0.06) 80%,
        transparent 100%);
}

[data-theme="dark"] .clear-btn:hover {
    background: rgba(239, 68, 68, 0.15);
    color: #f87171;
}

[data-theme="dark"] .premium-popup-content {
    background: #1e293b;
}

[data-theme="dark"] .premium-popup-content h3 {
    color: #f1f5f9;
}

[data-theme="dark"] .premium-popup-content p {
    color: #9ca3af;
}

[data-theme="dark"] .popup-close-btn {
    color: #6b7280;
}

[data-theme="dark"] .popup-close-btn:hover {
    background: #374151;
    color: #f3f4f6;
}

/* ==================== 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;
    font-weight: 600;
    line-height: 1.3;
}

.message-content h1 { font-size: 1.5rem; }
.message-content h2 { font-size: 1.25rem; }
.message-content h3 { font-size: 1.1rem; }
.message-content h4 { font-size: 1rem; }
.message-content h5 { font-size: 0.9rem; }
.message-content h6 { font-size: 0.85rem; }

.message-content p {
    margin: 0.5rem 0;
}

.message-content ul,
.message-content ol {
    margin: 0.5rem 0;
    padding-left: 1.5rem;
}

.message-content li {
    margin: 0.25rem 0;
}

.message-content code {
    background: rgba(0, 0, 0, 0.05);
    padding: 0.125rem 0.375rem;
    border-radius: 4px;
    font-family: 'Fira Code', 'Consolas', monospace;
    font-size: 0.85em;
}

[data-theme="dark"] .message-content code {
    background: rgba(255, 255, 255, 0.1);
}

/* Enhanced Code Blocks */
.code-block-container {
    margin: 0.75rem 0;
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid #e2e8f0;
}

.code-block-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.5rem 1rem;
    background: #334155;
    border-bottom: 1px solid #475569;
}

.language-badge {
    font-size: 0.7rem;
    color: #94a3b8;
    text-transform: uppercase;
    font-weight: 600;
    letter-spacing: 0.5px;
}

.code-copy-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border: none;
    background: transparent;
    color: #94a3b8;
    cursor: pointer;
    border-radius: 4px;
    transition: all 0.15s ease;
    padding: 0;
}

.code-copy-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #e2e8f0;
}

.code-copy-btn.copied {
    color: #22c55e;
}

.code-block-container pre {
    margin: 0;
    padding: 1rem;
    background: #1e293b;
    overflow-x: auto;
}

.code-block-container pre code {
    background: none;
    padding: 0;
    color: #e2e8f0;
    font-family: 'Fira Code', 'Consolas', 'Monaco', monospace;
    font-size: 0.85rem;
    line-height: 1.5;
}

/* Legacy code block styles (for backward compatibility) */
.message-content pre:not(.code-block-container pre) {
    background: #1e293b;
    color: #e2e8f0;
    padding: 1rem;
    border-radius: 8px;
    overflow-x: auto;
    margin: 0.75rem 0;
}

.message-content pre:not(.code-block-container pre) code {
    background: none;
    padding: 0;
}

/* Dark mode for code blocks */
[data-theme="dark"] .code-block-container {
    border-color: #475569;
}

[data-theme="dark"] .code-block-header {
    background: #0f172a;
    border-bottom-color: #334155;
}

.message-content blockquote {
    border-left: 3px solid #3b82f6;
    padding-left: 1rem;
    margin: 0.75rem 0;
    color: #64748b;
    font-style: italic;
}

.message-content a {
    color: #3b82f6;
    text-decoration: none;
}

.message-content a:hover {
    text-decoration: underline;
}

.message-content table {
    width: 100%;
    border-collapse: collapse;
    margin: 0.75rem 0;
    font-size: 0.875rem;
}

.message-content th,
.message-content td {
    border: 1px solid #e2e8f0;
    padding: 0.5rem;
    text-align: left;
}

.message-content th {
    background: #f8fafc;
    font-weight: 600;
}

[data-theme="dark"] .message-content th {
    background: #334155;
}

[data-theme="dark"] .message-content th,
[data-theme="dark"] .message-content td {
    border-color: #475569;
}

/* ==================== Toast Notifications ==================== */
.toast-notification {
    position: fixed;
    bottom: 100px;
    left: 50%;
    transform: translateX(-50%) translateY(20px);
    padding: 12px 24px;
    border-radius: 12px;
    font-size: 0.875rem;
    font-weight: 500;
    z-index: 10000;
    opacity: 0;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    pointer-events: none;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
}

.toast-notification.show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

.toast-info {
    background: linear-gradient(135deg, #fbbf24, #f59e0b);
    color: #1e293b;
}

.toast-success {
    background: linear-gradient(135deg, #22c55e, #16a34a);
    color: white;
}

.toast-error {
    background: linear-gradient(135deg, #ef4444, #dc2626);
    color: white;
}

[data-theme="dark"] .toast-notification {
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
}

/* ==================== Scrollbar Styling ==================== */
.chat-messages::-webkit-scrollbar {
    width: 6px;
}

.chat-messages::-webkit-scrollbar-track {
    background: transparent;
}

.chat-messages::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 3px;
}

.chat-messages::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

[data-theme="dark"] .chat-messages::-webkit-scrollbar-thumb {
    background: #475569;
}

[data-theme="dark"] .chat-messages::-webkit-scrollbar-thumb:hover {
    background: #64748b;
}

/* ==================== Share Button & Modal ==================== */
.share-btn:hover {
    background: rgba(34, 197, 94, 0.1);
    color: #22c55e;
}

[data-theme="dark"] .share-btn:hover {
    background: rgba(34, 197, 94, 0.15);
    color: #4ade80;
}

/* Share Success Modal */
.share-modal-content {
    position: relative;
    max-width: 480px;
}

.share-success-icon {
    margin-bottom: 1rem;
}

.share-url-container {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: #f1f5f9;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    padding: 0.5rem;
    margin-bottom: 1.5rem;
}

.share-url-input {
    flex: 1;
    border: none;
    background: transparent;
    padding: 0.5rem;
    font-size: 0.875rem;
    color: #374151;
    outline: none;
    font-family: 'Fira Code', 'Consolas', monospace;
}

.copy-url-btn {
    width: 40px;
    height: 40px;
    border-radius: 8px;
    border: none;
    background: #e2e8f0;
    color: #64748b;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.copy-url-btn:hover {
    background: #cbd5e1;
    color: #374151;
}

.copy-url-btn.copied {
    background: #22c55e;
    color: white;
}

.share-modal-actions {
    display: flex;
    gap: 1rem;
    justify-content: center;
}

.share-modal-actions .btn {
    padding: 0.75rem 1.5rem;
    border-radius: 10px;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    border: none;
}

.share-modal-actions .btn-primary {
    background: linear-gradient(135deg, #22c55e, #16a34a);
    color: white;
}

.share-modal-actions .btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(34, 197, 94, 0.4);
}

.share-modal-actions .btn-secondary {
    background: #f1f5f9;
    color: #475569;
}

.share-modal-actions .btn-secondary:hover {
    background: #e2e8f0;
}

/* Dark mode for share modal */
[data-theme="dark"] .share-url-container {
    background: #1e293b;
    border-color: #334155;
}

[data-theme="dark"] .share-url-input {
    color: #e2e8f0;
}

[data-theme="dark"] .copy-url-btn {
    background: #334155;
    color: #94a3b8;
}

[data-theme="dark"] .copy-url-btn:hover {
    background: #475569;
    color: #e2e8f0;
}

[data-theme="dark"] .share-modal-actions .btn-secondary {
    background: #334155;
    color: #e2e8f0;
}

[data-theme="dark"] .share-modal-actions .btn-secondary:hover {
    background: #475569;
}

/* ==================== Right Sidebar ==================== */

/* Main sidebar container */
.right-sidebar {
    position: fixed;
    right: 0;
    top: 60px; /* Header height */
    bottom: 0;
    display: flex;
    z-index: 100;
    pointer-events: auto;
}

/* Icon Strip (always visible) */
.sidebar-icon-strip {
    width: 50px;
    background: #1e293b;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 12px 0;
    gap: 8px;
    border-left: 1px solid #334155;
}

.sidebar-icon {
    width: 40px;
    height: 40px;
    border: none;
    background: transparent;
    color: #94a3b8;
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    transition: all 0.2s ease;
}

.sidebar-icon:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #f1f5f9;
}

.sidebar-icon.active {
    background: rgba(251, 191, 36, 0.2);
    color: #fbbf24;
}

.sidebar-icon-spacer {
    flex: 1;
}

/* Theme toggle icon update */
.theme-toggle .bi-moon,
.theme-toggle .bi-sun {
    transition: transform 0.3s ease;
}

[data-theme="dark"] .theme-toggle .bi-moon {
    display: none;
}

[data-theme="dark"] .theme-toggle .bi-sun {
    display: inline;
}

.theme-toggle .bi-sun {
    display: none;
}

[data-theme="dark"] .theme-toggle .bi-moon {
    display: none;
}

/* Expandable Panel */
.sidebar-panel {
    width: 280px;
    background: #0f172a;
    border-left: 1px solid #334155;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.sidebar-panel.hidden {
    display: none;
}

.panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px;
    border-bottom: 1px solid #334155;
    flex-shrink: 0;
}

.panel-title {
    font-weight: 600;
    font-size: 1rem;
    color: #f1f5f9;
}

.panel-close {
    width: 32px;
    height: 32px;
    background: transparent;
    border: none;
    color: #94a3b8;
    cursor: pointer;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.panel-close:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #f1f5f9;
}

.panel-content {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
}

/* Adjust chat grid for sidebar */
.chat-windows-container {
    padding-right: 50px; /* Space for icon strip */
}

.chat-windows-container.sidebar-open {
    padding-right: 330px; /* 50px strip + 280px panel */
}

/* ==================== Panel Content Styles ==================== */

/* Navigation Panel */
.sidebar-nav {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 14px;
    color: #cbd5e1;
    text-decoration: none;
    border-radius: 8px;
    transition: all 0.2s ease;
    font-size: 0.9rem;
}

.nav-item:hover {
    background: rgba(251, 191, 36, 0.1);
    color: #fbbf24;
}

.nav-item i {
    font-size: 1.1rem;
    width: 20px;
    text-align: center;
}

.sidebar-footer {
    margin-top: auto;
    padding-top: 16px;
    border-top: 1px solid #334155;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.sidebar-footer a {
    display: flex;
    align-items: center;
    gap: 10px;
    color: #64748b;
    text-decoration: none;
    font-size: 0.8rem;
    padding: 8px 12px;
    border-radius: 6px;
    transition: all 0.2s ease;
}

.sidebar-footer a:hover {
    color: #94a3b8;
    background: rgba(255, 255, 255, 0.05);
}

/* History Panel */
.history-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.history-item {
    padding: 12px;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    border: 1px solid transparent;
}

.history-item:hover {
    background: rgba(251, 191, 36, 0.08);
    border-color: rgba(251, 191, 36, 0.2);
}

.history-title {
    color: #e2e8f0;
    font-size: 0.9rem;
    font-weight: 500;
    margin-bottom: 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.history-meta {
    color: #64748b;
    font-size: 0.75rem;
}

.history-empty {
    text-align: center;
    padding: 40px 20px;
    color: #64748b;
}

.history-empty i {
    font-size: 2.5rem;
    margin-bottom: 12px;
    opacity: 0.5;
}

.history-empty p {
    font-size: 0.85rem;
}

/* Settings Panel */
.settings-group {
    margin-bottom: 20px;
}

.settings-label {
    display: block;
    color: #94a3b8;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 8px;
}

.settings-select {
    width: 100%;
    padding: 10px 12px;
    background: #1e293b;
    border: 1px solid #334155;
    border-radius: 8px;
    color: #e2e8f0;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.settings-select:hover {
    border-color: #475569;
}

.settings-select:focus {
    outline: none;
    border-color: #fbbf24;
    box-shadow: 0 0 0 2px rgba(251, 191, 36, 0.2);
}

.settings-toggle {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 0;
    cursor: pointer;
    color: #cbd5e1;
    font-size: 0.9rem;
}

.settings-toggle input[type="checkbox"] {
    display: none;
}

.toggle-slider {
    width: 44px;
    height: 24px;
    background: #334155;
    border-radius: 12px;
    position: relative;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.toggle-slider::after {
    content: '';
    position: absolute;
    top: 3px;
    left: 3px;
    width: 18px;
    height: 18px;
    background: #94a3b8;
    border-radius: 50%;
    transition: all 0.2s ease;
}

.settings-toggle input:checked + .toggle-slider {
    background: rgba(251, 191, 36, 0.3);
}

.settings-toggle input:checked + .toggle-slider::after {
    left: 23px;
    background: #fbbf24;
}

/* Settings Link */
.settings-link-group {
    margin-top: 8px;
    padding-top: 16px;
    border-top: 1px solid #334155;
}

.settings-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    background: rgba(251, 191, 36, 0.1);
    border: 1px solid rgba(251, 191, 36, 0.3);
    border-radius: 10px;
    color: #fbbf24;
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 500;
    transition: all 0.2s ease;
}

.settings-link:hover {
    background: rgba(251, 191, 36, 0.2);
    border-color: rgba(251, 191, 36, 0.5);
}

.settings-link i:first-child {
    font-size: 1.1rem;
}

.settings-link span {
    flex: 1;
}

.settings-link i:last-child {
    font-size: 0.8rem;
    opacity: 0.7;
}

/* Usage Info */
.usage-info {
    margin-top: 24px;
    padding: 16px;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 10px;
    border: 1px solid #334155;
}

.usage-info h4 {
    color: #94a3b8;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 12px;
}

.usage-bar {
    height: 8px;
    background: #1e293b;
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 8px;
}

.usage-fill {
    height: 100%;
    background: linear-gradient(90deg, #fbbf24, #f59e0b);
    border-radius: 4px;
    transition: width 0.3s ease;
}

.usage-text {
    color: #64748b;
    font-size: 0.8rem;
}

/* Account Panel */
.account-info {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 16px;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 10px;
    margin-bottom: 20px;
}

.user-avatar {
    width: 48px;
    height: 48px;
    background: linear-gradient(135deg, #fbbf24, #f59e0b);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #0f172a;
    font-size: 1.5rem;
    flex-shrink: 0;
}

.user-details {
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 0;
}

.user-email {
    color: #e2e8f0;
    font-size: 0.9rem;
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.user-premium-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background: linear-gradient(135deg, rgba(251, 191, 36, 0.2), rgba(245, 158, 11, 0.2));
    color: #fbbf24;
    font-size: 0.7rem;
    font-weight: 600;
    padding: 3px 8px;
    border-radius: 4px;
    width: fit-content;
}

.account-actions {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.account-link {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 14px;
    color: #cbd5e1;
    text-decoration: none;
    border-radius: 8px;
    font-size: 0.9rem;
    background: transparent;
    border: none;
    cursor: pointer;
    transition: all 0.2s ease;
    width: 100%;
    text-align: left;
}

.account-link:hover {
    background: rgba(255, 255, 255, 0.05);
    color: #f1f5f9;
}

.account-link.logout-btn {
    color: #f87171;
}

.account-link.logout-btn:hover {
    background: rgba(248, 113, 113, 0.1);
    color: #fca5a5;
}

/* ==================== Right Sidebar Mobile ==================== */
@media (max-width: 768px) {
    .right-sidebar {
        position: fixed;
        top: auto;
        right: 0;
        left: 0;
        bottom: 0;
        height: auto;
        flex-direction: column-reverse;
        z-index: 200;
    }

    .sidebar-icon-strip {
        width: 100%;
        height: 56px;
        flex-direction: row;
        justify-content: space-around;
        padding: 8px 16px;
        border-left: none;
        border-top: 1px solid #334155;
    }

    .sidebar-icon-spacer {
        display: none;
    }

    .sidebar-panel {
        position: fixed;
        bottom: 56px;
        left: 0;
        right: 0;
        width: 100%;
        height: 70vh;
        border-left: none;
        border-top: 1px solid #334155;
        border-radius: 16px 16px 0 0;
        transform: translateY(0);
        transition: transform 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
        will-change: transform;
        z-index: 100;
    }

    .sidebar-panel.dragging {
        transition: none;
        touch-action: none;
    }

    .sidebar-panel.closing {
        transform: translateY(100%);
        transition: transform 0.25s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    }

    /* Drag handle indicator - iOS style */
    .panel-drag-handle {
        display: flex;
        justify-content: center;
        padding: 8px 0 4px;
        touch-action: none;
        cursor: grab;
    }

    .panel-drag-handle::before {
        content: '';
        width: 36px;
        height: 5px;
        background: #475569;
        border-radius: 3px;
    }

    /* Backdrop overlay when panel is open */
    .sidebar-panel-backdrop {
        display: none;
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 56px;
        background: rgba(0, 0, 0, 0.4);
        z-index: 99;
        opacity: 0;
        transition: opacity 0.3s ease;
    }

    .sidebar-panel-backdrop.visible {
        display: block;
        opacity: 1;
    }

    .chat-windows-container {
        padding-right: 0;
        padding-bottom: 0;
        flex: 1;
        min-height: 0;
        overflow: hidden;
    }

    .chat-windows-container.sidebar-open {
        padding-right: 0;
    }

    /* Adjust input wrapper for mobile */
    .modern-input-wrapper {
        margin-bottom: 56px; /* Space for bottom icon strip */
        padding-left: 8px;
        padding-right: 8px;
        flex-shrink: 0;
    }

    /* Make sure compare container uses correct height on mobile */
    .compare-container {
        height: 100vh;
        height: 100dvh; /* Dynamic viewport height for mobile browsers */
        display: flex;
        flex-direction: column;
        overflow: hidden;
    }

    /* Hide button labels on mobile to save space */
    .input-bottom-row .button-label {
        display: none;
    }

    /* Make buttons more compact on mobile */
    .input-buttons-group {
        flex-wrap: nowrap;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
        -ms-overflow-style: none;
    }

    .input-buttons-group::-webkit-scrollbar {
        display: none;
    }

    .button-with-label {
        flex-shrink: 0;
    }

    /* Mobile swipe layout for chat windows */
    .chat-windows-grid {
        display: flex;
        flex-wrap: nowrap;
        overflow-x: auto;
        scroll-snap-type: x mandatory;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
        -ms-overflow-style: none;
        gap: 0;
    }

    .chat-windows-grid::-webkit-scrollbar {
        display: none;
    }

    .chat-windows-grid .chat-window {
        flex: 0 0 100%;
        min-width: 100%;
        scroll-snap-align: start;
    }

    /* Mobile indicator dots - positioned above input */
    .mobile-indicator {
        display: flex;
        justify-content: center;
        align-items: center;
        gap: 8px;
        padding: 6px 0;
        position: fixed;
        bottom: calc(56px + 130px); /* bottom nav (56px) + input area (~130px) */
        left: 0;
        right: 0;
        z-index: 100;
        pointer-events: auto;
    }

    .indicator-dot {
        width: 10px;
        height: 10px;
        border-radius: 50%;
        border: none;
        background: rgba(148, 163, 184, 0.4);
        cursor: pointer;
        transition: all 0.2s ease;
        padding: 0;
        touch-action: manipulation;
        -webkit-tap-highlight-color: transparent;
    }

    .indicator-dot:hover {
        background: rgba(148, 163, 184, 0.7);
        transform: scale(1.2);
    }

    .indicator-dot.active {
        background: #fbbf24;
        transform: scale(1.3);
    }

    /* Light mode indicator background */
    .mobile-indicator {
        background: linear-gradient(to top, rgba(248, 250, 252, 0.9), transparent);
    }

    [data-theme="dark"] .mobile-indicator {
        background: linear-gradient(to top, rgba(15, 23, 42, 0.9), transparent);
    }

    [data-theme="dark"] .indicator-dot {
        background: rgba(100, 116, 139, 0.5);
    }

    [data-theme="dark"] .indicator-dot:hover {
        background: rgba(100, 116, 139, 0.8);
    }

    [data-theme="dark"] .indicator-dot.active {
        background: #fbbf24;
    }

    /* Mobile navigation arrows - minimal floating chevrons */
    .mobile-nav-arrow {
        position: fixed;
        top: 50%;
        transform: translateY(-50%);
        width: 28px;
        height: 44px;
        background: transparent;
        border: none;
        color: rgba(100, 116, 139, 0.35);
        font-size: 1.25rem;
        cursor: pointer;
        z-index: 150;
        display: flex;
        align-items: center;
        justify-content: center;
        transition: all 0.2s ease;
        touch-action: manipulation;
        -webkit-tap-highlight-color: transparent;
    }

    .mobile-nav-arrow:active {
        color: rgba(100, 116, 139, 0.6);
        transform: translateY(-50%) scale(0.9);
    }

    .mobile-nav-arrow.disabled {
        opacity: 0.2;
        pointer-events: none;
    }

    .mobile-nav-arrow.prev {
        left: 2px;
    }

    .mobile-nav-arrow.next {
        right: 2px;
    }

    [data-theme="dark"] .mobile-nav-arrow {
        color: rgba(148, 163, 184, 0.25);
    }

    [data-theme="dark"] .mobile-nav-arrow:active {
        color: rgba(148, 163, 184, 0.5);
    }
}

/* Hide mobile indicator and arrows on desktop */
@media (min-width: 769px) {
    .mobile-indicator {
        display: none !important;
    }
    .mobile-nav-arrow {
        display: none !important;
    }
}
