/* Enhanced UI Styles for Chat Interface */

:root {
    --accent-primary: #ff9500;
    --accent-secondary: #764ba2;
    /* Background variables removed - using animated gradients from chat-interface.css */
    /* --background-primary: #ffffff; */
    /* --background-secondary: #f8f9fa; */
    /* --background-tertiary: #f1f3f5; */
    --text-primary: #212529;
    --text-secondary: #495057;
    --text-tertiary: #868e96;
    --text-tertiary-light: #adb5bd;
    --border-primary: #dee2e6;
    --border-secondary: #e9ecef;
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.07);
    --shadow-lg: 0 10px 20px rgba(0, 0, 0, 0.1);
    --gradient-primary: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --gradient-secondary: linear-gradient(135deg, #ff9500 0%, #ff6200 100%);
}

body.dark-mode {
    /* Background variables removed - using animated gradients from chat-interface.css */
    /* --background-primary: #1a1a1a; */
    /* --background-secondary: #2a2a2a; */
    /* --background-tertiary: #333333; */
    --text-primary: #ffffff;
    --text-secondary: #e0e0e0;
    --text-tertiary: #b0b0b0;
    --text-tertiary-light: #808080;
    --border-primary: #404040;
    --border-secondary: #4a4a4a;
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.2);
    --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.3);
    --shadow-lg: 0 10px 20px rgba(0, 0, 0, 0.4);
}

/* Container Layout */
.container {
    display: flex;
    height: 100vh;
    /* background handled by chat-interface.css animated gradients */
    overflow: hidden;
}

/* Sidebar Styles */
.sidebar {
    width: 320px;
    background: var(--background-secondary);
    border-right: 1px solid var(--border-primary);
    display: flex;
    flex-direction: column;
    transform: translateX(-100%);
    transition: transform 0.3s ease;
    position: fixed;
    left: 0;
    top: 0;
    bottom: 0;
    z-index: 1000;
}

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

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

.sidebar-title {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-primary);
}

.close-sidebar {
    background: none;
    border: none;
    font-size: 1.5rem;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    transition: all 0.2s ease;
}

.close-sidebar:hover {
    background: var(--background-tertiary);
}

.sidebar-section {
    padding: 1.5rem;
    border-bottom: 1px solid var(--border-primary);
}

.section-title {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-tertiary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 1rem;
}

.settings-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.setting-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 1rem;
    background: var(--background-primary);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
}

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

.setting-label {
    color: var(--text-primary);
    font-size: 0.95rem;
}

.setting-toggle {
    width: 44px;
    height: 24px;
    background: var(--border-primary);
    border-radius: 12px;
    position: relative;
    cursor: pointer;
    transition: background 0.3s ease;
}

.setting-toggle.active {
    background: var(--accent-primary);
}

.setting-toggle::after {
    content: '';
    position: absolute;
    width: 20px;
    height: 20px;
    background: white;
    border-radius: 50%;
    top: 2px;
    left: 2px;
    transition: transform 0.3s ease;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.setting-toggle.active::after {
    transform: translateX(20px);
}

/* Account Info */
.account-info {
    padding: 1rem;
    background: var(--background-primary);
    border-radius: 8px;
}

.account-name {
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.25rem;
}

.account-email {
    font-size: 0.875rem;
    color: var(--text-secondary);
}

/* Main Content Area */
.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    background: var(--background-primary);
}

/* Header */
.header {
    background: var(--background-secondary);
    padding: 1rem 1.5rem;
    border-bottom: 1px solid var(--border-primary);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.menu-button {
    background: none;
    border: none;
    color: var(--text-primary);
    cursor: pointer;
    padding: 0.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    transition: background 0.2s ease;
}

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

.logo {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.logo img {
    height: 32px;
    width: auto;
}

.logo-text {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-primary);
}

.header-right {
    display: flex;
    align-items: center;
    gap: 1rem;
}

/* Chat Container */
.chat-container {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 2rem;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

/* Message Styles */
.message {
    display: flex;
    gap: 1rem;
    animation: fadeIn 0.3s ease;
}

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

.message-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--gradient-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 600;
    flex-shrink: 0;
}

.message.user .message-avatar {
    background: var(--gradient-secondary);
}

.message-content {
    max-width: 70%;
    padding: 16px 2px;
    border-radius: 12px;
}

.message.user .message-content {
    color: white;
}

.message-text {
    line-height: 1.6;
    word-wrap: break-word;
}

.message-time {
    font-size: 0.75rem;
    color: var(--text-tertiary);
    margin-top: 0.5rem;
}

.message.user .message-time {
    color: rgba(255, 255, 255, 0.8);
}

/* Typing Indicator */
.typing-indicator {
    display: flex;
    gap: 4px;
    padding: 1rem;
}

.typing-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--text-tertiary);
    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% {
        transform: translateY(0);
        opacity: 0.7;
    }
    30% {
        transform: translateY(-10px);
        opacity: 1;
    }
}

/* Input Area */
.input-area {
    padding: 1.5rem;
    background: var(--background-secondary);
    border-top: 1px solid var(--border-primary);
}

.input-container {
    display: flex;
    gap: 1rem;
    align-items: flex-end;
}

.input-wrapper {
    flex: 1;
    position: relative;
}

#chatInput {
    width: 100%;
    padding: 0.875rem 1rem;
    background: var(--background-primary);
    border: 1px solid var(--border-primary);
    border-radius: 12px;
    resize: none;
    min-height: 50px;
    max-height: 150px;
    font-size: 0.95rem;
    line-height: 1.5;
    color: var(--text-primary);
}

#chatInput:focus {
    outline: none;
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 3px rgba(255, 149, 0, 0.1);
}

.send-button {
    padding: 0.875rem 1.5rem;
    background: var(--accent-primary);
    color: white;
    border: none;
    border-radius: 12px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.send-button:hover {
    background: #e68600;
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.send-button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

/* Loading Animation */
.loading-container {
    display: flex;
    justify-content: center;
    padding: 2rem;
}

.loading-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid var(--border-primary);
    border-top-color: var(--accent-primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

/* Welcome Screen */
.welcome-screen {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    text-align: center;
}

.welcome-logo {
    width: 120px;
    height: 120px;
    margin-bottom: 2rem;
}

.welcome-title {
    font-size: 2rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 1rem;
}

.welcome-subtitle {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-bottom: 2rem;
    max-width: 500px;
}

.welcome-suggestions {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 0.5rem;
    max-width: 450px;
    width: 100%;
}

.suggestion-card {
    padding: 0.75rem;
    background: var(--background-secondary);
    border: 1px solid var(--border-primary);
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
    text-align: left;
}

.suggestion-card:hover {
    border-color: var(--accent-primary);
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}

.suggestion-icon {
    font-size: 0.9rem;
    margin-bottom: 0.4rem;
}

.suggestion-text {
    color: var(--text-primary);
    font-size: 0.65rem;
}

/* Responsive Design */
@media (max-width: 768px) {
    .sidebar {
        width: 100%;
    }
    
    .message-content {
        max-width: 85%;
    }
    
    .welcome-suggestions {
        grid-template-columns: 1fr;
    }
    
    .header {
        padding: 0.75rem 1rem;
    }
    
    .chat-messages {
        padding: 1rem;
    }
}

/* Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Scrollbar Styling */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: var(--background-secondary);
}

::-webkit-scrollbar-thumb {
    background: var(--border-primary);
    border-radius: 4px;
}

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

/* Utility Classes */
.hidden {
    display: none !important;
}

.fade-in {
    animation: fadeIn 0.3s ease;
}

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

.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }