/* 🌐 ROXI AI - Web Interface Styles */

:root {
    --primary-color: #6366f1;
    --primary-hover: #4f46e5;
    --bg-dark: #0f172a;
    --bg-sidebar: #1e293b;
    --bg-card: #1e293b;
    --bg-input: #334155;
    --text-primary: #f8fafc;
    --text-secondary: #94a3b8;
    --text-muted: #64748b;
    --border-color: #334155;
    --success: #22c55e;
    --error: #ef4444;
    --warning: #f59e0b;
    --user-message: #6366f1;
    --bot-message: #334155;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--bg-dark);
    color: var(--text-primary);
    height: 100vh;
    overflow: hidden;
}

.app-container {
    display: flex;
    height: 100vh;
}

/* ==================== SIDEBAR ==================== */
.sidebar {
    width: 260px;
    background: var(--bg-sidebar);
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    padding: 20px;
}

.logo {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 30px;
    padding: 10px;
}

.logo-icon {
    font-size: 32px;
}

.logo-text {
    font-size: 24px;
    font-weight: 700;
    background: linear-gradient(135deg, #6366f1, #a855f7);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 15px;
    background: var(--bg-card);
    border-radius: 12px;
    margin-bottom: 30px;
}

.user-avatar {
    width: 40px;
    height: 40px;
    background: var(--primary-color);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 16px;
}

.user-name {
    font-weight: 500;
    color: var(--text-primary);
}

.nav-menu {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    color: var(--text-secondary);
    text-decoration: none;
    border-radius: 10px;
    transition: all 0.2s;
    font-weight: 500;
}

.nav-item:hover {
    background: var(--bg-card);
    color: var(--text-primary);
}

.nav-item.active {
    background: var(--primary-color);
    color: white;
}

.nav-icon {
    font-size: 18px;
}

.sidebar-footer {
    padding-top: 20px;
    border-top: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.status-indicator {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--error);
}

.status-indicator.online {
    background: var(--success);
    box-shadow: 0 0 10px var(--success);
}

.status-text {
    color: var(--text-secondary);
    font-size: 14px;
}

.logout-btn {
    color: var(--error);
    text-decoration: none;
    font-size: 14px;
    margin-left: auto;
    padding: 6px 12px;
    border-radius: 6px;
    transition: background 0.2s;
}

.logout-btn:hover {
    background: rgba(239, 68, 68, 0.1);
}

/* ==================== MAIN CONTENT ==================== */
.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    background: var(--bg-dark);
}

.chat-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 30px;
    border-bottom: 1px solid var(--border-color);
    background: var(--bg-sidebar);
}

.header-info h1 {
    font-size: 20px;
    font-weight: 600;
    margin-bottom: 4px;
}

.header-status {
    font-size: 14px;
    color: var(--text-secondary);
}

.header-actions {
    display: flex;
    gap: 10px;
}

.icon-btn {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    border: 1px solid var(--border-color);
    background: var(--bg-card);
    color: var(--text-primary);
    font-size: 18px;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.icon-btn:hover {
    background: var(--primary-color);
    border-color: var(--primary-color);
}

.icon-btn.active {
    background: var(--primary-color);
    border-color: var(--primary-color);
}

/* ==================== CHAT MESSAGES ==================== */
.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 30px;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.message {
    display: flex;
    gap: 15px;
    max-width: 80%;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.message.user-message {
    margin-left: auto;
    flex-direction: row-reverse;
}

.message-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--bg-card);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    flex-shrink: 0;
}

.message-content {
    background: var(--bot-message);
    padding: 16px 20px;
    border-radius: 16px;
    line-height: 1.6;
}

.user-message .message-content {
    background: var(--user-message);
}

.message-content p {
    margin-bottom: 10px;
}

.message-content p:last-child {
    margin-bottom: 0;
}

.message-content ul {
    margin: 10px 0;
    padding-left: 20px;
}

.message-content li {
    margin-bottom: 5px;
}

/* Typing indicator */
.typing-dots {
    display: flex;
    gap: 5px;
    padding: 10px 0;
}

.typing-dots span {
    width: 8px;
    height: 8px;
    background: var(--text-secondary);
    border-radius: 50%;
    animation: typing 1.4s infinite;
}

.typing-dots span:nth-child(2) {
    animation-delay: 0.2s;
}

.typing-dots span:nth-child(3) {
    animation-delay: 0.4s;
}

@keyframes typing {
    0%, 60%, 100% {
        transform: translateY(0);
        opacity: 0.4;
    }
    30% {
        transform: translateY(-10px);
        opacity: 1;
    }
}

/* ==================== VOICE INDICATOR ==================== */
.voice-indicator {
    position: fixed;
    bottom: 120px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--bg-card);
    padding: 20px 40px;
    border-radius: 50px;
    display: flex;
    align-items: center;
    gap: 20px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
    z-index: 100;
    animation: slideUp 0.3s ease;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateX(-50%) translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateX(-50%) translateY(0);
    }
}

.voice-animation {
    display: flex;
    gap: 4px;
    align-items: center;
}

.voice-animation span {
    width: 4px;
    height: 20px;
    background: var(--primary-color);
    border-radius: 2px;
    animation: voiceWave 1s infinite;
}

.voice-animation span:nth-child(2) {
    animation-delay: 0.2s;
    height: 30px;
}

.voice-animation span:nth-child(3) {
    animation-delay: 0.4s;
}

@keyframes voiceWave {
    0%, 100% {
        transform: scaleY(0.5);
    }
    50% {
        transform: scaleY(1);
    }
}

.stop-btn {
    padding: 8px 16px;
    background: var(--error);
    color: white;
    border: none;
    border-radius: 20px;
    cursor: pointer;
    font-weight: 500;
    transition: background 0.2s;
}

.stop-btn:hover {
    background: #dc2626;
}

/* ==================== INPUT AREA ==================== */
.input-area {
    padding: 20px 30px 30px;
    background: var(--bg-sidebar);
    border-top: 1px solid var(--border-color);
}

.input-container {
    display: flex;
    align-items: flex-end;
    gap: 12px;
    background: var(--bg-input);
    border-radius: 16px;
    padding: 12px 16px;
}

.input-btn {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    border: none;
    background: transparent;
    color: var(--text-secondary);
    font-size: 18px;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.input-btn:hover {
    background: var(--bg-card);
    color: var(--text-primary);
}

.input-btn.recording {
    background: var(--error);
    color: white;
    animation: pulse 1s infinite;
}

@keyframes pulse {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.1);
    }
}

#message-input {
    flex: 1;
    background: transparent;
    border: none;
    color: var(--text-primary);
    font-size: 16px;
    font-family: inherit;
    resize: none;
    outline: none;
    min-height: 20px;
    max-height: 150px;
    line-height: 1.5;
}

#message-input::placeholder {
    color: var(--text-muted);
}

.send-btn {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    border: none;
    background: var(--primary-color);
    color: white;
    font-size: 18px;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.send-btn:hover {
    background: var(--primary-hover);
    transform: scale(1.05);
}

.input-footer {
    display: flex;
    justify-content: space-between;
    margin-top: 12px;
    font-size: 13px;
    color: var(--text-muted);
}

.mode-indicator strong {
    color: var(--primary-color);
}

.shortcut-hint {
    color: var(--text-muted);
}

/* ==================== RESPONSIVE ==================== */
@media (max-width: 768px) {
    .sidebar {
        position: fixed;
        left: -260px;
        z-index: 1000;
        transition: left 0.3s;
    }
    
    .sidebar.open {
        left: 0;
    }
    
    .message {
        max-width: 95%;
    }
    
    .chat-header {
        padding: 15px 20px;
    }
    
    .input-area {
        padding: 15px;
    }
    
    .chat-messages {
        padding: 20px 15px;
    }
}
