/* live_support/style.css */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600&display=swap');

:root {
    --bg-color: #000000;
    --card-bg: rgba(18, 18, 23, 0.7);
    --border-color: rgba(255, 255, 255, 0.08);
    --accent-color: #3b82f6;
    --accent-glow: rgba(59, 130, 246, 0.4);
    --text-primary: #f1f5f9;
    --text-secondary: #94a3b8;
    --msg-user-bg: #2563eb;
    --msg-ai-bg: #1e293b;
    --danger: #ef4444;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: 'Inter', sans-serif;
}

body {
    background-color: var(--bg-color);
    background-image: 
        radial-gradient(circle at 10% 20%, rgba(37, 99, 235, 0.08) 0%, transparent 20%),
        radial-gradient(circle at 90% 80%, rgba(139, 92, 246, 0.08) 0%, transparent 20%);
    color: var(--text-primary);
    height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: hidden;
}

/* Glassmorphism Card */
.app-container {
    width: 100%;
    max-width: 480px;
    height: 90vh; /* Mobile look on desktop */
    background: var(--card-bg);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--border-color);
    border-radius: 24px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    position: relative;
    transition: all 0.3s ease;
}

/* Auth View */
.auth-view {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 40px;
    text-align: center;
}

.auth-view h1 {
    font-size: 2rem;
    font-weight: 600;
    margin-bottom: 10px;
    background: linear-gradient(to right, #fff, #94a3b8);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.auth-view p {
    color: var(--text-secondary);
    margin-bottom: 30px;
    font-size: 0.95rem;
}

.input-group {
    width: 100%;
    margin-bottom: 20px;
    position: relative;
}

.input-field {
    width: 100%;
    padding: 16px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    color: #fff;
    font-size: 1rem;
    transition: all 0.2s;
    outline: none;
}

.input-field:focus {
    border-color: var(--accent-color);
    box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.1);
    background: rgba(255, 255, 255, 0.05);
}

.btn-primary {
    width: 100%;
    padding: 16px;
    background: var(--accent-color);
    border: none;
    border-radius: 12px;
    color: #fff;
    font-weight: 500;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.2s;
    box-shadow: 0 4px 12px var(--accent-glow);
}

.btn-primary:active {
    transform: scale(0.98);
}

.error-msg {
    color: var(--danger);
    font-size: 0.85rem;
    margin-top: 10px;
    min-height: 20px;
}

/* Chat View */
.chat-view {
    display: none; /* Hidden by default */
    flex-direction: column;
    height: 100%;
}

.chat-header {
    padding: 20px;
    border-bottom: 1px solid var(--border-color);
    background: rgba(0,0,0,0.2);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.header-info h2 {
    font-size: 1rem;
    color: #fff;
}

.header-info span {
    font-size: 0.8rem;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 6px;
}

.status-dot {
    width: 8px;
    height: 8px;
    background-color: #10b981;
    border-radius: 50%;
    display: inline-block;
    box-shadow: 0 0 8px rgba(16, 185, 129, 0.4);
}

.btn-logout {
    background: transparent;
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    padding: 6px 12px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.8rem;
    transition: 0.2s;
}

.btn-logout:hover {
    background: rgba(255,255,255,0.05);
    color: #fff;
}

.chat-messages {
    flex: 1;
    padding: 20px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 16px;
    scroll-behavior: smooth;
}

.message {
    max-width: 85%;
    padding: 14px 18px;
    border-radius: 18px;
    font-size: 0.95rem;
    line-height: 1.5;
    position: relative;
    word-wrap: break-word;
    animation: fadeIn 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

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

.message.user {
    align-self: flex-end;
    background: var(--msg-user-bg);
    color: #fff;
    border-bottom-right-radius: 4px;
}

.message.ai {
    align-self: flex-start;
    background: var(--msg-ai-bg);
    color: var(--text-primary);
    border-bottom-left-radius: 4px;
    border: 1px solid var(--border-color);
}

/* Markdown Styles inside AI Messages */
.message.ai strong { color: #fff; font-weight: 600; }
.message.ai p { margin-bottom: 0.5rem; }
.message.ai p:last-child { margin-bottom: 0; }
.message.ai ul, .message.ai ol { margin-left: 1.2rem; margin-bottom: 0.5rem; }

.typing-indicator {
    align-self: flex-start;
    background: var(--msg-ai-bg);
    padding: 12px 18px;
    border-radius: 18px;
    border-bottom-left-radius: 4px;
    display: none;
    gap: 4px;
    align-items: center;
}

.typing-dot {
    width: 6px;
    height: 6px;
    background: #94a3b8;
    border-radius: 50%;
    animation: bounce 1.4s infinite ease-in-out both;
}

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

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

.chat-input-area {
    padding: 20px;
    background: rgba(0,0,0,0.2);
    border-top: 1px solid var(--border-color);
    display: flex;
    gap: 10px;
}

.chat-input-area input {
    flex: 1;
    background: rgba(255,255,255,0.05);
    border: 1px solid var(--border-color);
    padding: 14px;
    border-radius: 12px;
    color: #fff;
    outline: none;
    transition: 0.2s;
}

.chat-input-area input:focus {
    border-color: var(--accent-color);
    background: rgba(255,255,255,0.08);
}

.btn-send {
    background: var(--accent-color);
    border: none;
    width: 50px;
    border-radius: 12px;
    color: #fff;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: 0.2s;
}

.btn-send:hover {
    filter: brightness(1.1);
}

.btn-send svg {
    width: 20px;
    height: 20px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

/* Scrollbar */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.1); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: rgba(255,255,255,0.2); }
