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

/* Prevent horizontal scrolling on mobile */
html, body {
    overflow-x: hidden;
    width: 100%;
    max-width: 100vw;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: #2d2d30;
    height: 100vh;
    overflow: hidden;
    color: #ffffff;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

.app {
    display: flex;
    height: 100vh;
    position: relative;
    width: 100%;
    max-width: 100vw;
    overflow-x: hidden;
}

/* Sidebar Styles - Dark like Claude */
.sidebar {
    width: 260px;
    background: #1e1e20;
    border-right: 1px solid #3c3c42;
    display: flex;
    flex-direction: column;
    transition: all 0.3s ease;
    z-index: 10;
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    transform: translateX(-100%); /* Hidden by default */
}

.sidebar.open {
    transform: translateX(0); /* Show when open */
}

.sidebar.collapsed {
    width: 60px;
}

.sidebar.collapsed .sidebar-header .logo-section .app-title,
.sidebar.collapsed .sidebar-header .new-chat-btn span,
.sidebar.collapsed .sidebar-content .section-title,
.sidebar.collapsed .sidebar-content .chat-item span,
.sidebar.collapsed .sidebar-content .project-item span {
    display: none;
}

.sidebar.collapsed .sidebar-header .new-chat-btn {
    padding: 10px;
    justify-content: center;
}

.sidebar.collapsed .sidebar-header .logo-section {
    justify-content: center;
}

.sidebar.collapsed .sidebar-content {
    overflow: hidden;
}

.sidebar.collapsed .chat-item,
.sidebar.collapsed .project-item {
    display: flex;
    justify-content: center;
    padding: 12px 8px;
}

.sidebar.collapsed .chat-list::before {
    content: "💬";
    font-size: 18px;
    display: block;
    text-align: center;
    margin-bottom: 8px;
    opacity: 0.7;
}

.sidebar.collapsed .projects-section::before {
    content: "📁";
    font-size: 18px;
    display: block;
    text-align: center;
    margin-bottom: 8px;
    opacity: 0.7;
}

.sidebar-header {
    padding: 20px 16px 16px 16px;
    border-bottom: 1px solid #3c3c42;
}

.logo-section {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
}

.logo {
    width: 32px;
    height: 32px;
    border-radius: 8px;
}

.app-title {
    font-size: 20px;
    font-weight: 600;
    color: #ffffff;
}

.new-chat-btn {
    width: 100%;
    padding: 10px 12px;
    background: #2d2d30;
    border: 1px solid #3c3c42;
    border-radius: 6px;
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 500;
    color: #ffffff;
    transition: all 0.15s ease;
}

.new-chat-btn:hover {
    background: #3c3c42;
    border-color: #565658;
}

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

.section-title {
    font-size: 13px;
    font-weight: 600;
    color: #a1a1a6;
    margin-bottom: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.chat-list {
    margin-bottom: 24px;
}

.chat-item {
    padding: 12px 16px;
    margin-bottom: 4px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    color: #d1d1d6;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.chat-item:hover {
    background: #2d2d30;
}

.chat-item.active {
    background: #3c3c42;
    color: #ffffff;
}

.delete-chat-btn {
    background: none;
    border: none;
    color: #8e8e93;
    font-size: 18px;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 4px;
    opacity: 0;
    transition: all 0.2s ease;
    min-width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
}

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

.delete-chat-btn:hover {
    background: #ff453a;
    color: #ffffff;
}

.chat-menu-btn {
    background: none;
    border: none;
    color: #8e8e93;
    font-size: 16px;
    cursor: pointer;
    padding: 4px;
    border-radius: 4px;
    opacity: 0;
    transition: all 0.2s ease;
    margin-left: 4px;
}

.chat-item:hover .chat-menu-btn {
    opacity: 1;
}

.chat-menu-btn:hover {
    background: #3c3c42;
    color: #ffffff;
}

.chat-menu {
    position: absolute;
    right: 0;
    top: 100%;
    background: #2d2d30;
    border: 1px solid #3c3c42;
    border-radius: 6px;
    padding: 4px 0;
    min-width: 120px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    z-index: 1000;
    display: none;
}

.chat-menu.show {
    display: block;
}

.chat-menu-item {
    padding: 8px 12px;
    font-size: 14px;
    color: #d1d1d6;
    cursor: pointer;
    transition: background 0.2s ease;
    display: flex;
    align-items: center;
    gap: 8px;
}

.chat-menu-item:hover {
    background: #3c3c42;
}

.chat-menu-item svg {
    width: 16px;
    height: 16px;
}

.chat-actions {
    display: flex;
    align-items: center;
    gap: 2px;
}

.chat-item {
    position: relative;
}

.projects-section {
    border-top: 1px solid #3c3c42;
    padding-top: 16px;
}

.project-item {
    padding: 8px 12px;
    margin-bottom: 4px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    color: #a1a1a6;
    transition: all 0.2s ease;
}

.project-item:hover {
    background: #2d2d30;
    color: #d1d1d6;
}

/* Sidebar Toggle */
.sidebar-toggle {
    position: fixed;
    left: 280px;
    top: 20px;
    z-index: 30;
    width: 32px;
    height: 32px;
    background: #2d2d30;
    border: 1px solid #3c3c42;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
    color: #ffffff;
}

.sidebar-toggle:hover {
    background: #3c3c42;
}

.sidebar.collapsed + .sidebar-toggle {
    left: 80px;
}

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

.sidebar.collapsed + .sidebar-toggle svg {
    transform: scaleX(-1);
}

/* Main Content */
.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    margin-left: 0; /* No margin since sidebar is hidden by default */
    transition: margin-left 0.3s ease;
    min-width: 0;
}

.sidebar.open ~ .main-content {
    margin-left: 260px; /* Push content when sidebar is open */
}

.sidebar.open.collapsed ~ .main-content {
    margin-left: 60px; /* Push content less when sidebar is collapsed */
}

.chat-header {
    padding: 16px 24px;
    background: #2d2d30;
    border-bottom: 1px solid #3c3c42;
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 60px;
    box-sizing: border-box;
}

/* Hide mobile-specific elements on desktop */
.mobile-header-top,
.mobile-header-bottom,
.mobile-crypto-ticker {
    display: none;
}

.chat-title {
    font-size: 18px;
    font-weight: 600;
    color: #ffffff;
}

.header-controls {
    display: flex;
    align-items: center;
    gap: 16px;
}

.model-selector {
    position: relative;
}

.auth-section {
    display: flex;
    align-items: center;
}

.model-dropdown {
    padding: 6px 10px;
    background: #1e1e20;
    border: 1px solid #3c3c42;
    border-radius: 4px;
    font-size: 13px;
    color: #ffffff;
    cursor: pointer;
    outline: none;
    font-weight: 500;
}

.model-dropdown:focus {
    border-color: #f7c52a;
    box-shadow: 0 0 0 3px rgba(247, 197, 42, 0.1);
}

/* Crypto Marquee Bar */
.crypto-marquee-bar {
    background: #1e1e20;
    border-bottom: 1px solid #3c3c42;
    padding: 8px 0;
    height: 48px;
    display: flex;
    align-items: center;
    overflow: hidden;
    position: relative;
}

.crypto-marquee-bar gecko-coin-price-marquee-widget {
    display: block;
    width: 100%;
    height: 32px;
    font-size: 13px;
}

/* Hide marquee on very small screens */
@media (max-width: 480px) {
    .crypto-marquee-bar {
        display: none;
    }
}

/* Adjust marquee size on tablets */
@media (max-width: 768px) {
    .crypto-marquee-bar {
        height: 40px;
    }
    
    .crypto-marquee-bar gecko-coin-price-marquee-widget {
        height: 28px;
        font-size: 12px;
    }
}

/* Chat Container */
.chat-container {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 24px;
    display: flex;
    flex-direction: column;
    background: #2d2d30;
    min-width: 0;
}

.welcome-message {
    display: flex;
    align-items: center;
    gap: 20px;
    padding: 32px;
    background: #3c3c42;
    border-radius: 12px;
    border: 1px solid #565658;
    margin-bottom: 32px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}

.doge-avatar {
    width: 48px;
    height: 48px;
    flex-shrink: 0;
}

.doge-avatar img {
    width: 100%;
    height: 100%;
    border-radius: 50%;
}

.welcome-text h3 {
    font-size: 18px;
    font-weight: 600;
    color: #ffffff;
    margin-bottom: 4px;
}

.welcome-text p {
    font-size: 14px;
    color: #a1a1a6;
}

/* Messages */
.messages {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.message {
    display: flex;
    gap: 12px;
    padding: 12px 0;
    max-width: 100%;
}

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

.message-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: 600;
}

.message.user .message-avatar {
    background: #f7c52a;
    color: #2d2d30;
}

.message.assistant .message-avatar {
    background: #3c3c42;
    color: #ffffff;
}

.message-content {
    max-width: 100%;
    word-wrap: break-word;
    position: relative;
    min-width: 0;
    overflow-wrap: break-word;
}

.message.user .message-content {
    display: flex;
    justify-content: flex-end;
    max-width: 70%;
    margin-left: auto;
}

/* Copy button styling */
.copy-btn {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 32px;
    height: 32px;
    background: rgba(60, 60, 66, 0.8);
    border: 1px solid #565658;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: #a1a1a6;
    transition: all 0.2s ease;
    opacity: 0;
    backdrop-filter: blur(4px);
    z-index: 10;
}

.message.assistant:hover .copy-btn {
    opacity: 1;
}

.copy-btn:hover {
    background: rgba(86, 86, 88, 0.9);
    color: #ffffff;
    transform: scale(1.05);
}

.copy-btn.copied {
    background: rgba(247, 197, 42, 0.9);
    color: #2d2d30;
    border-color: #f7c52a;
}

.copy-btn.copied:hover {
    background: rgba(230, 180, 36, 0.9);
}

.message-bubble {
    padding: 12px 16px;
    font-size: 15px;
    line-height: 1.5;
    word-wrap: break-word;
    overflow-wrap: break-word;
    min-width: 0;
}

.message.user .message-bubble {
    background: #f7c52a;
    color: #2d2d30;
    border-radius: 18px;
    max-width: fit-content;
}

.message.assistant .message-bubble {
    background: transparent;
    color: #ffffff;
    border: none;
    padding: 0;
    font-size: 15px;
    line-height: 1.6;
}

/* Markdown styling for AI responses */
.message.assistant .message-bubble h1,
.message.assistant .message-bubble h2,
.message.assistant .message-bubble h3,
.message.assistant .message-bubble h4,
.message.assistant .message-bubble h5,
.message.assistant .message-bubble h6 {
    color: #ffffff;
    margin: 16px 0 8px 0;
    font-weight: 600;
}

.message.assistant .message-bubble h3 {
    font-size: 18px;
    color: #f7c52a;
}

.message.assistant .message-bubble p {
    margin: 8px 0;
    line-height: 1.6;
}

.message.assistant .message-bubble ul,
.message.assistant .message-bubble ol {
    margin: 8px 0;
    padding-left: 20px;
}

.message.assistant .message-bubble li {
    margin: 4px 0;
    line-height: 1.5;
}

.message.assistant .message-bubble strong {
    color: #f7c52a;
    font-weight: 600;
}

.message.assistant .message-bubble code {
    background: #565658;
    color: #ffffff;
    padding: 2px 6px;
    border-radius: 4px;
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
    font-size: 13px;
}

.message.assistant .message-bubble pre {
    background: #1e1e20;
    color: #ffffff;
    padding: 12px;
    border-radius: 6px;
    overflow-x: auto;
    margin: 8px 0;
    border-left: 3px solid #f7c52a;
    max-width: 100%;
    white-space: pre-wrap;
    word-wrap: break-word;
    overflow-wrap: break-word;
    font-size: 13px;
    line-height: 1.4;
    min-width: 0;
}

.message.assistant .message-bubble pre code {
    background: transparent;
    padding: 0;
}

.message.assistant .message-bubble hr {
    border: none;
    border-top: 1px solid #565658;
    margin: 16px 0;
}

.message.assistant .message-bubble a {
    color: #f7c52a;
    text-decoration: none;
}

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

/* Media Preview Boxes */
.media-preview {
    margin: 12px 0;
    background: #1e1e20;
    border: 1px solid #3c3c42;
    border-radius: 8px;
    overflow: hidden;
    max-width: 600px;
}

.media-preview-header {
    padding: 12px 16px;
    background: #2d2d30;
    border-bottom: 1px solid #3c3c42;
    display: flex;
    align-items: center;
    gap: 8px;
}

.media-preview-icon {
    width: 16px;
    height: 16px;
    color: #f7c52a;
}

.media-preview-title {
    font-size: 14px;
    font-weight: 600;
    color: #ffffff;
    flex: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.media-preview-content {
    padding: 0;
}

/* YouTube Video Embeds */
.youtube-embed {
    position: relative;
    width: 100%;
    height: 0;
    padding-bottom: 56.25%; /* 16:9 aspect ratio */
    background: #000;
}

.youtube-embed iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: none;
}

/* Image Preview */
.image-preview {
    display: block;
    max-width: 100%;
    height: auto;
    max-height: 300px;
    object-fit: contain;
    background: #000;
}

/* Link Preview Fallback */
.link-preview {
    padding: 16px;
    display: flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
    color: inherit;
    transition: background 0.2s ease;
}

.link-preview:hover {
    background: #2d2d30;
    text-decoration: none;
}

.link-preview-icon {
    width: 40px;
    height: 40px;
    background: #3c3c42;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #f7c52a;
    flex-shrink: 0;
}

.link-preview-text {
    flex: 1;
    overflow: hidden;
}

.link-preview-url {
    font-size: 12px;
    color: #a1a1a6;
    margin-bottom: 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.link-preview-description {
    font-size: 14px;
    color: #ffffff;
    line-height: 1.4;
}

/* Crypto Widget Styles */
.crypto-widget-container {
    margin: 12px 0;
    background: #1e1e20;
    border: 1px solid #3c3c42;
    border-radius: 8px;
    overflow: hidden;
    max-width: 700px;
}

.crypto-widget-header {
    padding: 12px 16px;
    background: #2d2d30;
    border-bottom: 1px solid #3c3c42;
    display: flex;
    align-items: center;
    gap: 8px;
}

.crypto-widget-icon {
    width: 16px;
    height: 16px;
    color: #f7c52a;
}

.crypto-widget-title {
    font-size: 14px;
    font-weight: 600;
    color: #ffffff;
    flex: 1;
}

.crypto-widget-content {
    padding: 0;
    background: #1e1e20;
}

/* Style the CoinGecko widget to match theme */
.crypto-widget-content gecko-coin-price-chart-widget {
    display: block;
    width: 100%;
    min-height: 400px;
}

/* Override CoinGecko widget styles if needed */
.crypto-widget-content gecko-coin-price-chart-widget::part(container) {
    background: #1e1e20 !important;
    border: none !important;
}

.crypto-widget-footer {
    padding: 12px 16px;
    background: #2d2d30;
    border-top: 1px solid #3c3c42;
    display: flex;
    justify-content: center;
}

.analyze-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    background: #f7c52a;
    color: #2d2d30;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 600;
    transition: all 0.2s ease;
    font-family: inherit;
}

.analyze-btn:hover:not(:disabled) {
    background: #e6b424;
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(247, 197, 42, 0.3);
}

.analyze-btn:disabled {
    background: #565658;
    color: #a1a1a6;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.analyze-icon {
    width: 14px;
    height: 14px;
    flex-shrink: 0;
}

.analyze-icon.spinning {
    animation: spin 1s linear infinite;
}

@keyframes spin {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

/* Voice Features Styling */
.voice-icon {
    width: 16px;
    height: 16px;
}

.tool-btn.listening {
    background: #f7c52a;
    color: #2d2d30;
    border-color: #f7c52a;
}

.tool-btn.listening .voice-icon {
    animation: pulse 1.5s ease-in-out infinite;
}

@keyframes pulse {
    0% {
        transform: scale(1);
        opacity: 1;
    }
    50% {
        transform: scale(1.1);
        opacity: 0.7;
    }
    100% {
        transform: scale(1);
        opacity: 1;
    }
}

.voice-icon.pulsing {
    animation: pulse 1.5s ease-in-out infinite;
}

/* Voice toggle styling */
.toggle-btn.active .voice-icon {
    color: #f7c52a;
}

.toggle-btn .toggle-text {
    font-size: 12px;
}

.typing-indicator {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 12px 16px;
    background: transparent;
    border: none;
}

.typing-dot {
    width: 6px;
    height: 6px;
    background: #a1a1a6;
    border-radius: 50%;
    animation: typing 1.4s infinite ease-in-out;
}

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

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

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

/* Input Area */
.input-area {
    padding: 16px 24px;
    background: #2d2d30;
    border-top: 1px solid #3c3c42;
}

.input-container {
    max-width: 768px;
    margin: 0 auto;
}

.input-toolbar {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
    position: relative;
}

.tool-btn {
    width: 32px;
    height: 32px;
    background: transparent;
    border: 1px solid #3c3c42;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: #a1a1a6;
    transition: all 0.2s ease;
}

.tool-btn:hover {
    background: #3c3c42;
    color: #ffffff;
}

.search-dropdown {
    position: relative;
}

.smart-doge-toggle {
    margin-left: auto;
}

.voice-toggle {
    margin-left: 8px;
}

.toggle-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    background: #3c3c42;
    border: 1px solid #565658;
    border-radius: 16px;
    cursor: pointer;
    color: #a1a1a6;
    transition: all 0.2s ease;
    font-size: 13px;
    font-weight: 500;
    white-space: nowrap;
}

.toggle-btn:hover {
    background: #565658;
    color: #ffffff;
}

.toggle-btn.active {
    background: #f7c52a;
    color: #2d2d30;
    border-color: #f7c52a;
}

.toggle-btn.active:hover {
    background: #e6b424;
}

.toggle-text {
    font-size: 12px;
    font-weight: 500;
}

.search-menu {
    position: absolute;
    bottom: 100%;
    left: 0;
    margin-bottom: 8px;
    background: #3c3c42;
    border: 1px solid #565658;
    border-radius: 8px;
    padding: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
    display: none;
    min-width: 160px;
}

.search-menu.show {
    display: block;
}

.search-option {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px;
    border-radius: 4px;
    cursor: pointer;
    transition: background 0.2s ease;
}

.search-option:hover {
    background: #2d2d30;
}

.search-option input[type="checkbox"] {
    margin: 0;
}

.search-option label {
    font-size: 14px;
    color: #ffffff;
    cursor: pointer;
}

.input-wrapper {
    display: flex;
    align-items: flex-end;
    gap: 8px;
    padding: 12px 16px;
    background: #3c3c42;
    border: 1px solid #565658;
    border-radius: 12px;
    transition: all 0.15s ease;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}

.input-wrapper:focus-within {
    border-color: #f7c52a;
    box-shadow: 0 0 0 3px rgba(247, 197, 42, 0.1);
}

#messageInput {
    flex: 1;
    background: transparent;
    border: none;
    outline: none;
    font-size: 15px;
    line-height: 1.5;
    color: #ffffff !important;
    resize: none;
    min-height: 22px;
    max-height: 120px;
    font-family: inherit;
    font-weight: 400;
}

#messageInput::placeholder {
    color: #a1a1a6 !important;
}

#messageInput:focus {
    color: #ffffff !important;
}

/* Ensure text is visible in all states */
#messageInput:-webkit-autofill,
#messageInput:-webkit-autofill:hover,
#messageInput:-webkit-autofill:focus {
    -webkit-text-fill-color: #ffffff !important;
    -webkit-box-shadow: 0 0 0px 1000px transparent inset;
}

.send-btn {
    width: 32px;
    height: 32px;
    background: #f7c52a;
    border: none;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: #2d2d30;
    transition: all 0.15s ease;
    flex-shrink: 0;
}

.send-btn:hover:not(:disabled) {
    background: #e6b424;
    transform: scale(1.05);
}

.send-btn:disabled {
    background: #565658;
    cursor: not-allowed;
    color: #a1a1a6;
}

/* Thinking Indicator Styles */
.thinking-indicator {
    padding: 16px 0;
    margin: 8px 0;
    animation: fadeIn 0.3s ease-out;
}

.thinking-content {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    max-width: 100%;
}

.thinking-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: #3c3c42;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.thinking-star {
    font-size: 16px;
    color: #f7c52a;
    animation: spin 2s linear infinite;
}

.thinking-text {
    flex: 1;
    min-width: 0;
}

.thinking-text span {
    font-size: 15px;
    color: #ffffff;
    font-weight: 500;
}

.thinking-details {
    margin-top: 4px;
    font-size: 13px;
    color: #a1a1a6;
    display: flex;
    align-items: center;
    gap: 4px;
    flex-wrap: wrap;
}

.thinking-interrupt {
    color: #8a8a8a;
    font-style: italic;
}

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

@keyframes spin {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

/* Upgrade prompt styles */
.upgrade-prompt {
    background: linear-gradient(135deg, #f7c52a 0%, #e6b424 100%);
    color: #2d2d30;
    padding: 16px;
    border-radius: 8px;
    margin: 12px 0;
    text-align: center;
    border: none;
    box-shadow: 0 2px 8px rgba(247, 197, 42, 0.3);
}

.upgrade-prompt h4 {
    margin: 0 0 8px 0;
    font-size: 16px;
    font-weight: 600;
}

.upgrade-prompt p {
    margin: 0 0 12px 0;
    font-size: 14px;
    opacity: 0.9;
}

.upgrade-btn {
    background: #2d2d30;
    color: #ffffff;
    border: none;
    padding: 8px 16px;
    border-radius: 4px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.upgrade-btn:hover {
    background: #1e1e20;
    transform: translateY(-1px);
}

.login-prompt {
    background: linear-gradient(135deg, #3c3c42 0%, #2d2d30 100%);
    color: #ffffff;
    padding: 16px;
    border-radius: 8px;
    margin: 12px 0;
    text-align: center;
    border: 1px solid #565658;
}

.login-prompt h4 {
    margin: 0 0 8px 0;
    font-size: 16px;
    font-weight: 600;
}

.login-prompt p {
    margin: 0 0 12px 0;
    font-size: 14px;
    opacity: 0.9;
}

.login-btn {
    background: #f7c52a;
    color: #2d2d30;
    border: none;
    padding: 8px 16px;
    border-radius: 4px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.login-btn:hover {
    background: #e6b424;
    transform: translateY(-1px);
}

/* Login Modal Styles */
.login-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 1000;
    display: none;
    align-items: center;
    justify-content: center;
}

.login-modal.show {
    display: flex;
}

.login-modal-backdrop {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(4px);
}

.login-modal-content {
    position: relative;
    background: #1e1e20;
    border: 1px solid #3c3c42;
    border-radius: 12px;
    width: 400px;
    max-width: 90vw;
    padding: 32px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.5);
    animation: modalSlideIn 0.3s ease-out;
}

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

.login-header {
    text-align: center;
    margin-bottom: 32px;
}

.login-logo {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    margin-bottom: 16px;
}

.login-title {
    font-size: 24px;
    font-weight: 600;
    color: #ffffff;
    margin-bottom: 8px;
}

.login-subtitle {
    font-size: 14px;
    color: #a1a1a6;
    margin: 0;
}

.login-buttons {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 24px;
}

.oauth-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 12px 16px;
    border: 1px solid #3c3c42;
    border-radius: 8px;
    background: #2d2d30;
    color: #ffffff;
    font-size: 14px;
    font-weight: 500;
    font-family: inherit;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
}

.oauth-btn:hover {
    background: #3c3c42;
    border-color: #565658;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.oauth-btn.google-btn:hover {
    border-color: #4285f4;
    box-shadow: 0 4px 12px rgba(66, 133, 244, 0.2);
}

.oauth-btn.github-btn:hover {
    border-color: #ffffff;
    box-shadow: 0 4px 12px rgba(255, 255, 255, 0.1);
}

.oauth-icon {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
}

.login-footer {
    text-align: center;
}

.login-terms {
    font-size: 12px;
    color: #a1a1a6;
    margin: 0;
    line-height: 1.4;
}

.login-link {
    color: #f7c52a;
    text-decoration: none;
}

.login-link:hover {
    text-decoration: underline;
}

/* User Menu Styles */
.user-menu {
    position: fixed;
    top: 70px;
    right: 24px;
    width: 240px;
    background: #1e1e20;
    border: 1px solid #3c3c42;
    border-radius: 8px;
    padding: 8px 0;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
    z-index: 100;
    display: none;
    animation: menuSlideIn 0.2s ease-out;
}

.user-menu.show {
    display: block;
}

@keyframes menuSlideIn {
    from {
        opacity: 0;
        transform: translateY(-8px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.user-info {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    margin-bottom: 4px;
}

.user-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
}

.user-details {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-width: 0;
}

.user-name {
    font-size: 14px;
    font-weight: 600;
    color: #ffffff;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.user-email {
    font-size: 12px;
    color: #a1a1a6;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.user-menu-divider {
    height: 1px;
    background: #3c3c42;
    margin: 8px 0;
}

.user-menu-item {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
    padding: 10px 16px;
    background: transparent;
    border: none;
    color: #d1d1d6;
    font-size: 14px;
    font-family: inherit;
    cursor: pointer;
    transition: background 0.2s ease;
    text-align: left;
}

.user-menu-item:hover {
    background: #2d2d30;
    color: #ffffff;
}

.user-menu-item svg {
    flex-shrink: 0;
}

/* User button in header */
.user-button {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 8px;
    background: transparent;
    border: 1px solid #3c3c42;
    border-radius: 20px;
    cursor: pointer;
    color: #ffffff;
    font-size: 14px;
    font-family: inherit;
    transition: all 0.2s ease;
}

.user-button:hover {
    background: #3c3c42;
    border-color: #565658;
}

.user-button-avatar {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    object-fit: cover;
}

.login-button {
    padding: 8px 16px;
    background: #f7c52a;
    border: none;
    border-radius: 6px;
    color: #2d2d30;
    font-size: 14px;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    transition: all 0.2s ease;
}

.login-button:hover {
    background: #e6b424;
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(247, 197, 42, 0.3);
}

.logout-button {
    padding: 8px 16px;
    background: #dc3545;
    border: none;
    border-radius: 6px;
    color: #ffffff;
    font-size: 14px;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    transition: all 0.2s ease;
}

.logout-button:hover {
    background: #c82333;
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(220, 53, 69, 0.3);
}

.user-info-section, .mobile-user-info {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
}

.user-display, .mobile-user-display {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
    color: #ffffff;
    font-size: 14px;
    font-weight: 500;
}

.mobile-user-info {
    align-items: flex-start;
    width: 100%;
}

.mobile-logout-button {
    padding: 8px 12px;
    background: #dc3545;
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 12px;
    font-weight: 500;
    transition: all 0.2s ease;
    width: 100%;
    margin-top: 8px;
}

.mobile-logout-button:hover {
    background: #c82333;
}

/* Sidebar Footer */
.sidebar-footer {
    margin-top: auto;
    padding: 16px;
    border-top: 1px solid #3c3c42;
}

.sidebar-menu-section {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.sidebar-menu-item {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.sidebar-menu-item label {
    font-size: 12px;
    color: #999;
    font-weight: 500;
}

.sidebar-model-dropdown {
    background: #2d2d30;
    border: 1px solid #3c3c42;
    border-radius: 6px;
    color: #ffffff;
    padding: 8px 12px;
    font-size: 13px;
    cursor: pointer;
}

.sidebar-my-doge-btn, .sidebar-settings-btn {
    background: transparent;
    border: 1px solid #3c3c42;
    border-radius: 6px;
    color: #ffffff;
    padding: 8px 12px;
    font-size: 13px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.2s ease;
}

.sidebar-my-doge-btn:hover, .sidebar-settings-btn:hover {
    background: #3c3c42;
    border-color: #565658;
}

.sidebar-login-button {
    background: #f7c52a;
    border: none;
    border-radius: 6px;
    color: #2d2d30;
    padding: 8px 12px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.sidebar-login-button:hover {
    background: #e6b424;
}

.sidebar-user-info {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.sidebar-user-display {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #ffffff;
    font-size: 13px;
    font-weight: 500;
}

.sidebar-user-avatar {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    object-fit: cover;
}

.sidebar-logout-button {
    background: #dc3545;
    border: none;
    border-radius: 6px;
    color: #ffffff;
    padding: 6px 12px;
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.sidebar-logout-button:hover {
    background: #c82333;
}

/* Mobile Optimizations for iPhone and small screens */
@media (max-width: 768px) {
    .sidebar {
        position: fixed;
        top: 0;
        left: 0;
        height: 100vh;
        z-index: 40;
        transform: translateX(-100%);
        width: 260px;
        max-width: 260px;
    }
    
    .sidebar.open {
        transform: translateX(0);
    }
    
    .sidebar.collapsed {
        transform: translateX(-100%);
        width: 260px;
    }
    
    .sidebar-toggle {
        position: fixed;
        left: 16px;
        top: 16px;
        z-index: 50;
        width: 36px;
        height: 36px;
        display: flex;
        align-items: center;
        justify-content: center;
    }
    
    .sidebar-toggle svg {
        transform: scaleX(1) !important; /* Always point right when closed */
    }
    
    .sidebar.open + .sidebar-toggle {
        left: 16px; /* Keep in same position */
    }
    
    .sidebar.open + .sidebar-toggle svg {
        transform: scaleX(-1) !important; /* Point left when open */
    }
    
    .sidebar.collapsed + .sidebar-toggle {
        left: 16px;
    }
    
    .main-content {
        margin-left: 0;
        width: 100%;
        transition: transform 0.3s ease;
        display: flex;
        flex-direction: column;
        min-height: 100vh; /* Ensure full height */
    }
    
    .sidebar.open ~ .main-content {
        transform: translateX(0px); /* Don't push content - overlay instead */
    }
    
    .chat-header {
        padding: 8px 16px 8px 60px; /* More space for toggle button */
        position: relative;
        min-height: 80px; /* Increased height for two rows */
        overflow: hidden;
        display: flex;
        flex-direction: column; /* Stack vertically */
        justify-content: space-between;
    }
    
    /* Show mobile-specific elements on mobile */
    .mobile-header-top,
    .mobile-header-bottom,
    .mobile-crypto-ticker {
        display: flex !important;
    }
    
    /* Mobile crypto ticker spans full width */
    .mobile-crypto-ticker {
        width: 100%;
        justify-content: stretch;
        flex: 1;
        overflow: hidden;
    }
    
    .mobile-crypto-ticker gecko-coin-price-marquee-widget {
        width: 100% !important;
        max-width: 100% !important;
        min-width: 100% !important;
        flex: 1 !important;
    }
    
    /* Top row with title - mobile only */
    .mobile-header-top {
        align-items: center;
        justify-content: center;
        width: 100%;
        margin-bottom: 4px;
    }
    
    .chat-title {
        font-size: 18px;
        font-weight: 600;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        text-align: center;
        flex: 1;
        margin: 0;
    }
    
    /* Bottom row with crypto ticker - mobile only */
    .mobile-header-bottom {
        display: flex;
        align-items: center;
        justify-content: center;
        width: 100%;
        padding: 0 8px;
    }
    
    /* Hide desktop structures on mobile */
    .crypto-marquee-bar {
        display: none; /* Hide the main crypto bar on mobile - it will be in header */
    }
    
    /* Hide inner navbar logo when menu is expanded on mobile */
    .sidebar.open ~ .main-content .chat-title {
        opacity: 0.3; /* Fade instead of hide to maintain layout */
        transition: all 0.3s ease;
    }
    
    .chat-container {
        padding: 16px 12px 20px 12px; /* Normal padding since input is not fixed */
        width: 100%;
        box-sizing: border-box;
        overflow-y: auto;
        min-height: calc(100vh - 240px); /* Adjusted for taller header */
        flex: 1; /* Allow container to grow and shrink */
    }
    
    /* Hide desktop header controls on mobile */
    .header-controls {
        display: none !important;
    }
    
    .model-selector {
        flex: 0 0 auto;
        min-width: 80px;
        max-width: 90px;
    }
    
    .model-dropdown {
        font-size: 10px;
        padding: 3px 5px;
        min-width: 80px;
        max-width: 90px;
        height: 26px;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        border-radius: 4px;
    }
    
    .auth-section {
        flex: 0 0 auto;
    }
    
    .login-button, .user-button {
        font-size: 10px !important;
        padding: 3px 6px !important;
        min-width: 40px;
        max-width: 50px;
        height: 26px;
        display: flex;
        align-items: center;
        justify-content: center;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        line-height: 1;
        border-radius: 4px;
    }
    
    .user-button span {
        max-width: 40px;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
        font-size: 10px;
    }
    
    .input-area {
        padding: 16px 16px 20px 16px; /* Extra bottom padding for iOS */
        width: 100%;
        box-sizing: border-box;
        padding-bottom: max(env(safe-area-inset-bottom), 25px); /* iOS safe area with minimum */
        position: relative; /* Changed from fixed to relative */
        background: #2d2d30;
        border-top: 1px solid #3c3c42;
        z-index: 10;
    }
    
    /* Fix search dropdown overlap */
    .search-dropdown {
        position: relative;
    }
    
    .search-menu {
        position: absolute;
        bottom: calc(100% + 8px); /* Show above button on mobile */
        left: 50%;
        transform: translateX(-50%);
        min-width: 160px;
        z-index: 1000;
    }
    
    /* Improve input wrapper on mobile */
    .input-wrapper {
        min-height: 44px; /* Better touch target */
        padding: 8px 12px;
        background: #1e1e20;
        border-radius: 8px;
    }
    
    #messageInput {
        font-size: 16px; /* Prevent zoom on iOS */
        line-height: 1.4;
        min-height: 20px;
        background: transparent;
        border: none;
        outline: none;
        resize: none;
        color: #ffffff;
    }
    
    /* Prevent zoom when focusing input */
    input, textarea, select {
        font-size: 16px !important;
    }
    
    /* Keyboard state handling for mobile */
    body.keyboard-open .main-content {
        padding-bottom: 0;
    }
    
    body.keyboard-open .chat-container {
        margin-bottom: 0;
    }
    
    /* Smooth scrolling for mobile */
    html {
        scroll-behavior: smooth;
    }
    
    /* Ensure input area stays at bottom on mobile */
    .main-content {
        position: relative;
    }
    
    /* Better mobile textarea focus handling */
    #messageInput:focus {
        outline: none;
        box-shadow: 0 0 0 2px #FF6B00;
    }
    
    /* Mobile dropdown menu styles */
    .mobile-menu-btn {
        display: none;
        background: none;
        border: none;
        color: #ffffff;
        cursor: pointer;
        padding: 4px;
        border-radius: 4px;
        transition: all 0.2s ease;
        margin-left: 8px;
    }
    
    .mobile-menu-btn:hover {
        background: rgba(255, 255, 255, 0.1);
    }
    
    .mobile-dropdown-menu {
        display: none;
        position: fixed;
        top: 80px;
        right: 16px;
        background: #1e1e20;
        border: 1px solid #3c3c42;
        border-radius: 8px;
        box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
        z-index: 99999;
        min-width: 200px;
        margin-top: 4px;
    }
    
    .mobile-dropdown-menu.show {
        display: block;
    }
    
    .mobile-menu-item {
        padding: 12px 16px;
        border-bottom: 1px solid #3c3c42;
    }
    
    .mobile-menu-item:last-child {
        border-bottom: none;
    }
    
    .mobile-menu-item label {
        display: block;
        color: #ffffff;
        font-size: 12px;
        margin-bottom: 6px;
        font-weight: 500;
    }
    
    .mobile-model-dropdown {
        width: 100%;
        background: #2d2d30;
        border: 1px solid #3c3c42;
        color: #ffffff;
        padding: 6px 8px;
        border-radius: 4px;
        font-size: 13px;
    }
    
    .mobile-settings-btn {
        display: flex;
        align-items: center;
        gap: 8px;
        background: none;
        border: none;
        color: #ffffff;
        cursor: pointer;
        padding: 6px 0;
        font-size: 13px;
        transition: color 0.2s ease;
        width: 100%;
        text-align: left;
    }
    
    .mobile-my-doge-btn {
        display: flex;
        align-items: center;
        gap: 8px;
        background: none;
        border: none;
        color: #ffffff;
        cursor: pointer;
        padding: 6px 0;
        font-size: 13px;
        transition: color 0.2s ease;
        width: 100%;
        text-align: left;
        position: relative;
    }
    
    .mobile-my-doge-btn:hover {
        color: #FF6B00;
    }
    
    .pro-badge {
        background: linear-gradient(135deg, #FF6B00, #FFB800);
        color: #ffffff;
        font-size: 8px;
        font-weight: bold;
        padding: 2px 4px;
        border-radius: 4px;
        margin-left: auto;
        text-transform: uppercase;
        letter-spacing: 0.5px;
    }
    
    .mobile-settings-btn {
        display: flex;
        align-items: center;
        gap: 8px;
        background: none;
        border: none;
        color: #ffffff;
        cursor: pointer;
        padding: 6px 0;
        font-size: 13px;
        transition: color 0.2s ease;
        width: 100%;
        text-align: left;
    }
    
    .mobile-settings-btn:hover {
        color: #FF6B00;
    }
    
    .mobile-auth-item {
        display: flex;
        align-items: center;
        justify-content: center;
    }
    
    .mobile-login-button, .mobile-user-button {
        background: #FF6B00;
        border: none;
        color: #ffffff;
        padding: 8px 16px;
        border-radius: 6px;
        font-size: 13px;
        cursor: pointer;
        transition: background 0.2s ease;
        display: flex;
        align-items: center;
        gap: 6px;
    }
    
    .mobile-login-button:hover, .mobile-user-button:hover {
        background: #e55a00;
    }
    
    .mobile-user-avatar {
        width: 16px;
        height: 16px;
        border-radius: 50%;
    }
    
    /* Show mobile menu button and hide desktop controls on mobile */
    .mobile-menu-btn {
        display: flex !important;
    }
    
    .desktop-only {
        display: none !important;
    }
    
    /* Mobile header top adjustments */
    .mobile-header-top {
        position: relative;
        justify-content: space-between !important;
        align-items: center;
    }
    
    .chat-title {
        flex: 1;
        text-align: center;
        margin: 0 40px; /* Space for menu button */
    }
    

    /* Better mobile code blocks */
    .message.assistant .message-bubble pre {
        font-size: 12px;
        padding: 8px;
        margin: 8px 0;
        overflow-x: auto;
        max-width: calc(100vw - 80px);
    }

    .message.assistant .message-bubble code {
        font-size: 12px;
        padding: 1px 4px;
    }

    /* Mobile message spacing */
    .message {
        padding: 8px 0;
        max-width: 100%;
    }

    .message-content {
        max-width: 95%;
        min-width: 0;
    }

    .message.user .message-content {
        max-width: 85%;
        min-width: 0;
    }
    
    .message-bubble {
        max-width: 100%;
        min-width: 0;
        overflow-wrap: break-word;
        word-break: break-word;
    }
    
    /* Mobile overlay */
    .sidebar.open::before {
        content: '';
        position: fixed;
        top: 0;
        left: 0;
        width: 100vw;
        height: 100vh;
        background: rgba(0, 0, 0, 0.5);
        z-index: -1;
        pointer-events: auto;
    }
    
    /* Ensure all content stays within viewport */
    .main-content {
        width: 100%;
        max-width: 100vw;
        overflow-x: hidden;
    }
    
    .crypto-marquee-bar {
        display: none; /* Hide the main crypto bar on mobile - it will be in header */
    }
    
    /* Mobile crypto ticker in header */
    .mobile-crypto-ticker {
        flex: 1;
        max-width: 60%;
        overflow: hidden;
    }
    
    .mobile-crypto-ticker gecko-coin-price-marquee-widget {
        height: 28px;
        font-size: 11px;
    }
    
    .chat-container {
        width: 100%;
        max-width: 100vw;
        overflow-x: hidden;
    }
    
    .input-area {
        width: 100%;
        max-width: 100vw;
    }
    
    .input-container {
        width: 100%;
        max-width: 100%;
    }
    
    .messages {
        width: 100%;
        max-width: 100%;
        overflow-x: hidden;
    }
    
    .message {
        max-width: 100%;
        word-wrap: break-word;
        overflow-wrap: break-word;
    }
    
    .message-content {
        max-width: 100%;
        word-wrap: break-word;
        overflow-wrap: break-word;
    }
    
    .message-bubble {
        max-width: 100%;
        word-wrap: break-word;
        overflow-wrap: break-word;
    }
}

/* Tablet and smaller desktop screens */
@media (max-width: 1024px) and (min-width: 769px) {
    .sidebar {
        width: 240px;
    }
    
    .main-content {
        margin-left: 0; /* Default to no margin since sidebar is hidden */
    }
    
    .sidebar.open ~ .main-content {
        margin-left: 240px; /* Push content when sidebar is open */
    }
    
    .sidebar.open.collapsed ~ .main-content {
        margin-left: 60px; /* Push content less when sidebar is collapsed */
    }
    
    .sidebar-toggle {
        left: 16px; /* Same position as mobile */
    }
    
    .sidebar.open + .sidebar-toggle {
        left: 256px; /* Move when sidebar is open */
    }
    
    .sidebar.open.collapsed + .sidebar-toggle {
        left: 76px; /* Move when sidebar is collapsed */
    }
}

/* Guest Stats Section */
.guest-stats-section {
    padding: 0 16px 16px 16px;
}

.guest-stats-section .section-title {
    font-size: 12px;
    font-weight: 600;
    color: #9ca3af;
    margin-bottom: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.guest-stats {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.guest-stat-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 12px;
    background: #2d2d30;
    border-radius: 6px;
    border: 1px solid #3c3c42;
}

.stat-label {
    font-size: 13px;
    color: #9ca3af;
}

.stat-value {
    font-size: 13px;
    font-weight: 600;
    color: #ffffff;
}

.guest-upgrade-prompt {
    margin-top: 8px;
}

.guest-upgrade-btn {
    width: 100%;
    padding: 8px 12px;
    background: linear-gradient(135deg, #f7c52a, #e6b422);
    border: none;
    border-radius: 6px;
    color: #1e1e20;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.guest-upgrade-btn:hover {
    background: linear-gradient(135deg, #e6b422, #d4a01f);
    transform: translateY(-1px);
}

.guest-upgrade-btn svg {
    width: 14px;
    height: 14px;
}

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

.progress-bar {
    width: 100%;
    height: 6px;
    background: #3c3c42;
    border-radius: 3px;
    overflow: hidden;
    margin-bottom: 4px;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #22c55e, #f7c52a);
    border-radius: 3px;
    transition: width 0.3s ease;
}

.remaining-text {
    font-size: 11px;
    color: #9ca3af;
    text-align: center;
    display: block;
}

/* Hide guest stats when collapsed */
.sidebar.collapsed .guest-stats-section {
    display: none;
}

/* User Stats Section for Free Users */
.user-stats-section {
    padding: 0 16px 16px 16px;
    border-top: 1px solid #3c3c42;
    margin-top: 8px;
    padding-top: 16px;
}

.user-stats-section .section-title {
    font-size: 12px;
    font-weight: 600;
    color: #9ca3af;
    margin-bottom: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.user-stats {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.user-stat-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 12px;
    background: #1e1e20;
    border-radius: 6px;
    border: 1px solid #3c3c42;
}

.user-upgrade-prompt {
    margin-top: 8px;
}

.user-upgrade-btn {
    width: 100%;
    padding: 8px 12px;
    background: linear-gradient(135deg, #8b5cf6, #7c3aed);
    border: none;
    border-radius: 6px;
    color: #ffffff;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.user-upgrade-btn:hover {
    background: linear-gradient(135deg, #7c3aed, #6d28d9);
    transform: translateY(-1px);
}

.user-upgrade-btn svg {
    width: 14px;
    height: 14px;
}

/* Hide user stats when collapsed */
.sidebar.collapsed .user-stats-section {
    display: none;
}

/* Guest New Chat Popup */
.guest-chat-popup {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
}

.guest-chat-popup-backdrop {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(4px);
}

.guest-chat-popup-content {
    position: relative;
    background: #2d2d30;
    border: 2px solid #f7c52a;
    border-radius: 16px;
    padding: 24px;
    max-width: 480px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
    animation: dogePopupSlide 0.3s ease-out;
}

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

.guest-chat-popup-header {
    text-align: center;
    margin-bottom: 20px;
}

.doge-faces {
    display: flex;
    justify-content: center;
    gap: 16px;
    margin-bottom: 16px;
}

.doge-face {
    font-size: 32px;
    animation: dogeBounce 2s ease-in-out infinite;
}

.doge-face.excited {
    animation-delay: 0s;
}

.doge-face.happy {
    animation-delay: 0.3s;
}

.doge-face.wow {
    animation-delay: 0.6s;
}

@keyframes dogeBounce {
    0%, 20%, 50%, 80%, 100% {
        transform: translateY(0);
    }
    40% {
        transform: translateY(-8px);
    }
    60% {
        transform: translateY(-4px);
    }
}

.popup-title {
    color: #f7c52a;
    font-size: 24px;
    font-weight: 700;
    margin: 0;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.guest-chat-popup-body {
    margin-bottom: 24px;
}

.doge-message {
    text-align: center;
    margin-bottom: 20px;
}

.doge-text {
    color: #f7c52a;
    font-size: 18px;
    font-weight: 600;
    margin: 0 0 8px 0;
}

.explanation {
    color: #e5e7eb;
    font-size: 14px;
    margin: 0 0 8px 0;
}

.encouragement {
    color: #9ca3af;
    font-size: 13px;
    margin: 0;
    font-style: italic;
}

.benefits-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-top: 16px;
}

.benefit-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px 12px;
    background: #1e1e20;
    border-radius: 8px;
    border: 1px solid #3c3c42;
}

.benefit-icon {
    font-size: 18px;
    width: 24px;
    text-align: center;
}

.benefit-text {
    color: #e5e7eb;
    font-size: 14px;
    font-weight: 500;
}

.guest-chat-popup-buttons {
    display: flex;
    gap: 12px;
    margin-bottom: 16px;
}

.popup-btn {
    flex: 1;
    padding: 12px 16px;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.popup-btn.primary {
    background: linear-gradient(135deg, #f7c52a, #e6b422);
    color: #1e1e20;
}

.popup-btn.primary:hover {
    background: linear-gradient(135deg, #e6b422, #d4a01f);
    transform: translateY(-1px);
}

.popup-btn.secondary {
    background: #3c3c42;
    color: #e5e7eb;
    border: 1px solid #4b5563;
}

.popup-btn.secondary:hover {
    background: #4b5563;
    transform: translateY(-1px);
}

.btn-text {
    font-size: 14px;
}

.btn-icon {
    font-size: 16px;
}

.popup-footer {
    text-align: center;
    border-top: 1px solid #3c3c42;
    padding-top: 16px;
}

.footer-doge {
    color: #9ca3af;
    font-size: 12px;
    margin: 0;
    font-style: italic;
}

/* Mobile responsive */
@media (max-width: 568px) {
    .guest-chat-popup-content {
        padding: 20px;
        margin: 16px;
        max-width: none;
    }
    
    .popup-title {
        font-size: 20px;
    }
    
    .doge-face {
        font-size: 28px;
    }
    
    .guest-chat-popup-buttons {
        flex-direction: column;
    }
}

/* Attachment dropdown styles - works on all screen sizes */
.attachment-dropdown {
    position: relative;
}

.attachment-menu {
    display: none;
    position: absolute;
    bottom: calc(100% + 8px);
    left: 50%;
    transform: translateX(-50%);
    background: #1e1e20;
    border: 1px solid #3c3c42;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    z-index: 1000;
    min-width: 120px;
}

.attachment-menu.show {
    display: block;
}

.attachment-option {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 12px;
    cursor: pointer;
    transition: background 0.2s ease;
    font-size: 13px;
    color: #ffffff;
}

.attachment-option:hover {
    background: rgba(255, 255, 255, 0.1);
}

.attachment-option:first-child {
    border-radius: 8px 8px 0 0;
}

.attachment-option:last-child {
    border-radius: 0 0 8px 8px;
}

/* Default toolbar layout */
.toolbar-default {
    display: flex;
    gap: 12px;
    align-items: center;
    justify-content: flex-start;
    flex-wrap: wrap;
}

.toolbar-small-screen {
    display: none;
}

/* Three-row input layout for very small screens */
@media (max-width: 380px) and (max-height: 808px) {
    .toolbar-default {
        display: none;
    }
    
    .toolbar-small-screen {
        display: flex;
        flex-direction: column;
        gap: 8px;
        margin-bottom: 12px;
    }
    
    .toolbar-row {
        display: flex;
        justify-content: center;
        gap: 12px;
        flex-wrap: nowrap;
    }
    
    .toolbar-row-2 {
        justify-content: flex-start;
    }
    
    .toolbar-row-2-left {
        display: flex;
        gap: 12px;
        align-items: center;
    }
    
    .input-wrapper {
        margin-top: 8px;
    }
}

/* Move menu button inside header on larger screens */
@media (min-width: 769px) {
    .mobile-menu-btn {
        display: none !important;
    }
    
    .mobile-header-top {
        justify-content: center !important;
    }
    
    .chat-title {
        margin: 0 !important;
    }
}

/* Large desktop screens - ensure sidebar respects hidden state */
@media (min-width: 1025px) {
    .main-content {
        margin-left: 0; /* Default to no margin since sidebar is hidden */
    }
    
    .sidebar.open ~ .main-content {
        margin-left: 260px; /* Push content when sidebar is open */
    }
    
    .sidebar.open.collapsed ~ .main-content {
        margin-left: 60px; /* Push content less when sidebar is collapsed */
    }
    
    .sidebar-toggle {
        left: 16px; /* Same position as mobile */
    }
    
    .sidebar.open + .sidebar-toggle {
        left: 276px; /* Move when sidebar is open */
    }
    
    .sidebar.open.collapsed + .sidebar-toggle {
        left: 76px; /* Move when sidebar is collapsed */
    }
}

/* Doge Selection Modal */
.doge-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 10000;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.doge-modal.show {
    display: flex;
    opacity: 1;
}

.doge-modal-backdrop {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

.doge-modal-content {
    position: relative;
    margin: auto;
    background: linear-gradient(135deg, #1e1e20 0%, #2d2d30 100%);
    border-radius: 20px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    max-width: 500px;
    width: 90%;
    max-height: 90vh;
    overflow: hidden;
    border: 1px solid #3c3c42;
}

.doge-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 24px;
    border-bottom: 1px solid #3c3c42;
    background: linear-gradient(135deg, #FF6B00, #FFB800);
}

.doge-modal-title {
    color: #ffffff;
    font-size: 24px;
    font-weight: 700;
    margin: 0;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.doge-modal-close {
    background: rgba(255, 255, 255, 0.1);
    border: none;
    border-radius: 8px;
    color: #ffffff;
    cursor: pointer;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.doge-modal-close:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: scale(1.1);
}

.doge-carousel-container {
    position: relative;
    padding: 40px 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 300px;
}

.doge-carousel {
    width: 100%;
    max-width: 300px;
    overflow: hidden;
    border-radius: 20px;
}

.doge-carousel-track {
    display: flex;
    transition: transform 0.3s ease;
    will-change: transform;
}

.doge-carousel-slide {
    min-width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    opacity: 0.6;
    transform: scale(0.9);
    transition: all 0.3s ease;
}

.doge-carousel-slide.active {
    opacity: 1;
    transform: scale(1);
}

.doge-image-container {
    width: 200px;
    height: 200px;
    border-radius: 50%;
    overflow: hidden;
    border: 4px solid #FF6B00;
    box-shadow: 0 10px 30px rgba(255, 107, 0, 0.3);
    background: linear-gradient(135deg, #FF6B00, #FFB800);
    padding: 4px;
    margin-bottom: 16px;
}

.doge-carousel-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
    transition: transform 0.3s ease;
}

.doge-carousel-slide.active .doge-carousel-image {
    transform: scale(1.05);
}

.doge-name {
    color: #ffffff;
    font-size: 18px;
    font-weight: 600;
    text-align: center;
    margin-top: 8px;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
}

.doge-carousel-arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255, 107, 0, 0.8);
    border: none;
    border-radius: 50%;
    width: 48px;
    height: 48px;
    color: #ffffff;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    box-shadow: 0 4px 12px rgba(255, 107, 0, 0.3);
    z-index: 10;
}

.doge-carousel-arrow:hover {
    background: #FF6B00;
    transform: translateY(-50%) scale(1.1);
    box-shadow: 0 6px 20px rgba(255, 107, 0, 0.5);
}

.doge-carousel-prev {
    left: -24px;
}

.doge-carousel-next {
    right: -24px;
}

.doge-modal-actions {
    padding: 20px 24px;
    border-top: 1px solid #3c3c42;
    display: flex;
    justify-content: center;
}

.doge-select-btn {
    background: linear-gradient(135deg, #FF6B00, #FFB800);
    border: none;
    border-radius: 12px;
    color: #ffffff;
    font-size: 16px;
    font-weight: 600;
    padding: 12px 32px;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 4px 12px rgba(255, 107, 0, 0.3);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.doge-select-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(255, 107, 0, 0.5);
}

.doge-select-btn:active {
    transform: translateY(0);
}

/* Mobile responsiveness for Doge modal */
@media (max-width: 768px) {
    .doge-modal-content {
        width: 95%;
        margin: 20px auto;
    }
    
    .doge-modal-header {
        padding: 16px 20px;
    }
    
    .doge-modal-title {
        font-size: 20px;
    }
    
    .doge-carousel-container {
        padding: 30px 15px;
        min-height: 250px;
    }
    
    .doge-image-container {
        width: 150px;
        height: 150px;
    }
    
    .doge-name {
        font-size: 16px;
    }
    
    .doge-carousel-arrow {
        width: 40px;
        height: 40px;
    }
    
    .doge-carousel-prev {
        left: -20px;
    }
    
    .doge-carousel-next {
        right: -20px;
    }
    
    .doge-modal-actions {
        padding: 16px 20px;
    }
    
    .doge-select-btn {
        width: 100%;
        padding: 14px 24px;
    }
}