* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

:root {
    --primary: #ffcc00;
    --primary-dark: #e6b800;
    --primary-light: #ffdd4d;
    --bg-dark: #0a0a0a;
    --bg-card: #1a1a1a;
    --bg-input: #2d2d2d;
    --bg-hover: #333;
    --text: #fff;
    --text-muted: #b3b3b3;
    --border: #404040;
    --radius: 12px;
    --radius-sm: 8px;
    --shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

html {
    font-size: 16px;
    height: 100%;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--bg-dark);
    color: var(--text);
    line-height: 1.5;
    height: 100%;
    overflow: hidden;
}
/* Custom Dialog Styles */
.dialog-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 99999;
    padding: 20px;
    animation: fadeIn 0.2s ease;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.dialog-container {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    width: 100%;
    max-width: 400px;
    border: 1px solid var(--border);
    box-shadow: var(--shadow-lg);
    animation: slideUp 0.3s ease;
    overflow: hidden;
}

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

.dialog-header {
    padding: 20px 24px;
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: rgba(255, 204, 0, 0.1);
}

.dialog-title {
    font-size: 18px;
    font-weight: 600;
    color: var(--primary);
    margin: 0;
}

.dialog-close {
    background: none;
    border: none;
    color: var(--text-muted);
    width: 32px;
    height: 32px;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.dialog-close:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

.dialog-body {
    padding: 24px;
}

.dialog-message {
    color: var(--text-primary);
    font-size: 16px;
    line-height: 1.5;
    margin: 0;
    text-align: center;
}

.dialog-footer {
    padding: 20px 24px;
    border-top: 1px solid var(--border);
    display: flex;
    gap: 12px;
    justify-content: flex-end;
    background: rgba(255, 255, 255, 0.02);
}

.dialog-btn {
    padding: 10px 24px;
    border: none;
    border-radius: var(--radius-sm);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition-fast);
    min-width: 80px;
    text-align: center;
}

.dialog-btn-cancel {
    background: var(--bg-input);
    color: var(--text-primary);
    border: 1px solid var(--border);
}

.dialog-btn-cancel:hover {
    background: var(--bg-hover);
}

.dialog-btn-confirm {
    background: linear-gradient(135deg, var(--primary), var(--primary-light));
    color: #000;
    font-weight: 600;
}

.dialog-btn-confirm:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.dialog-btn-confirm.danger {
    background: linear-gradient(135deg, #ff4444, #ff6666);
    color: white;
}

.dialog-btn-confirm.warning {
    background: linear-gradient(135deg, #ffaa00, #ffcc44);
    color: #000;
}

.dialog-btn-confirm.success {
    background: linear-gradient(135deg, #00cc66, #00dd77);
    color: white;
}

/* Notification Styles */
.notification {
    position: fixed;
    top: 20px;
    right: 20px;
    background: var(--bg-card);
    border-left: 4px solid var(--primary);
    color: var(--text-primary);
    padding: 16px 24px;
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow-lg);
    z-index: 9999;
    max-width: 320px;
    transform: translateX(150%);
    transition: transform 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

.notification.show {
    transform: translateX(0);
}

.notification.success {
    border-left-color: #00cc66;
}

.notification.error {
    border-left-color: #ff4444;
}

.notification.warning {
    border-left-color: #ffaa00;
}

.notification.info {
    border-left-color: #0099ff;
}

/* Mobile responsive for dialogs */
@media (max-width: 768px) {
    .dialog-container {
        max-width: 90%;
        margin: 20px;
    }
    
    .dialog-header {
        padding: 16px 20px;
    }
    .welcome-content {
    margin-top: 280px;
    
}
    .dialog-body {
        padding: 20px;
    }
    
    .dialog-footer {
        padding: 16px 20px;
    }
    
    .dialog-btn {
        padding: 12px 20px;
        min-width: 100px;
        flex: 1;
    }
    
    .notification {
        left: 20px;
        right: 20px;
        max-width: none;
        transform: translateY(-150%);
    }
    
    .notification.show {
        transform: translateY(0);
    }
}

@media (max-width: 480px) {
    .dialog-container {
        max-width: 95%;
    }
    
    .dialog-footer {
        flex-direction: column;
    }
    
    .dialog-btn {
        width: 100%;
    }
}
/* Conversation delete button */
.delete-conversation {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255, 68, 68, 0.1);
    border: none;
    color: #ff4444;
    width: 28px;
    height: 28px;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    opacity: 0;
    transition: all var(--transition-fast);
}

.conversation-item {
    position: relative;
    padding-right: 48px; /* Make space for delete button */
}

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

.delete-conversation:hover {
    background: rgba(255, 68, 68, 0.2);
}

/* Mobile adjustments for delete button */
@media (max-width: 768px) {
    .delete-conversation {
        opacity: 1; /* Always show on mobile for touch devices */
        background: rgba(255, 68, 68, 0.2);
    }
}
/* Container */
.container {
    display: flex;
    height: 100vh;
    width: 100%;
    overflow: hidden;
}

/* Mobile Header */
button#menuToggle {
    width: 20%;
    margin: 5px;
    padding: 12px;
    background: var(--primary);
    border: none;
    border-radius: var(--radius-sm);
    color: #000;
    font-weight: 600;
    cursor: pointer;
}
.mobile-header {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 60px;
    background: var(--bg-card);
    border-bottom: 1px solid var(--border);
    padding: 0 16px;
    z-index: 1000;
    align-items: center;
    justify-content: space-between;
}

.mobile-logo {
    display: none;
    align-items: center;
    gap: 12px;
}

.logo-icon {
    width: 36px;
    height: 36px;
    background: linear-gradient(135deg, var(--primary), var(--primary-light));
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    color: #000;
    font-size: 18px;
}

.mobile-logo h1 {
    font-size: 18px;
    background: linear-gradient(135deg, var(--primary), var(--primary-light));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.new-chat-btn {
    width: 40px;
    height: 40px;
    background: var(--primary);
    border: none;
    border-radius: var(--radius-sm);
    color: #000;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

/* Desktop Sidebar */
.desktop-sidebar {
    width: 280px;
    background: var(--bg-card);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.sidebar-header {
    padding: 24px;
    border-bottom: 1px solid var(--border);
}

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

.logo h1 {
    font-size: 20px;
    background: linear-gradient(135deg, var(--primary), var(--primary-light));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.new-chat-btn {
    width: 100%;
    padding: 12px;
    background: var(--primary);
    border: none;
    border-radius: var(--radius-sm);
    color: #000;
    font-weight: 600;
    cursor: pointer;
}

/* Conversations List */
.conversations-list {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
}

.empty-state {
    text-align: center;
    padding: 40px 16px;
    color: var(--text-muted);
}

.empty-state i {
    font-size: 32px;
    margin-bottom: 16px;
    opacity: 0.5;
}

.empty-state .small {
    font-size: 13px;
    margin-top: 8px;
    opacity: 0.7;
}

.conversation-item {
    padding: 16px;
    background: transparent;
    border-radius: var(--radius-sm);
    margin-bottom: 8px;
    cursor: pointer;
    transition: all 0.2s;
}

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

.conversation-title {
    font-weight: 500;
    font-size: 14px;
    margin-bottom: 4px;
}

.conversation-time {
    font-size: 12px;
    color: var(--text-muted);
}

/* Sidebar Features */
.sidebar-features {
    padding: 24px;
    border-top: 1px solid var(--border);
}

.feature-card {
    background: rgba(255, 255, 255, 0.05);
    border-radius: var(--radius-sm);
    padding: 16px;
    margin-bottom: 24px;
    border-left: 3px solid var(--primary);
}

.feature-card h3 {
    color: var(--primary);
    font-size: 16px;
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.feature-card p {
    color: var(--text-muted);
    font-size: 13px;
}

.file-upload {
    margin-bottom: 24px;
}

.upload-btn {
    width: 100%;
    padding: 12px;
    background: var(--bg-input);
    border: 1px solid var(--border);
    color: var(--text);
    border-radius: var(--radius-sm);
    cursor: pointer;
    margin-bottom: 8px;
}

.upload-hint {
    font-size: 12px;
    color: var(--text-muted);
    text-align: center;
}

.quick-tips {
    background: rgba(255, 255, 255, 0.05);
    border-radius: var(--radius-sm);
    padding: 16px;
}

.quick-tips h4 {
    color: var(--primary);
    font-size: 14px;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.quick-tips ul {
    list-style: none;
}

.quick-tips li {
    font-size: 13px;
    color: var(--text-muted);
    margin-bottom: 6px;
    padding-left: 16px;
    position: relative;
}

.quick-tips li:before {
    content: "•";
    color: var(--primary);
    position: absolute;
    left: 0;
}

/* Mobile Sidebar */
.mobile-sidebar {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    width: 85%;
    max-width: 300px;
    background: var(--bg-card);
    transform: translateX(-100%);
    transition: transform 0.3s;
    z-index: 2000;
    display: none;
    flex-direction: column;
}

.mobile-sidebar.active {
    transform: translateX(0);
}

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

.mobile-sidebar .sidebar-header h2 {
    font-size: 18px;
}

.close-sidebar {
    background: none;
    border: none;
    color: var(--text-muted);
    width: 36px;
    height: 36px;
    border-radius: var(--radius-sm);
    cursor: pointer;
}

.mobile-conversations-list {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
}

.sidebar-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1999;
    display: none;
}

.sidebar-overlay.active {
    display: block;
}

/* Main Chat Area */
.main-chat-area {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

/* Mode Selector */
.mode-selector {
    background: var(--bg-card);
    border-bottom: 1px solid var(--border);
    padding: 12px 16px;
    overflow-x: auto;
}

.mode-scroll {
    display: flex;
    gap: 8px;
    min-width: max-content;
}

.mode-btn {
    padding: 10px 16px;
    background: transparent;
    border: 1px solid var(--border);
    color: var(--text-muted);
    border-radius: 20px;
    cursor: pointer;
    font-size: 14px;
    white-space: nowrap;
    display: flex;
    align-items: center;
    gap: 6px;
}

.mode-btn.active {
    background: var(--primary);
    color: #000;
    border-color: var(--primary);
}

/* Messages Container */
.messages-container {
    flex: 1;
    overflow-y: auto;
    position: relative;
}

/* Welcome Screen */
.welcome-screen {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 32px;
}

.welcome-screen:not(.active) {
    display: none;
}

.welcome-content {
    max-width: 600px;
    width: 100%;
    text-align: center;
}

.welcome-icon {
    width: 80px;
    height: 80px;
    background: linear-gradient(135deg, var(--primary), var(--primary-light));
    border-radius: var(--radius);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 32px;
    margin: 0 auto 24px;
    animation: float 3s ease-in-out infinite;
}

@keyframes float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

.welcome-content h1 {
    font-size: 32px;
    margin-bottom: 12px;
    background: linear-gradient(135deg, var(--primary), var(--primary-light));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.welcome-subtitle {
    color: var(--text-muted);
    font-size: 18px;
    margin-bottom: 32px;
}

/* Feature Grid */
.feature-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 16px;
    margin-bottom: 32px;
}

.feature-card-mini {
    background: var(--bg-card);
    padding: 20px;
    border-radius: var(--radius);
    text-align: center;
    border: 1px solid var(--border);
    cursor: pointer;
    transition: all 0.3s;
}

.feature-card-mini:hover {
    transform: translateY(-4px);
    border-color: var(--primary);
    box-shadow: var(--shadow);
}

.feature-icon {
    font-size: 28px;
    margin-bottom: 12px;
}

.feature-card-mini h4 {
    font-size: 16px;
    margin-bottom: 4px;
}

.feature-card-mini p {
    font-size: 13px;
    color: var(--text-muted);
}

/* Quick Examples */
.quick-examples {
    margin-top: 32px;
}

.quick-examples h3 {
    font-size: 18px;
    margin-bottom: 16px;
}

.example-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: center;
}

.example-chip {
    padding: 10px 16px;
    background: var(--bg-input);
    border: 1px solid var(--border);
    color: var(--text);
    border-radius: 20px;
    font-size: 14px;
    cursor: pointer;
}

.example-chip:hover {
    background: var(--bg-hover);
    border-color: var(--primary);
}

/* Chat Messages */
.chat-messages {
    padding: 32px 24px;
    display: none;
    flex-direction: column;
    gap: 24px;
}

.chat-messages.active {
    display: flex;
}

.message {
    display: flex;
    max-width: 85%;
    animation: slideIn 0.3s ease;
}

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

.message.user {
    margin-left: auto;
}

.message-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    margin-top: 4px;
    margin-right: 3px;
}

.user .message-avatar {
    background: linear-gradient(135deg, var(--primary), var(--primary-light));
    color: #000;
    font-weight: bold;
    margin-left: 12px;
}
.assistant .message-avatar {
    background: linear-gradient(135deg, var(--primary), var(--primary-light));
    color: #000;
    font-weight: bold;
    margin-left: 12px;
}
.assistant .message-content {
    background: #b2a883;
    color: #000;
}

.bot .message-avatar {
    background: var(--bg-card);
    color: var(--primary);
    margin-right: 12px;
}

.message-content-wrapper {
    display: flex;
    flex-direction: column;
}

.message-content {
    padding: 16px 20px;
    border-radius: var(--radius);
    font-size: 15px;
    line-height: 1.6;
    word-break: break-word;
}

.user .message-content {
    background: linear-gradient(135deg, var(--primary), var(--primary-light));
    color: #000;
}

.bot .message-content {
    background: var(--bg-card);
    border: 1px solid var(--border);
}

.message-time {
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 6px;
}

/* Input Area */
.input-area {
    background: var(--bg-card);
    border-top: 1px solid var(--border);
    padding: 16px;
}

.input-wrapper {
    max-width: 800px;
    margin: 0 auto;
}

.input-container {
    display: flex;
    gap: 12px;
    margin-bottom: 12px;
}

.message-input {
    flex: 1;
    min-height: 56px;
    max-height: 200px;
    padding: 16px;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    color: var(--text);
    font-size: 16px;
    resize: none;
    outline: none;
}

.message-input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 2px rgba(255, 204, 0, 0.2);
}

.input-actions {
    display: flex;
    gap: 12px;
    align-items: flex-end;
}

.action-btn {
    width: 56px;
    height: 56px;
    border: none;
    border-radius: var(--radius);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 18px;
}

.upload-trigger {
    background: var(--bg-input);
    color: var(--text);
}

.send-btn {
    background: linear-gradient(135deg, var(--primary), var(--primary-light));
    color: #000;
}

/* Utility Buttons */
.utility-buttons {
    display: flex;
    gap: 12px;
}

.utility-btn {
    flex: 1;
    padding: 12px;
    background: var(--bg-input);
    border: 1px solid var(--border);
    color: var(--text-muted);
    border-radius: var(--radius-sm);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

/* Loading Animation */
.loading {
    display: inline-flex;
    gap: 4px;
}

.loading span {
    width: 6px;
    height: 6px;
    background: var(--primary);
    border-radius: 50%;
    animation: bounce 1.4s infinite ease-in-out both;
}

.loading span:nth-child(1) { animation-delay: -0.32s; }
.loading span:nth-child(2) { animation-delay: -0.16s; }

@keyframes bounce {
    0%, 80%, 100% { transform: scale(0); }
    40% { transform: scale(1); }
}

/* Notification */
.notification {
    position: fixed;
    top: 20px;
    right: 20px;
    background: var(--bg-card);
    border-left: 4px solid var(--primary);
    color: var(--text);
    padding: 16px 24px;
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow);
    transform: translateX(150%);
    transition: transform 0.3s;
    z-index: 9999;
    max-width: 300px;
}

.notification.show {
    transform: translateX(0);
}

/* Responsive Design */
@media (max-width: 768px) {
    .desktop-sidebar {
        display: none;
    }
    
    .mobile-header {
        display: flex;
    }
    
    .mobile-sidebar {
        display: flex;
    }
    
    .main-chat-area {
        margin-top: 60px;
        height: calc(100vh - 60px);
    }
    
    .welcome-screen {
        padding: 24px;
    }
    
    .welcome-icon {
        width: 60px;
        height: 60px;
        font-size: 24px;
    }
    
    .welcome-content h1 {
        font-size: 24px;
    }
    
    .welcome-subtitle {
        font-size: 16px;
    }
    
    .feature-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
    }
    
    .feature-card-mini {
        padding: 16px;
    }
    
    .message {
        max-width: 90%;
    }
    
    .input-area {
        padding: 12px;
    }
    
    .message-input {
        min-height: 48px;
        font-size: 15px;
    }
    
    .action-btn {
        width: 48px;
        height: 48px;
    }
    
    .utility-btn span {
        display: none;
    }
    
    .utility-btn {
        padding: 12px;
        font-size: 16px;
    }
    
    .mode-btn span {
        display: none;
    }
    
    .mode-btn {
        padding: 8px;
        width: 44px;
        height: 44px;
        justify-content: center;
    }
}

@media (max-width: 480px) {
    .feature-grid {
        grid-template-columns: 1fr;
    }
    
    .message {
        max-width: 95%;
    }
}