* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: #1a1a1a;
    color: #ffffff;
    height: 100vh;
    overflow: hidden;
}

.container {
    display: flex;
    height: 100vh;
}

/* Sidebar */
.sidebar {
    width: 280px;
    background: #1e1e1e;
    border-right: 1px solid #333;
    display: flex;
    flex-direction: column;
    transition: transform 0.3s ease;
}

.sidebar.collapsed {
    transform: translateX(-280px);
}

.sidebar-header {
    padding: 16px;
    border-bottom: 1px solid #333;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.new-chat-btn {
    background: #00d4ff;
    border: none;
    color: #000;
    padding: 10px 16px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    flex: 1;
    margin-right: 8px;
    transition: all 0.2s;
}

.new-chat-btn:hover {
    background: #00b8e6;
}

.sidebar-toggle {
    background: transparent;
    border: 1px solid #333;
    color: #888;
    padding: 8px;
    border-radius: 6px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
}

.sidebar-toggle:hover {
    border-color: #555;
    color: #fff;
}

.chat-list {
    flex: 1;
    overflow-y: auto;
    padding: 8px;
}

.chat-item {
    padding: 12px;
    margin-bottom: 4px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
    border: 1px solid transparent;
    position: relative;
}

.chat-item:hover {
    background: #2a2a2a;
}

.chat-item.active {
    background: #333;
    border-color: #00d4ff;
}

.chat-item-title {
    font-size: 14px;
    color: #fff;
    margin-bottom: 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.chat-item-meta {
    font-size: 12px;
    color: #666;
    display: flex;
    justify-content: space-between;
}

.chat-item-actions {
    position: absolute;
    top: 8px;
    right: 8px;
    opacity: 0;
    transition: opacity 0.2s;
}

.chat-item:hover .chat-item-actions {
    opacity: 1;
}

.chat-action-btn {
    background: transparent;
    border: none;
    color: #666;
    padding: 4px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 12px;
    margin-left: 4px;
}

.chat-action-btn:hover {
    color: #fff;
    background: #444;
}

.sidebar-footer {
    padding: 16px;
    border-top: 1px solid #333;
}

.sidebar-footer .user-info {
    font-size: 12px;
    color: #888;
    margin-top: 8px;
    text-align: center;
}

/* Main Area - removed duplicate */

/* Header */
.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 24px;
    background: #1a1a1a;
    border-bottom: 1px solid #333;
}

.logo {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 600;
    font-size: 14px;
    letter-spacing: 1px;
}

.logo i {
    font-size: 18px;
    color: #00d4ff;
}

.header-actions {
    display: flex;
    gap: 12px;
    align-items: center;
}

.chat-title {
    font-size: 16px;
    font-weight: 600;
    color: #fff;
    margin-left: 16px;
}

.user-info {
    font-size: 12px;
    color: #888;
    margin-left: 8px;
}

.btn-secondary {
    background: transparent;
    border: 1px solid #444;
    color: #ffffff;
    padding: 8px 16px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-secondary:hover {
    border-color: #666;
}

.btn-primary {
    background: #00d4ff;
    border: none;
    color: #000;
    padding: 8px 16px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-primary:hover {
    background: #00b8e6;
}

/* Main Content */
.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.chat-container {
    flex: 1;
    overflow-y: auto;
    padding: 24px;
    display: flex;
    flex-direction: column;
    gap: 24px;
}

/* Messages */
.welcome-message, .message {
    display: flex;
    gap: 16px;
    max-width: 800px;
    margin: 0 auto;
    width: 100%;
}

.ai-avatar {
    width: 32px;
    height: 32px;
    background: #333;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.ai-avatar i {
    color: #00d4ff;
    font-size: 16px;
}

.user-avatar {
    width: 32px;
    height: 32px;
    background: #00d4ff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.user-avatar i {
    color: #000;
    font-size: 16px;
}

.message-content {
    flex: 1;
}

.message-header {
    margin-bottom: 8px;
}

.ai-name {
    font-size: 14px;
    color: #888;
    font-weight: 500;
}

.message-text {
    font-size: 15px;
    line-height: 1.6;
    margin-bottom: 12px;
    white-space: pre-wrap;
}

.copy-btn {
    background: transparent;
    border: 1px solid #333;
    color: #888;
    padding: 6px 12px;
    border-radius: 4px;
    font-size: 12px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: all 0.2s;
}

.copy-btn:hover {
    border-color: #555;
    color: #fff;
}

/* Input Area */
.input-area {
    padding: 24px;
    background: #1a1a1a;
    border-top: 1px solid #333;
}

.model-selector {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 16px;
    justify-content: center;
}

.status-indicator {
    color: #00ff88;
    font-size: 8px;
}

.model-info {
    font-size: 12px;
    color: #888;
    font-weight: 500;
}

.input-container {
    max-width: 800px;
    margin: 0 auto;
}

.input-wrapper {
    position: relative;
    background: #2a2a2a;
    border: 1px solid #333;
    border-radius: 12px;
    padding: 20px 60px 20px 20px;
    transition: border-color 0.2s;
}

.input-wrapper:focus-within {
    border-color: #00d4ff;
}

#messageInput {
    width: 100%;
    background: transparent;
    border: none;
    color: #ffffff;
    font-size: 15px;
    resize: none;
    outline: none;
    min-height: 34px;
    max-height: 130px;
}

#messageInput::placeholder {
    color: #666;
}

.send-btn {
    position: absolute;
    right: 16px;
    top: 50%;
    transform: translateY(-50%);
    background: #00d4ff;
    border: none;
    color: #000;
    width: 32px;
    height: 32px;
    border-radius: 6px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.send-btn:hover {
    background: #00b8e6;
}

.send-btn:disabled {
    background: #333;
    color: #666;
    cursor: not-allowed;
}

.model-dropdown {
    max-width: 800px;
    margin: 16px auto 0;
}

#modelSelect {
    background: #2a2a2a;
    border: 1px solid #333;
    color: #ffffff;
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 12px;
    cursor: pointer;
    width: 200px;
}

#modelSelect:focus {
    outline: none;
    border-color: #00d4ff;
}

/* Loading Animation */
.typing-indicator {
    display: flex;
    gap: 4px;
    padding: 8px 0;
}

.typing-dot {
    width: 6px;
    height: 6px;
    background: #666;
    border-radius: 50%;
    animation: typing 1.4s infinite;
}

.typing-dot:nth-child(2) {
    animation-delay: 0.2s;
}

.typing-dot:nth-child(3) {
    animation-delay: 0.4s;
}

@keyframes typing {
    0%, 60%, 100% {
        opacity: 0.3;
    }
    30% {
        opacity: 1;
    }
}

/* Global Scrollbar Styles */
* {
    scrollbar-width: thin;
    scrollbar-color: #444 #1a1a1a;
}

/* Webkit Scrollbar (Chrome, Safari, Edge) */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: #1a1a1a;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb {
    background: #444;
    border-radius: 4px;
    border: 1px solid #333;
    transition: background 0.2s ease;
}

::-webkit-scrollbar-thumb:hover {
    background: #555;
}

::-webkit-scrollbar-thumb:active {
    background: #00d4ff;
}

::-webkit-scrollbar-corner {
    background: #1a1a1a;
}

/* Chat Container Specific Scrollbar */
.chat-container::-webkit-scrollbar {
    width: 6px;
}

.chat-container::-webkit-scrollbar-track {
    background: transparent;
}

.chat-container::-webkit-scrollbar-thumb {
    background: #333;
    border-radius: 3px;
    border: none;
}

.chat-container::-webkit-scrollbar-thumb:hover {
    background: #444;
}

/* Sidebar Scrollbar */
.chat-list::-webkit-scrollbar {
    width: 4px;
}

.chat-list::-webkit-scrollbar-track {
    background: transparent;
}

.chat-list::-webkit-scrollbar-thumb {
    background: #333;
    border-radius: 2px;
}

.chat-list::-webkit-scrollbar-thumb:hover {
    background: #444;
}

/* Chat List Styles */
.chat-info {
    flex: 1;
}

.chat-title {
    font-size: 14px;
    color: #fff;
    margin-bottom: 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.chat-date {
    font-size: 12px;
    color: #666;
}

.delete-chat-btn {
    background: transparent;
    border: none;
    color: #666;
    padding: 4px 6px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 12px;
    opacity: 0;
    transition: all 0.2s;
}

.chat-item:hover .delete-chat-btn {
    opacity: 1;
}

.delete-chat-btn:hover {
    color: #ff4444;
    background: rgba(255, 68, 68, 0.1);
}

/* Main Area */
.main-area {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}
    
    .main-area {
        width: 100%;
    }
    
    .header {
        padding: 12px 16px;
    }
    
    .chat-container {
        padding: 16px;
    }
    
    .input-area {
        padding: 16px;
    }
    
    .welcome-message, .message {
        gap: 12px;
    }
    
    .input-wrapper {
        padding: 12px 50px 12px 16px;
    }
    
    .send-btn {
        right: 12px;
        width: 28px;
        height: 28px;
    }
    
    .new-chat-btn {
        font-size: 12px;
        padding: 8px 12px;
    }
    
    .chat-title {
        font-size: 14px;
    }
}

/* Sidebar Toggle Fix */
.sidebar.active {
    transform: translateX(0);
}

@media (max-width: 768px) {
    .sidebar {
        position: fixed;
        top: 0;
        left: 0;
        height: 100vh;
        z-index: 1000;
        transform: translateX(-280px);
    }
    
    .main-area {
        width: 100%;
    }
}/* Mod
al Styles */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 2000;
    backdrop-filter: blur(4px);
}

.modal-overlay.show {
    display: flex;
}

.modal {
    background: #2a2a2a;
    border-radius: 12px;
    border: 1px solid #444;
    min-width: 400px;
    max-width: 500px;
    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);
    }
}

.modal-header {
    padding: 20px 24px 16px;
    border-bottom: 1px solid #444;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h3 {
    margin: 0;
    color: #fff;
    font-size: 18px;
    font-weight: 600;
}

.modal-close {
    background: transparent;
    border: none;
    color: #888;
    font-size: 18px;
    cursor: pointer;
    padding: 4px;
    border-radius: 4px;
    transition: all 0.2s;
}

.modal-close:hover {
    color: #fff;
    background: #444;
}

.modal-body {
    padding: 20px 24px;
}

.modal-body p {
    margin: 0;
    color: #ccc;
    line-height: 1.5;
    font-size: 15px;
}

.modal-footer {
    padding: 16px 24px 20px;
    display: flex;
    gap: 12px;
    justify-content: flex-end;
}

.btn-danger {
    background: #ff4444;
    border: none;
    color: #fff;
    padding: 10px 20px;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-danger:hover {
    background: #ff3333;
}

.btn-danger:active {
    transform: translateY(1px);
}

/* Mobile Modal */
@media (max-width: 768px) {
    .modal {
        min-width: 320px;
        margin: 20px;
    }
    
    .modal-header {
        padding: 16px 20px 12px;
    }
    
    .modal-body {
        padding: 16px 20px;
    }
    
    .modal-footer {
        padding: 12px 20px 16px;
    }
}