﻿
:root {
    --bg-dark: #0f172a;
    --bg-card: #1e293b;
    --text-main: #f8fafc;
   /* --text-muted: #94a3b8;*/
    --primary: #3b82f6;
    --primary-glow: rgba(59, 130, 246, 0.5);
    --danger: #ef4444;
    --success: #10b981;
    --border: #334155;
    --user-bubble: rgba(59, 130, 246, 0.2);
    --ai-bubble: rgba(255, 255, 255, 0.05);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

body {
    background-color: var(--bg-dark);
    color: var(--text-main);
    height: 100vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

/* Navbar */
nav {
    padding: 1rem 2rem;
    background: rgba(15, 23, 42, 0.8);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
    z-index: 100;
}

.brand {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-weight: 700;
    font-size: 1.25rem;
    letter-spacing: -0.5px;
}

.brand-icon {
    width: 32px;
    height: 32px;
    background: var(--primary);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 0 15px var(--primary-glow);
}

.status-pill {
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 500;
    background: var(--bg-card);
    border: 1px solid var(--border);
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: all 0.3s ease;
}

.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--text-muted);
}

.status-pill.active {
    border-color: var(--success);
    color: var(--success);
    background: rgba(16, 185, 129, 0.1);
}

    .status-pill.active .status-dot {
        background: var(--success);
        box-shadow: 0 0 8px var(--success);
        animation: pulse 2s infinite;
    }

.status-pill.error {
    border-color: var(--danger);
    color: var(--danger);
}

    .status-pill.error .status-dot {
        background: var(--danger);
    }

/* Main Layout */
main {
    flex: 1;
 /*   display: grid;*/
    grid-template-columns: 350px 1fr;
    gap: 1.5rem;
    padding: 1.5rem;
    max-width: 1600px;
    margin: 0 auto;
    width: 100%;
    overflow: hidden;
}

@media(max-width: 900px) {
    main {
        grid-template-columns: 1fr;
        grid-template-rows: auto 1fr;
        overflow-y: auto;
    }
}

/* Cards */
.card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 16px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
}

.card-header {
    padding: 1rem 1.25rem;
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.card-title {
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.card-body {
    flex: 1;
    padding: 0px 20px 5px 20px;
    display: flex;
    flex-direction: column;
    min-height: 0;
}

/* Knowledge Input */
textarea {
    flex: 1;
    width: 100%;
    background: rgba(0,0,0,0.2);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 1rem;
    color: var(--text-main);
    resize: none;
    font-family: 'Monaco', 'Consolas', monospace;
    font-size: 0.9rem;
    line-height: 1.6;
    outline: none;
    transition: border-color 0.2s;
}

    textarea:focus {
        border-color: var(--primary);
    }

.upload-btn {
    background: transparent;
    border: 1px solid var(--border);
    color: var(--text-main);
    padding: 0.4rem 0.8rem;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.8rem;
    transition: background 0.2s;
}

    .upload-btn:hover {
        background: rgba(255,255,255,0.05);
    }

/* Visualizer Area */
.interaction-panel {
    flex: 1;
    display: flex;
    flex-direction: column;
  /*  gap: 1rem;*/
    min-height: 0;
}

.visualizer-container {
    height: 250px;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    background: radial-gradient(circle at center, rgba(59, 130, 246, 0.05) 0%, transparent 70%);
    border-radius: 12px;
    border: 1px solid rgba(255,255,255,0.03);
    flex-shrink: 0;
}

canvas {
    width: 100%;
    height: 100%;
}

.controls {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    position: absolute;
    bottom: 1.5rem;
    left: 0;
    width: 100%;
    z-index: 10;
}

.message-status {
    text-align: center;
    font-size: 0.9rem;
    color: var(--text-muted);
    min-height: 1.2rem;
}

.mic-button {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    border: none;
    background: var(--primary);
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 12px rgba(0,0,0,0.3);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

    .mic-button:hover {
        transform: scale(1.05);
        background: #2563eb;
    }

    .mic-button.active {
        background: var(--danger);
        animation: pulse-ring 2s infinite;
    }

    .mic-button svg {
        width: 28px;
        height: 28px;
        fill: currentColor;
    }

/* Transcript Area */
.transcript-container {
   /* flex: 1;*/
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid var(--border);
    border-radius: 12px;
    display: flex;
    flex-direction: column;
  /*  min-height: 0;*/
    overflow-y: auto;
  /*  height:200px;*/
  /*  margin-top:150px;*/
}

.transcript-header {
    padding: 0.75rem 1rem;
    background: rgba(255, 255, 255, 0.02);
    border-bottom: 1px solid var(--border);
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

#transcript-list {
   /* flex: 1;*/
    overflow-y: auto;
    padding: 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    scroll-behavior: smooth;
    height:85%;
}

.chat-bubble {
    max-width: 85%;
    padding: 0.75rem 1rem;
    border-radius: 12px;
    font-size: 0.95rem;
    line-height: 1.4;
    animation: fadeIn 0.3s ease-out;
    position: relative;
}

.bubble-user {
    align-self: flex-end;
    background: var(--user-bubble);
    border-bottom-right-radius: 2px;
    color: #dbeafe;
}

.bubble-ai {
    align-self: flex-start;
    background: var(--ai-bubble);
    border: 1px solid var(--border);
    border-bottom-left-radius: 2px;
}

.bubble-pending {
    opacity: 0.7;
    font-style: italic;
}

/* Animations */
@keyframes pulse {
    0% {
        opacity: 1;
    }

    50% {
        opacity: 0.4;
    }

    100% {
        opacity: 1;
    }
}

@keyframes pulse-ring {
    0% {
        box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.4);
    }

    70% {
        box-shadow: 0 0 0 15px rgba(239, 68, 68, 0);
    }

    100% {
        box-shadow: 0 0 0 0 rgba(239, 68, 68, 0);
    }
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(5px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.hidden {
    display: none;
}

/* Custom Scrollbar */
#transcript-list::-webkit-scrollbar {
    width: 6px;
}

#transcript-list::-webkit-scrollbar-track {
    background: transparent;
}

#transcript-list::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 10px;
}