* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary: #8b5cf6;
    --primary-dark: #7c3aed;
    --bg-light: #f9fafb;
    --bg-dark: #1f2937;
    --text-light: #111827;
    --text-dark: #f9fafb;
    --border: #e5e7eb;
    --success: #10b981;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--bg-light);
    color: var(--text-light);
    height: 100vh;
    overflow: hidden;
}

.app-container {
    display: flex;
    height: 100vh;
}

/* Sidebar */
.sidebar {
    width: 260px;
    background: white;
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    padding: 20px;
}

.sidebar-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 24px;
}

.logo {
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, var(--primary), #ec4899);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: bold;
    font-size: 18px;
}

.sidebar-nav {
    flex: 1;
}

.nav-section {
    color: #6b7280;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    margin: 16px 0 8px;
}

.nav-item {
    display: block;
    padding: 10px 12px;
    color: var(--text-light);
    text-decoration: none;
    border-radius: 8px;
    margin-bottom: 4px;
    transition: background 0.2s;
}

.nav-item:hover, .nav-item.active {
    background: var(--bg-light);
    color: var(--primary);
}

.sidebar-footer {
    margin-top: auto;
    padding-top: 20px;
    border-top: 1px solid var(--border);
}

.social-links {
    display: flex;
    gap: 12px;
    margin-bottom: 12px;
}

.social-icon {
    font-size: 20px;
    text-decoration: none;
}

.powered-by {
    font-size: 12px;
    color: #6b7280;
}

/* Main Content */
.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.chat-header {
    background: white;
    border-bottom: 1px solid var(--border);
    padding: 16px 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 16px;
}

.logo-small {
    width: 36px;
    height: 36px;
    background: linear-gradient(135deg, var(--primary), #ec4899);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: bold;
}

.header-info h1 {
    font-size: 18px;
    margin-bottom: 4px;
}

.status {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    color: #6b7280;
}

.status-dot {
    width: 8px;
    height: 8px;
    background: var(--success);
    border-radius: 50%;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

.response-time {
    margin-left: 8px;
}

.menu-toggle {
    display: none;
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
}

/* Chat Container */
.chat-container {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.messages {
    flex: 1;
    overflow-y: auto;
    padding: 24px;
    background: var(--bg-light);
}

.welcome-message {
    text-align: center;
    padding: 40px 20px;
}

.welcome-message h2 {
    font-size: 32px;
    margin-bottom: 12px;
}

.message {
    margin-bottom: 16px;
    display: flex;
    animation: fadeIn 0.3s;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.message.user {
    justify-content: flex-end;
}

.message-content {
    max-width: 70%;
    padding: 12px 16px;
    border-radius: 16px;
    word-wrap: break-word;
}

.message.user .message-content {
    background: var(--primary);
    color: white;
    border-bottom-right-radius: 4px;
}

.message.bot .message-content {
    background: white;
    color: var(--text-light);
    border: 1px solid var(--border);
    border-bottom-left-radius: 4px;
}

.typing-indicator {
    display: inline-block;
    width: 8px;
    height: 8px;
    background: #9ca3af;
    border-radius: 50%;
    margin-left: 8px;
    animation: typing 1.4s infinite;
}

@keyframes typing {
    0%, 60%, 100% { transform: translateY(0); }
    30% { transform: translateY(-10px); }
}

/* Input Area */
.input-area {
    background: white;
    border-top: 1px solid var(--border);
    padding: 16px 24px;
    display: flex;
    gap: 12px;
    align-items: center;
    position: relative;
    z-index: 10;
}

#messageInput {
    flex: 1;
    padding: 12px 16px;
    border: 1px solid var(--border);
    border-radius: 24px;
    font-size: 16px;
    outline: none;
    background: white;
    color: var(--text-light);
    pointer-events: auto;
    cursor: text;
    z-index: 10;
    position: relative;
}

#messageInput:focus {
    border-color: var(--primary);
}

#messageInput:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.mic-button, .send-button {
    width: 40px;
    height: 40px;
    border: none;
    border-radius: 50%;
    background: var(--primary);
    color: white;
    font-size: 18px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
    pointer-events: auto;
    z-index: 10;
    position: relative;
}

.mic-button:hover, .send-button:hover {
    background: var(--primary-dark);
}

.mic-button:disabled, .send-button:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* Auth Modal */
.auth-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    align-items: center;
    justify-content: center;
    z-index: 2000;
    padding: 20px;
    overflow-y: auto;
}

.auth-content {
    background: white;
    padding: 32px;
    border-radius: 16px;
    max-width: 400px;
    width: 90%;
    position: relative;
}

.auth-content h3 {
    margin-bottom: 20px;
}

.auth-content input {
    width: 100%;
    padding: 12px;
    margin-bottom: 12px;
    border: 1px solid var(--border);
    border-radius: 8px;
    font-size: 16px;
}

.auth-content button {
    width: 100%;
    padding: 12px;
    background: var(--primary);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    cursor: pointer;
    margin-bottom: 8px;
}

.close-auth {
    position: absolute;
    top: 12px;
    right: 12px;
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    width: auto;
    padding: 0;
    margin: 0;
}

/* Responsive Design */

/* Tablet */
@media (max-width: 1024px) {
    .sidebar {
        width: 220px;
    }
    
    .messages {
        padding: 20px;
    }
    
    .message-content {
        max-width: 75%;
    }
}

/* Mobile */
@media (max-width: 768px) {
    body {
        overflow: auto;
    }
    
    .app-container {
        flex-direction: column;
        position: relative;
    }
    
    .sidebar {
        position: fixed;
        left: -260px;
        top: 0;
        z-index: 1000;
        height: 100vh;
        transition: left 0.3s ease;
        box-shadow: 2px 0 10px rgba(0,0,0,0.1);
    }
    
    .sidebar.open {
        left: 0;
    }
    
    .sidebar.open::before {
        content: '';
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background: rgba(0, 0, 0, 0.5);
        z-index: -1;
        animation: fadeIn 0.3s;
    }
    
    .main-content {
        width: 100%;
    }
    
    .menu-toggle {
        display: block;
        z-index: 1001;
        position: relative;
    }
    
    .chat-header {
        padding: 12px 16px;
    }
    
    .header-left {
        gap: 12px;
    }
    
    .logo-small {
        width: 32px;
        height: 32px;
        font-size: 14px;
    }
    
    .header-info h1 {
        font-size: 16px;
    }
    
    .status {
        font-size: 12px;
        flex-wrap: wrap;
        gap: 4px;
    }
    
    .response-time {
        margin-left: 0;
        font-size: 11px;
    }
    
    .messages {
        padding: 16px;
    }
    
    .welcome-message {
        padding: 30px 16px;
    }
    
    .welcome-message h2 {
        font-size: 24px;
    }
    
    .message-content {
        max-width: 85%;
        padding: 10px 14px;
        font-size: 14px;
    }
    
    .input-area {
        padding: 12px 16px;
        gap: 8px;
    }
    
    #messageInput {
        font-size: 14px;
        padding: 10px 14px;
    }
    
    .mic-button, .send-button {
        width: 36px;
        height: 36px;
        font-size: 16px;
    }
    
    .auth-content {
        padding: 24px;
        width: 95%;
        max-width: 380px;
    }
    
    .auth-content h3 {
        font-size: 18px;
        margin-bottom: 16px;
    }
    
    .auth-content input {
        font-size: 14px;
        padding: 10px;
    }
    
    .auth-content button {
        font-size: 14px;
        padding: 10px;
    }
}

/* Small Mobile */
@media (max-width: 480px) {
    .chat-header {
        padding: 10px 12px;
    }
    
    .logo-small {
        width: 28px;
        height: 28px;
        font-size: 12px;
    }
    
    .header-info h1 {
        font-size: 14px;
    }
    
    .status {
        font-size: 11px;
    }
    
    .messages {
        padding: 12px;
    }
    
    .welcome-message h2 {
        font-size: 20px;
    }
    
    .message-content {
        max-width: 90%;
        padding: 8px 12px;
        font-size: 13px;
    }
    
    .input-area {
        padding: 10px 12px;
    }
    
    .auth-content {
        padding: 20px;
    }
    
    .sidebar-header h2 {
        font-size: 16px;
    }
    
    .logo {
        width: 36px;
        height: 36px;
        font-size: 16px;
    }
}

/* Landscape Mobile */
@media (max-width: 768px) and (orientation: landscape) {
    .sidebar {
        width: 200px;
    }
    
    .messages {
        padding: 12px;
    }
    
    .welcome-message {
        padding: 20px;
    }
}

