* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: Verdana, Geneva, Tahoma, sans-serif;
}

*:focus {
    outline: none;
}

*::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

*::-webkit-scrollbar-track {
    background: transparent;
}

*::-webkit-scrollbar-thumb {
    background: var(--text-secondary);
    border-radius: 10px;
    opacity: 0.3;
}

*::-webkit-scrollbar-thumb:hover {
    background: var(--text-primary);
}

* {
    scrollbar-width: thin;
    scrollbar-color: var(--text-secondary) transparent;
}

button {
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    border: none;
    background: none;
    font-family: inherit;
}

input, textarea, select {
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    border: none;
    background: none;
    font-family: inherit;
}

select::-ms-expand {
    display: none;
}

html {
    touch-action: manipulation;
    overscroll-behavior-x: none;
    max-width: 100%;
}

body {
    background-color: #f7f7f8;
    color: #343541;
    height: 100vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

body.dark-theme {
    background-color: #000000dd;
    color: #f5f6ff;
}

.light-theme {
    --bg-primary: #ffffff;
    --bg-secondary: #f7f7f8;
    --bg-tertiary: #ececf1;
    --border-color: #e5e5e6;
    --text-primary: #343541;
    --text-secondary: #6e6e80;
    --accent-color: #10a37f;
    --button-primary-bg: #10a37f;
    --button-primary-text: #ffffff;
    --button-secondary-bg: #ffffff;
    --button-secondary-text: #343541;
}

.dark-theme {
    --bg-primary: #000000;
    --bg-secondary: #000000;
    --bg-tertiary: #19191f;
    --border-color: #222225;
    --text-primary: #ececf1;
    --text-secondary: #a0a0b2;
    --accent-color: #10a37f;
    --button-primary-bg: #10a37f;
    --button-primary-text: #ffffff;
    --button-secondary-bg: #444654;
    --button-secondary-text: #ececf1;
}

.sticky-header {
    position: sticky;
    top: 0;
    z-index: 100;
}

.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    background-color: var(--bg-primary);
    border-bottom: 1px solid var(--border-color);
    height: 60px;
}

.logo {
    display: flex;
    align-items: center;
    font-weight: bold;
    font-size: 18px;
    color: var(--text-primary);
}

.logo svg {
    margin-right: 8px;
    width: 24px;
    height: 24px;
}

.auth-buttons {
    display: flex;
    gap: 12px;
}

.btn {
    padding: 10px 16px;
    border-radius: 6px;
    font-weight: 500;
    font-size: 14px;
    cursor: pointer;
    border: none;
    transition: all 0.2s;
}

.btn-primary {
    background-color: var(--button-primary-bg);
    color: var(--button-primary-text);
}

.btn-secondary {
    background-color: var(--button-secondary-bg);
    color: var(--button-secondary-text);
    border: 1px solid var(--border-color);
}

.btn:hover {
    opacity: 0.9;
}

.sticky-footer {
    position: sticky;
    bottom: 0;
    background: var(--bg-primary);
    z-index: 100;
}

.footer {
    padding: 20px;
    text-align: center;
    font-size: 13px;
    color: var(--text-secondary);
    margin-top: auto;
    position: relative;
    background: linear-gradient(to bottom, transparent, var(--bg-secondary) 50%);
}

.footer::before {
    content: '';
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 60%;
    height: 1px;
    background: linear-gradient(to right, transparent, var(--accent-color), transparent);
    opacity: 0.3;
}

.footer strong {
    color: var(--text-primary);
    font-weight: 600;
    background: linear-gradient(135deg, var(--accent-color), #0d8a6a);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.footer a {
    color: var(--accent-color);
    text-decoration: none;
    transition: all 0.2s;
    font-weight: 500;
}

.footer a:hover {
    text-decoration: underline;
    color: #0d8a6a;
}

.sticky-composer {
    position: sticky;
    bottom: 56px;
    z-index: 99;
    background: transparent;
}

/* Hide any text content from composer */
.composer::before,
.composer::after,
.sticky-composer::before,
.sticky-composer::after,
.centered::before,
.centered::after {
    content: none !important;
    display: none !important;
}

.composer,
.sticky-composer {
    font-size: 0 !important;
}

.composer *,
.sticky-composer * {
    font-size: initial;
}

/* Composer - DeepSeek Style with Center Animation */
.composer {
    width: 100%;
    max-width: 768px;
    margin: 0 auto;
    padding: 16px;
    transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Centered state when empty */


.composer-container {
    background: linear-gradient(135deg, var(--bg-primary) 0%, var(--bg-secondary) 100%);
    border-radius: 24px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.12), 
                0 2px 8px rgba(0, 0, 0, 0.08),
                inset 0 1px 0 rgba(255, 255, 255, 0.1);
    padding: 16px 20px;
    display: flex;
    align-items: center;
    border: 1px solid rgba(255, 255, 255, 0.1);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    backdrop-filter: blur(10px);
}

.dark-theme .composer-container {
    background: linear-gradient(135deg, #2a2a2a 0%, #1f1f1f 100%);
    border: 1px solid rgba(255, 255, 255, 0.05);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3), 
                0 2px 8px rgba(0, 0, 0, 0.2),
                inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

.composer-container:hover {
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.15), 
                0 4px 12px rgba(0, 0, 0, 0.1),
                inset 0 1px 0 rgba(255, 255, 255, 0.15);
    transform: translateY(-2px);
}

.composer-container:focus-within {
    box-shadow: 0 16px 48px rgba(16, 163, 127, 0.2), 
                0 8px 16px rgba(16, 163, 127, 0.15),
                inset 0 1px 0 rgba(255, 255, 255, 0.2);
    transform: translateY(-3px);
    border-color: rgba(16, 163, 127, 0.3);
}

/* Centered state enhancements */
.composer.centered .composer-container {
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.2), 
                0 8px 24px rgba(0, 0, 0, 0.15),
                inset 0 1px 0 rgba(255, 255, 255, 0.15);
}

.composer.centered .composer-container:focus-within {
    box-shadow: 0 24px 72px rgba(16, 163, 127, 0.25), 
                0 12px 32px rgba(16, 163, 127, 0.2),
                inset 0 1px 0 rgba(255, 255, 255, 0.25);
}

.composer-input {
    flex: 1;
    border: none !important;
    outline: none !important;
    box-shadow: none !important;
    padding: 12px;
    font-size: 16px;
    background: transparent;
    color: var(--text-primary);
    resize: none;
    max-height: 200px;
    overflow-y: auto;
    font-family: inherit;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
}

.composer-input:focus {
    border: none !important;
    outline: none !important;
    box-shadow: none !important;
}

.composer-input::placeholder {
    color: var(--text-secondary);
    opacity: 0.7;
}

.composer-input::-webkit-scrollbar {
    width: 6px;
}

.composer-input::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 3px;
}

.composer-actions {
    display: flex;
    gap: 4px;
    align-items: center;
}

.composer-hint {
    position: absolute;
    bottom: -20px;
    right: 16px;
    font-size: 11px;
    color: var(--text-secondary);
    opacity: 0;
    transition: opacity 0.2s;
}

.composer-container:focus-within .composer-hint {
    opacity: 1;
}

.action-button {
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px;
    border-radius: 50%;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
}

.action-button:hover {
    background-color: var(--bg-tertiary);
    transform: scale(1.05);
}

.action-button:active {
    transform: scale(0.95);
}

#sendButton {
    background: var(--accent-color);
    color: white;
    transition: all 0.3s ease;
}

#sendButton:hover {
    background: #0d8a6a;
    transform: scale(1.1);
    box-shadow: 0 4px 12px rgba(16, 163, 127, 0.3);
}

#sendButton svg {
    filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.1));
}

/* Stop button state */
#sendButton.stop-button {
    background: #ff4b5c;
    animation: pulse 1.5s ease-in-out infinite;
}

#sendButton.stop-button:hover {
    background: #e63946;
    transform: scale(1.1);
    box-shadow: 0 4px 12px rgba(255, 75, 92, 0.4);
}

@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.8;
    }
}

.shortcuts-link {
    margin-left: 8px;
    font-size: 12px;
}

.shortcuts-link a {
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    padding: 20px;
    text-align: left;
    overflow-y: auto;
    max-height: calc(100vh - 60px - 56px - 72px);
}

.title {
    font-size: 32px;
    font-weight: 600;
    margin-bottom: 16px;
    text-align: left;
    width: 100%;
}

.subtitle {
    font-size: 16px;
    color: var(--text-secondary);
    max-width: 600px;
    margin-bottom: 40px;
    text-align: left;
    width: 100%;
}

@media (max-width: 768px) {
    .title {
        font-size: 28px;
    }

    .subtitle {
        font-size: 14px;
        padding: 0 16px;
    }

    .composer {
        padding: 8px;
    }

    .auth-buttons {
        display: none;
    }

    .main-content {
        max-height: calc(100vh - 60px - 56px - 60px);
    }
}

/* Menu Overlay */
.menu-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(2px);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s cubic-bezier(0.4, 0, 0.2, 1), 
                visibility 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 9998;
}

.menu-overlay.active {
    opacity: 1;
    visibility: visible;
}

/* Side menu */
.side-menu {
    position: fixed;
    top: 0;
    left: -320px;
    width: 280px;
    height: 100%;
    background: var(--bg-primary);
    box-shadow: 2px 0 8px rgba(0, 0, 0, 0.1);
    transition: left 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 9999;
    display: flex;
    flex-direction: column;
}

.side-menu.open {
    left: 0;
}

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

.menu-sections {
    padding: 16px;
    flex: 1;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.menu-item {
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
    padding: 8px 12px;
    border-radius: 8px;
    transition: background 0.2s;
}

.menu-item:hover {
    background: var(--bg-tertiary);
}

/* Custom Animated Dropdown */
.custom-select {
    position: relative;
    margin-left: auto;
    min-width: 160px;
}

.select-trigger {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 8px 12px;
    background: var(--bg-secondary);
    border: 2px solid var(--border-color);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 13px;
    font-weight: 500;
    color: var(--text-primary);
}

.select-trigger:hover {
    border-color: var(--accent-color);
    background: var(--bg-tertiary);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(16, 163, 127, 0.15);
}

.select-trigger .selected-value {
    flex: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.select-arrow {
    transition: transform 0.3s ease;
    color: var(--text-secondary);
}

.custom-select.open .select-arrow {
    transform: rotate(180deg);
}

.select-dropdown {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    min-width: 280px;
    max-height: 0;
    background: var(--bg-primary);
    border: 2px solid var(--border-color);
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.15);
    overflow: hidden;
    opacity: 0;
    transform: translateY(-10px);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 1000;
    pointer-events: none;
}

.custom-select.open .select-dropdown {
    max-height: 400px;
    opacity: 1;
    transform: translateY(0);
    pointer-events: all;
}

.dropdown-search {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px;
    border-bottom: 1px solid var(--border-color);
    background: var(--bg-secondary);
    position: sticky;
    top: 0;
    z-index: 10;
}

.dropdown-search svg {
    color: var(--text-secondary);
    flex-shrink: 0;
}

.dropdown-search-input {
    flex: 1;
    border: none;
    outline: none;
    background: transparent;
    color: var(--text-primary);
    font-size: 13px;
    font-family: inherit;
}

.dropdown-search-input::placeholder {
    color: var(--text-secondary);
}

.dropdown-options {
    max-height: 320px;
    overflow-y: auto;
    padding: 8px;
}

.dropdown-options::-webkit-scrollbar {
    width: 6px;
}

.dropdown-options::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 3px;
}

.dropdown-options::-webkit-scrollbar-thumb:hover {
    background: var(--text-secondary);
}

.option-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 12px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
    animation: slideIn 0.3s ease;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateX(-10px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.option-item:hover {
    background: var(--bg-tertiary);
    transform: translateX(4px);
}

.option-item.selected {
    background: var(--bg-tertiary);
    border-left: 3px solid var(--accent-color);
    padding-left: 9px;
}

.option-item.hidden {
    display: none;
}

.option-label {
    flex: 1;
    font-size: 14px;
    font-weight: 500;
    color: var(--text-primary);
}

.option-badge {
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.option-badge.nano {
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
}

.option-badge.mini {
    background: linear-gradient(135deg, #f093fb, #f5576c);
    color: white;
}

.option-badge.standard {
    background: linear-gradient(135deg, #4facfe, #00f2fe);
    color: white;
}

.option-badge.latest {
    background: linear-gradient(135deg, #43e97b, #38f9d7);
    color: #000;
}

.option-badge.preview {
    background: linear-gradient(135deg, #fa709a, #fee140);
    color: #000;
}

.option-badge.pro {
    background: linear-gradient(135deg, #ff6b6b, #feca57);
    color: white;
}

.option-check {
    color: var(--accent-color);
    opacity: 0;
    transition: opacity 0.2s;
}

.option-item.selected .option-check {
    opacity: 1;
    animation: checkPop 0.3s ease;
}

@keyframes checkPop {
    0% {
        transform: scale(0);
    }
    50% {
        transform: scale(1.2);
    }
    100% {
        transform: scale(1);
    }
}

/* Model switch positioning */
.model-switch {
    position: relative;
    flex-direction: row !important;
}

.model-switch select {
    margin-left: auto;
    border-radius: 6px;
    border: 1px solid var(--border-color);
    padding: 4px 8px;
    background: var(--bg-primary);
    color: var(--text-primary);
}

/* Search Section - Google Style */
.search-section {
    margin-bottom: 12px;
    animation: searchSlideIn 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

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

.search-container {
    position: relative;
    display: flex;
    align-items: center;
    background: var(--bg-tertiary);
    border: 1.5px solid transparent;
    border-radius: 24px;
    padding: 10px 16px;
    gap: 10px;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

.search-container:focus-within {
    background: var(--bg-primary);
    border-color: var(--accent-color);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12), 0 0 0 3px rgba(16, 163, 127, 0.1);
    transform: translateY(-1px);
}

.dark-theme .search-container:focus-within {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3), 0 0 0 3px rgba(16, 163, 127, 0.15);
}

.search-input {
    flex: 1;
    outline: none;
    border: none;
    background: transparent;
    color: var(--text-primary);
    font-size: 15px;
    font-weight: 400;
    padding: 0;
    line-height: 1.5;
}

.search-input::placeholder {
    color: var(--text-secondary);
    opacity: 0.7;
    transition: opacity 0.2s ease;
}

.search-input:focus::placeholder {
    opacity: 0.5;
}

.search-icon {
    width: 20px;
    height: 20px;
    color: var(--text-secondary);
    flex-shrink: 0;
    transition: all 0.25s ease;
}

.search-container:focus-within .search-icon {
    color: var(--accent-color);
    transform: scale(1.05);
}

.close-search-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    padding: 0;
    border: none;
    background: transparent;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    opacity: 0.7;
}

.close-search-btn:hover {
    background: var(--bg-hover);
    opacity: 1;
    transform: scale(1.1);
}

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

.close-search-icon {
    width: 18px;
    height: 18px;
    color: var(--text-secondary);
    transition: color 0.2s ease;
}

.close-search-btn:hover .close-search-icon {
    color: var(--text-primary);
}

/* Projects Section - Full Page View */
.projects-section {
    position: fixed;
    top: 0;
    left: 280px;
    right: 0;
    bottom: 0;
    background: var(--bg-primary);
    z-index: 1000;
    overflow-y: auto;
    animation: slideInRight 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    padding: 40px;
}

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

@media (max-width: 768px) {
    .projects-section {
        left: 0;
        padding: 20px;
    }
}

.projects-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 32px;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--border-color);
}

.projects-header h3 {
    font-size: 28px;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0;
}

.new-project-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    border: 1.5px solid var(--border-color);
    background: var(--bg-primary);
    border-radius: 8px;
    cursor: pointer;
    color: var(--text-primary);
    font-size: 14px;
    font-weight: 500;
    transition: all 0.2s ease;
}

.new-project-btn:hover {
    background: var(--bg-tertiary);
    border-color: var(--accent-color);
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.new-project-btn:active {
    transform: translateY(0);
}

.projects-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 16px;
    padding: 0;
}

.project-item {
    display: flex;
    flex-direction: column;
    padding: 24px;
    border: 1.5px solid var(--border-color);
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.25s ease;
    position: relative;
    background: var(--bg-primary);
}

.project-item:hover {
    border-color: var(--accent-color);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.project-item.active {
    border-color: var(--accent-color);
    background: var(--bg-tertiary);
}

.project-icon {
    width: 48px;
    height: 48px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    flex-shrink: 0;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    margin-bottom: 16px;
}

.project-icon.blue {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.project-icon.green {
    background: linear-gradient(135deg, #10a37f 0%, #0d8a6a 100%);
}

.project-icon.orange {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
}

.project-icon.pink {
    background: linear-gradient(135deg, #fa709a 0%, #fee140 100%);
}

.project-info {
    flex: 1;
    min-width: 0;
}

.project-name {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.project-meta {
    font-size: 13px;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
}

.project-chat-count {
    display: flex;
    align-items: center;
    gap: 4px;
}

.project-actions {
    display: flex;
    gap: 8px;
    margin-top: auto;
    padding-top: 16px;
    border-top: 1px solid var(--border-color);
}

.add-to-project-btn {
    flex: 1;
    padding: 8px 12px;
    background: var(--accent-color);
    color: white;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.add-to-project-btn:hover {
    background: #0d8a6a;
    transform: scale(1.02);
}

.project-action-btn {
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    background: transparent;
    border-radius: 6px;
    cursor: pointer;
    color: var(--text-secondary);
    transition: all 0.2s ease;
}

.project-action-btn:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

.conversation-list .conversation-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 12px;
    margin-bottom: 4px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
    overflow: hidden;
}

.conversation-item::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    height: 100%;
    width: 3px;
    background: var(--accent-color);
    transform: scaleY(0);
    transition: transform 0.2s ease;
}

.conversation-item:hover {
    background: var(--bg-tertiary);
    transform: translateX(2px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

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

.conversation-item:active {
    transform: translateX(1px) scale(0.98);
}

.conversation-item.active {
    background: var(--bg-tertiary);
    border-left: 3px solid var(--accent-color);
    padding-left: 9px;
}

.conversation-item.active .conv-title {
    color: var(--accent-color);
    font-weight: 600;
}

.conv-title {
    color: var(--text-primary);
    font-weight: 500;
    font-size: 14px;
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    padding-right: 8px;
    transition: color 0.2s;
}

.conversation-item:hover .conv-title {
    color: var(--accent-color);
}

.conv-actions {
    display: flex;
    align-items: center;
    gap: 6px;
    opacity: 0;
    transition: opacity 0.2s;
}

.conversation-item:hover .conv-actions {
    opacity: 1;
}

.conv-actions button {
    background: none;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    padding: 6px;
    border-radius: 6px;
    transition: all 0.2s;
}

.conv-actions button:hover {
    background: var(--bg-primary);
    transform: scale(1.1);
}

.rename-btn svg {
    stroke: #10a37f;
}

.delete-btn svg {
    stroke: #ff4b5c;
}

.conv-rename-input {
    font-size: 14px;
    padding: 2px 6px;
    border: 1px solid #10a37f;
    border-radius: 4px;
    background: var(--bg-tertiary);
    color: var(--text-primary);
    margin-right: 4px;
    width: 140px;
}

.save-btn svg {
    stroke: #10a37f;
}

.cancel-btn svg {
    stroke: #ff4b5c;
}

/* Delete dialog */
.delete-dialog {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    justify-content: center;
    align-items: center;
    z-index: 99999;
}

.delete-dialog.open {
    display: flex;
}

.delete-dialog .dialog-content {
    background: var(--bg-primary);
    padding: 24px;
    border-radius: 12px;
    text-align: center;
    max-width: 300px;
}

.dialog-buttons {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    margin-top: 16px;
}

.btn-green {
    background: #10a37f;
    color: #fff;
}

.btn-red {
    background: #ff4b5c;
    color: #fff;
}

.hidden {
    display: none !important;
}

#menuSearchSection {
    transition: all 0.3s ease;
}

.chat-message {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    word-break: break-word;
    box-shadow: rgba(0, 0, 0, 0.05);
}

/* Bot Message - ChatGPT Style */
.bot-message {
    align-self: flex-start;
    background: none;
    color: var(--text-primary);
    padding: 0;
    margin: 20px 0;
    border-radius: 0;
    box-shadow: none;
    max-width: 100%;
    width: 100%;
    font-size: 15px;
    line-height: 1.7;
    text-align: left;
    word-break: break-word;
    display: flex;
    position: relative;
    font-weight: 400;
}


.bot-content {
    flex: 1;
    padding: 0;
    padding-top: 4px;
}

/* Bot message on mobile */
@media (max-width: 768px) {
    .bot-message {
        font-size: 14px;
        margin: 16px 0;
        gap: 10px;
    }
    
}

/* ===== Markdown Styling ===== */

/* Inline Code */
.inline-code {
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: 4px;
    padding: 2px 6px;
    font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
    font-size: 0.9em;
    color: #e06c75;
    font-weight: 500;
}

/* Code Blocks */
.markdown-code-block {
    margin: 16px 0;
    background: #1e1e1e;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
    border: 1px solid #333;
}

.code-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 16px;
    background: #2d2d2d;
    border-bottom: 1px solid #404040;
}

.code-language {
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    color: #61afef;
    letter-spacing: 0.5px;
}

.code-actions {
    display: flex;
    gap: 8px;
}

.code-action-btn {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 4px 10px;
    background: transparent;
    border: 1px solid #404040;
    border-radius: 6px;
    color: #abb2bf;
    font-size: 11px;
    cursor: pointer;
    transition: all 0.2s;
}

.code-action-btn:hover {
    background: #3e3e3e;
    border-color: #61afef;
    color: #61afef;
    transform: translateY(-1px);
}

.code-action-btn.success {
    border-color: #98c379;
    color: #98c379;
}

.code-action-btn svg {
    width: 14px;
    height: 14px;
}

.markdown-code-block pre {
    margin: 0;
    padding: 16px;
    font-size: 14px;
    font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
    line-height: 1.6;
    background: #1e1e1e;
    color: #f8f8f2;
    overflow-x: auto;
}

.markdown-code-block pre::-webkit-scrollbar {
    height: 8px;
}

.markdown-code-block pre::-webkit-scrollbar-thumb {
    background: #404040;
    border-radius: 4px;
}

.markdown-code-block pre::-webkit-scrollbar-thumb:hover {
    background: #505050;
}

.code-preview {
    padding: 16px;
    background: white;
    border-top: 1px solid #404040;
    min-height: 100px;
    max-height: 400px;
    overflow: auto;
}

/* Headers */
.markdown-h1 {
    font-size: 2em;
    font-weight: 700;
    margin: 24px 0 16px 0;
    color: var(--text-primary);
    border-bottom: 2px solid var(--accent-color);
    padding-bottom: 8px;
}

.markdown-h2 {
    font-size: 1.75em;
    font-weight: 600;
    margin: 20px 0 14px 0;
    color: var(--text-primary);
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 6px;
}

.markdown-h3 {
    font-size: 1.5em;
    font-weight: 600;
    margin: 18px 0 12px 0;
    color: var(--text-primary);
}

.markdown-h4 {
    font-size: 1.25em;
    font-weight: 600;
    margin: 16px 0 10px 0;
    color: var(--text-primary);
}

.markdown-h5 {
    font-size: 1.1em;
    font-weight: 600;
    margin: 14px 0 8px 0;
    color: var(--text-primary);
}

.markdown-h6 {
    font-size: 1em;
    font-weight: 600;
    margin: 12px 0 6px 0;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Paragraphs */
.markdown-p {
    margin: 12px 0;
    line-height: 1.7;
    color: var(--text-primary);
}

/* Blockquotes */
.markdown-quote {
    margin: 16px 0;
    padding: 12px 16px;
    border-left: 4px solid var(--accent-color);
    background: var(--bg-secondary);
    border-radius: 4px;
    font-style: italic;
    color: var(--text-secondary);
}

/* Lists */
.markdown-ul {
    margin: 12px 0;
    padding-left: 24px;
    list-style: none;
}

.markdown-li {
    margin: 8px 0;
    padding-left: 8px;
    position: relative;
    color: var(--text-primary);
    line-height: 1.6;
}

.markdown-li::before {
    content: "•";
    color: var(--accent-color);
    font-weight: bold;
    font-size: 1.2em;
    position: absolute;
    left: -16px;
}

.markdown-ol {
    margin: 12px 0;
    padding-left: 24px;
    list-style: none;
    counter-reset: item;
}

.markdown-li-ordered {
    margin: 8px 0;
    padding-left: 8px;
    position: relative;
    color: var(--text-primary);
    line-height: 1.6;
    counter-increment: item;
}

.markdown-li-ordered::before {
    content: counter(item) ".";
    color: var(--accent-color);
    font-weight: 600;
    position: absolute;
    left: -24px;
}

/* Links */
.markdown-link {
    color: var(--accent-color);
    text-decoration: none;
    border-bottom: 1px solid transparent;
    transition: all 0.2s;
    font-weight: 500;
}

.markdown-link:hover {
    border-bottom-color: var(--accent-color);
    opacity: 0.8;
}

/* Images */
.markdown-image {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    margin: 16px 0;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

/* Horizontal Rule */
.markdown-hr {
    margin: 24px 0;
    border: none;
    height: 2px;
    background: linear-gradient(to right, transparent, var(--accent-color), transparent);
    opacity: 0.3;
}

/* Bold */
strong {
    font-weight: 600;
    color: var(--text-primary);
}

/* Italic */
em {
    font-style: italic;
    color: var(--text-primary);
}

/* Strikethrough */
del {
    text-decoration: line-through;
    opacity: 0.7;
}

/* Old code block styles (fallback) */
.code-block-container {
    margin: 10px 0;
    background: #18181a;
    border-radius: 8px;
    overflow-x: auto;
    box-shadow: 0 1px 8px rgba(0, 0, 0, 0.07);
    position: relative;
    padding: 14px 14px 10px 14px;
}

.code-block-container pre {
    margin: 0;
    font-size: 15px;
    font-family: 'Fira Mono', 'Menlo', 'Consolas', monospace;
    background: none;
    color: #f6f8fa;
}

.code-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    position: absolute;
    top: 6px;
    right: 14px;
    z-index: 2;
}

.code-copy-btn,
.code-copied-btn {
    background: none;
    border: none;
    color: #c9d1d9;
    font-size: 13px;
    display: flex;
    align-items: center;
    cursor: pointer;
    gap: 6px;
    padding: 2px 7px;
    border-radius: 5px;
    transition: background 0.2s;
}

.code-copy-btn:hover {
    background: #282828;
}

.code-copied-btn {
    color: #10a37f;
    background: #111e18;
}

.code-copy-btn svg,
.code-copied-btn svg {
    width: 18px;
    height: 18px;
}

.response-actions {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-top: 7px;
    margin-left: -2px;
}

.response-actions button {
    background: none;
    border: none;
    cursor: pointer;
    color: #6e6e80;
    display: flex;
    align-items: center;
    padding: 4px 7px;
    border-radius: 6px;
    transition: background 0.2s;
    position: relative;
}

.response-actions button.selected svg {
    fill: #10a37f !important;
    stroke: #10a37f !important;
}

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

.response-actions .action-copy svg,
.response-actions .action-edit svg {
    width: 16px;
    height: 16px;
}

.response-actions .action-regenerate {
    opacity: 0.8;
    cursor: pointer;
    transition: all 0.2s ease;
}

.response-actions .action-regenerate:hover {
    opacity: 1;
    background: var(--bg-tertiary);
}

.response-actions .action-regenerate:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Spinning animation for regenerate */
@keyframes spin {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

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

/* Enhanced like/dislike buttons */
.action-like.selected svg,
.action-dislike.selected svg {
    fill: currentColor;
}

.action-like.selected {
    color: #10a37f;
}

.action-dislike.selected {
    color: #ff4b5c;
}

.bot-message strong {
    font-weight: bold;
    color: #10a37f;
}

/* User Message - ChatGPT Style */
.user-message {
    align-self: flex-end;
    background: var(--bg-secondary);
    color: var(--text-primary);
    margin: 16px 0;
    padding: 16px 20px;
    border-radius: 18px;
    text-align: start;
    position: relative;
    font-weight: 400;
    font-size: 15px;
    line-height: 1.6;
    max-width: 80%;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
    border: 1px solid var(--border-color);
    word-wrap: break-word;
    overflow-wrap: break-word;
    transition: all 0.2s ease;
}


.dark-theme .user-message {
    background: #2f2f2f;
    border-color: #404040;
}

.user-message:hover {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

/* User message on mobile */
@media (max-width: 768px) {
    .user-message {
        max-width: 90%;
        font-size: 14px;
        padding: 14px 16px;
    }
}

/* User message formatting */
.user-message strong {
    font-weight: 600;
    color: var(--text-primary);
}

.user-message code {
    background: var(--bg-tertiary);
    padding: 2px 6px;
    border-radius: 4px;
    font-family: 'Consolas', 'Monaco', monospace;
    font-size: 13px;
    color: var(--accent-color);
}

.user-message a {
    color: var(--accent-color);
    text-decoration: underline;
}

.user-message .response-actions {
    margin-top: 8px;
    opacity: 0;
    transition: opacity 0.2s ease;
}

.user-message:hover .response-actions {
    opacity: 1;
}

.action-bubble {
    position: fixed;
    left: 50%;
    top: 70px;
    transform: translateX(-50%);
    background: #222;
    color: #fff;
    padding: 9px 20px;
    font-size: 15px;
    border-radius: 9px;
    box-shadow: 0 2px 16px rgba(0, 0, 0, 0.10);
    z-index: 10000;
    display: none;
    opacity: 0.96;
    pointer-events: none;

}

.typing-indicator {
    margin-right: 8px;
    display: flex;
    align-items: center;
}

.typing-dots {
    display: inline-block;
    vertical-align: middle;
    width: 30px;
    height: 16px;
}

.typing-dot {
    fill: #10a37f;
    opacity: 0.6;
    animation: typingBounce 1s infinite;
}

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

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

@keyframes typingBounce {

    0%,
    80%,
    100% {
        transform: translateY(0);
        opacity: .6;
    }

    40% {
        transform: translateY(-6px);
        opacity: 1;
    }
}

button,
a {
    -webkit-tap-highlight-color: transparent;
    /* remove blue highlight */
}




/* Xcode Style Window */
.xcode-window {
    border-radius: 8px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
    font-family: -apple-system, sans-serif;
    margin: 10px 0;
    overflow: hidden;
    width: 100%;
}

.xcode-titlebar {
    background: #000000;
    padding: 8px 20px;
    display: flex;
    align-items: center;
}

.xcode-buttons {
    display: flex;
    gap: 8px;
}

.xcode-btn {
    width: 12px;
    height: 12px;
    border-radius: 50%;
}

.xcode-btn-close {
    background: #ff5f56;
}

.xcode-btn-min {
    background: #ffbd2e;
}

.xcode-btn-max {
    background: #27c93f;
}

.xcode-filename {
    color: #ffffff;
    margin-left: 15px;
    font-size: 12px;
}

.xcode-editor {
    background: #000000;
    padding: 15px;
    text-align: left !important;
    overflow-x: auto;
    font-family: monospace;
    font-size: 14px;
    width: 100%;
}

/* Theme support */
.dark-theme .bot-code {
    background-color: #000000;
    border-radius: 12px;
}

.light-theme .bot-code {
    background-color: #e9e9e9;
    border-radius: 12px;
}

/* Responsive tweaks */
@media only screen and (max-width: 508px) {
    .xcode-filename {
        font-size: 10px;
    }

    .chat-main {
        overflow-x: hidden
    }

    .xcode-window {
        /* max-width: 320px; */
        width: 350px;
    }

    .user-actions {
        margin-bottom: 10px;
    }
}

@media only screen and (max-width: 608px) {
    .xcode-filename {
        font-size: 10px;
    }

    .chat-main {
        overflow-x: hidden
    }

    .xcode-window {
        max-width: 400px;
    }

    .user-actions {
        margin-bottom: 10px;
    }
}

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

.settings-modal.open {
    display: flex;
}

.settings-content {
    background: var(--bg-primary);
    border-radius: 16px;
    max-width: 640px;
    width: 90%;
    max-height: 85vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    animation: slideUp 0.3s ease;
}

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

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

.settings-header h2 {
    font-size: 24px;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0;
}

.settings-body {
    overflow-y: auto;
    padding: 24px;
    flex: 1;
}

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

.settings-section:last-child {
    margin-bottom: 0;
}

.settings-section-title {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 18px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 16px;
}

.settings-section-title svg {
    color: var(--accent-color);
    stroke: var(--accent-color);
}

.settings-option {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px;
    background: var(--bg-secondary);
    border-radius: 12px;
    margin-bottom: 12px;
    transition: background 0.2s;
}

.settings-option:hover {
    background: var(--bg-tertiary);
}

.option-info {
    flex: 1;
}

.option-info label {
    display: block;
    font-size: 15px;
    font-weight: 500;
    color: var(--text-primary);
    margin-bottom: 4px;
    cursor: pointer;
}

.option-description {
    display: block;
    font-size: 13px;
    color: var(--text-secondary);
}

.settings-select {
    padding: 8px 12px;
    border-radius: 8px;
    border: 1px solid var(--border-color);
    background: var(--bg-primary);
    color: var(--text-primary);
    font-size: 14px;
    cursor: pointer;
    transition: border-color 0.2s;
}

.settings-select:hover {
    border-color: var(--accent-color);
}

.settings-select:focus {
    outline: none;
    border-color: var(--accent-color);
}

/* Toggle Switch */
.toggle-switch {
    position: relative;
    display: inline-block;
    width: 48px;
    height: 26px;
    cursor: pointer;
}

.toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.toggle-slider {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: var(--border-color);
    border-radius: 26px;
    transition: 0.3s;
}

.toggle-slider:before {
    position: absolute;
    content: "";
    height: 20px;
    width: 20px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    border-radius: 50%;
    transition: 0.3s;
}

.toggle-switch input:checked + .toggle-slider {
    background-color: var(--accent-color);
}

.toggle-switch input:checked + .toggle-slider:before {
    transform: translateX(22px);
}

.small-btn {
    padding: 8px 16px;
    font-size: 13px;
    white-space: nowrap;
}

.settings-info {
    padding: 16px;
    background: var(--bg-secondary);
    border-radius: 12px;
    line-height: 1.6;
}

.settings-info p {
    margin: 4px 0;
    color: var(--text-secondary);
}

.settings-info strong {
    color: var(--text-primary);
}

@media (max-width: 768px) {
    .settings-content {
        width: 95%;
        max-height: 90vh;
    }

    .settings-header {
        padding: 20px;
    }

    .settings-body {
        padding: 20px;
    }

    .settings-option {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }

    .settings-select,
    .toggle-switch,
    .small-btn {
        align-self: flex-end;
    }
}

@media (min-width: 1024px) {
    body {
        padding-left: 280px;
    }

    .side-menu {
        left: 0;
        border-right: 1px solid var(--border-color);
        box-shadow: none;
    }

    #menuButton {
        display: none;
    }

    #closeMenu {
        display: none;
    }

    .main-content {
        align-items: stretch;
        padding: 24px 32px;
    }

    .chat-main > * {
        max-width: 768px;
        width: 100%;
        margin-left: auto;
        margin-right: auto;
    }

    .composer {
        max-width: 768px;
    }
}