﻿:root {
    --bg-dark: #0a0c16;
    --glass-bg: rgba(255, 255, 255, 0.04);
    --glass-border: rgba(255, 255, 255, 0.1);
    --glass-hover: rgba(255, 255, 255, 0.08);
    --cyan-glow: #00f2fe;
    --purple-glow: #a855f7;
    --text-main: #f8fafc;
    --text-muted: #94a3b8;
    --terminal-bg: rgba(5, 7, 15, 0.8);
    --terminal-text: #4ade80;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    background-color: var(--bg-dark);
    color: var(--text-main);
    height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    overflow-x: hidden;
    position: relative;
}

/* --- MARQUEE CSS --- */
.marquee-container {
    width: 100%;
    background: rgba(0, 242, 254, 0.05);
    border-bottom: 1px solid var(--glass-border);
    color: var(--cyan-glow);
    padding: 6px 0;
    font-size: 0.8rem;
    font-weight: 600;
    letter-spacing: 1px;
    text-transform: uppercase;
    overflow: hidden;
    white-space: nowrap;
    position: relative;
    z-index: 100;
    flex-shrink: 0;
}

.marquee-text {
    display: inline-block;
    animation: marquee 20s linear infinite;
}

@keyframes marquee {
    0% {
        transform: translateX(100vw);
    }

    100% {
        transform: translateX(-100%);
    }
}

.ambient-glow {
    position: fixed;
    border-radius: 50%;
    filter: blur(120px);
    z-index: 0;
    pointer-events: none;
    opacity: 0.4;
}

.glow-1 {
    width: 400px;
    height: 400px;
    background: radial-gradient(circle, var(--cyan-glow), transparent 70%);
    top: -100px;
    left: -100px;
}

.glow-2 {
    width: 500px;
    height: 500px;
    background: radial-gradient(circle, var(--purple-glow), transparent 70%);
    bottom: -150px;
    right: -150px;
}

.app-container {
    width: 100%;
    max-width: 900px;
    height: calc(100vh - 70px);
    display: flex;
    flex-direction: column;
    padding: 24px;
    z-index: 1;
}

header {
    display: flex;
    justify-content: space-around;
    align-items: center;
    padding: 16px 24px;
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--glass-border);
    border-radius: 24px;
    margin-bottom: 24px;
    flex-shrink: 0;
    width: 80%;
}

/* --- Desktop Brand Header --- */
.brand-wrap {
    display: flex;
    flex-direction: column;
    justify-content: center;
}
.brand {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 1.25rem;
    font-weight: 800;
    letter-spacing: -0.5px;
    background: linear-gradient(135deg, #ffffff 30%, var(--cyan-glow));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    margin: 0;
}

.brand-subtitle {
    margin-top: 4px;
    margin-left: 24px; /* Perfectly aligns with the text, skipping the dot */
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.2px;
    background: linear-gradient(135deg, #cbd5e1 10%, var(--purple-glow) 90%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.brand-icon {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: var(--cyan-glow);
    box-shadow: 0 0 12px var(--cyan-glow);
    display: inline-block;
}

.system-controls {
    display: flex;
    gap: 8px;
    align-items: center;
}

.btn-pill {
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid var(--glass-border);
    color: var(--text-main);
    padding: 8px 24px;
    border-radius: 20px;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    align-items: center;
    gap: 8px;
}

    .btn-pill:hover {
        background: var(--glass-hover);
        border-color: rgba(255, 255, 255, 0.2);
        transform: translateY(-1px);
    }

    .btn-pill.active {
        border-color: var(--cyan-glow);
        box-shadow: 0 0 15px rgba(0, 242, 254, 0.2);
    }

.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #64748b;
    transition: all 0.3s;
}

    .status-dot.connected {
        background: var(--cyan-glow);
        box-shadow: 0 0 8px var(--cyan-glow);
    }

    .status-dot.active {
        background: var(--purple-glow);
        box-shadow: 0 0 8px var(--purple-glow);
    }

.server-monitor-left {
    position: fixed;
    top: 50px;
    left: 24px;
    width: 475px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.feed-panel {
    background: var(--terminal-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 12px;
    display: flex;
    flex-direction: column;
    height: 180px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
    overflow: hidden;
}

.feed-header {
    background: rgba(255, 255, 255, 0.05);
    padding: 8px 14px;
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--cyan-glow);
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    display: flex;
    justify-content: space-between;
    align-items: center;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.feed-logs {
    padding: 10px 14px;
    font-family: 'Courier New', Courier, monospace;
    font-size: 0.75rem;
    color: var(--terminal-text);
    overflow-y: auto;
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

    .feed-logs::-webkit-scrollbar {
        width: 4px;
    }

    .feed-logs::-webkit-scrollbar-track {
        background: transparent;
    }

    .feed-logs::-webkit-scrollbar-thumb {
        background: rgba(255, 255, 255, 0.2);
        border-radius: 4px;
    }

.log-entry {
    word-wrap: break-word;
    line-height: 1.3;
    opacity: 0.9;
}

    .log-entry.error {
        color: #ef4444;
    }

    .log-entry.info {
        color: #38bdf8;
    }

.language-bar {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
    margin-bottom: 24px;
    padding: 12px 20px;
    background: var(--glass-bg);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--glass-border);
    border-radius: 20px;
    flex-shrink: 0;
    width: 80%;
}

.lang-select-wrapper {
    display: flex;
    align-items: center;
    gap: 8px;
}

    .lang-select-wrapper label {
        font-size: 0.75rem;
        text-transform: uppercase;
        letter-spacing: 1px;
        color: var(--text-muted);
        font-weight: 600;
    }

select {
    background: rgba(15, 23, 42, 0.6);
    border: 1px solid var(--glass-border);
    color: var(--text-main);
    padding: 6px 14px;
    border-radius: 12px;
    font-size: 0.9rem;
    outline: none;
    cursor: pointer;
    transition: all 0.2s;
}

    select:focus {
        border-color: var(--cyan-glow);
    }

.swap-icon {
    color: var(--text-muted);
    font-size: 1.1rem;
}

.chat-container {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 20px;
    overflow-y: auto;
    padding: 10px 4px 120px 4px;
    scroll-behavior: smooth;
}

.empty-state {
    margin: auto;
    text-align: center;
    color: var(--text-muted);
    font-size: 1.1rem;
    font-weight: 300;
    max-width: 400px;
    line-height: 1.6;
}

.chat-card {
    background: var(--glass-bg);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--glass-border);
    border-radius: 24px;
    padding: 24px;
    display: flex;
    flex-direction: column;
    gap: 14px;
    animation: cardSlideIn 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    position: relative;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
    z-index: 1;
}

.chat-container::-webkit-scrollbar {
    width: 6px;
}

.chat-container::-webkit-scrollbar-track {
    background: transparent;
}

.chat-container::-webkit-scrollbar-thumb {
    background: var(--glass-border);
    border-radius: 10px;
}

    .chat-container::-webkit-scrollbar-thumb:hover {
        background: var(--cyan-glow);
    }

@keyframes cardSlideIn {
    from {
        opacity: 0;
        transform: translateY(20px) scale(0.98);
    }

    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.meta-tag {
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 1px;
    text-transform: uppercase;
    color: var(--cyan-glow);
    display: flex;
    align-items: center;
    gap: 3px;
}

.transcript-bubble {
    font-size: 1.1rem;
    font-weight: 400;
    line-height: 1.4;
    color: var(--text-main);
}

.translation-bubble {
    font-size: 1.1rem;
    font-weight: 400;
    line-height: 1.2;
    color: #d8b4fe;
    padding-top: 10px;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
    transition: all 0.3s ease;
}

.translating-wrapper {
    display: flex;
    align-items: center;
    gap: 3px;
    color: var(--cyan-glow);
    font-weight: 500;
    font-size: 1.05rem;
}

.glowing-orb {
    position: relative;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
}

    .glowing-orb .core {
        width: 10px;
        height: 10px;
        background: var(--cyan-glow);
        border-radius: 50%;
        box-shadow: 0 0 10px var(--cyan-glow);
        animation: orbPulse 1.2s infinite alternate ease-in-out;
    }

    .glowing-orb .pulse-ring {
        position: absolute;
        width: 100%;
        height: 100%;
        border-radius: 50%;
        border: 1.5px solid var(--cyan-glow);
        animation: ringExpand 1.5s infinite cubic-bezier(0.21, 0.53, 0.56, 0.8);
    }

@keyframes orbPulse {
    0% {
        transform: scale(0.8);
        opacity: 0.6;
    }

    100% {
        transform: scale(1.3);
        opacity: 1;
        box-shadow: 0 0 16px var(--cyan-glow);
    }
}

@keyframes ringExpand {
    0% {
        transform: scale(0.5);
        opacity: 1;
    }

    100% {
        transform: scale(2.2);
        opacity: 0;
    }
}

.translating-text::after {
    content: '';
    animation: typingDots 1.5s infinite steps(4, end);
}

@keyframes typingDots {
    0% {
        content: '';
    }

    25% {
        content: '.';
    }

    50% {
        content: '..';
    }

    75% {
        content: '...';
    }

    100% {
        content: '';
    }
}

.bottom-voice-bar {
    position: fixed;
    bottom: 50px;
    left: 50%;
    transform: translateX(-50%);
    width: calc(100% - 48px);
    max-width: 850px;
    background: rgba(10, 12, 22, 0.75);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    border: 1px solid var(--glass-border);
    border-radius: 32px;
    padding: 16px 28px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    z-index: 100;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5);
}

.voice-status-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.voice-status-title {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-main);
}

.voice-status-sub {
    font-size: 0.8rem;
    color: var(--text-muted);
}

.waveform {
    display: flex;
    align-items: center;
    gap: 4px;
    height: 24px;
}

.waveform-bar {
    width: 3px;
    height: 8px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 3px;
    transition: all 0.2s ease;
}

.waveform.listening .waveform-bar {
    background: var(--cyan-glow);
    box-shadow: 0 0 8px var(--cyan-glow);
    animation: wavePulse 1s infinite ease-in-out alternate;
}

    .waveform.listening .waveform-bar:nth-child(1) {
        animation-delay: 0.1s;
    }

    .waveform.listening .waveform-bar:nth-child(2) {
        animation-delay: 0.3s;
    }

    .waveform.listening .waveform-bar:nth-child(3) {
        animation-delay: 0.2s;
    }

    .waveform.listening .waveform-bar:nth-child(4) {
        animation-delay: 0.4s;
    }

    .waveform.listening .waveform-bar:nth-child(5) {
        animation-delay: 0.15s;
    }

@keyframes wavePulse {
    0% {
        height: 6px;
    }

    100% {
        height: 26px;
    }
}

.mic-orb {
    position: relative;
    width: 52px;
    height: 52px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--cyan-glow), var(--purple-glow));
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 0 20px rgba(0, 242, 254, 0.4);
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    flex-shrink: 0;
    user-select: none;
    -webkit-user-select: none;
    touch-action: none;
    border: none;
    outline: none;
}

    .mic-orb:hover {
        transform: scale(1.05);
        box-shadow: 0 0 30px rgba(0, 242, 254, 0.6);
    }

    .mic-orb.active {
        animation: micGlowPulse 2s infinite ease-in-out;
    }

@keyframes micGlowPulse {
    0% {
        box-shadow: 0 0 15px var(--cyan-glow);
    }

    50% {
        box-shadow: 0 0 35px var(--purple-glow), 0 0 50px var(--cyan-glow);
    }

    100% {
        box-shadow: 0 0 15px var(--cyan-glow);
    }
}

.mic-icon {
    width: 22px;
    height: 22px;
    fill: #0a0c16;
    pointer-events: none;
}

.mic-orb.muted {
    background: linear-gradient(135deg, #ef4444, #7f1d1d);
    box-shadow: 0 0 15px rgba(239, 68, 68, 0.4);
    animation: none;
}

    .mic-orb.muted .mic-icon {
        fill: #f8fafc;
    }

/* --- ROBOT CSS --- */
.robot-container {
    position: fixed;
    top: 380px;
    left: 420px;
    width: 140px;
    display: flex;
    flex-direction: column;
    align-items: center;
    z-index: 52;
    animation: float 4s ease-in-out infinite;
    filter: drop-shadow(0 15px 20px rgba(0,0,0,0.6));
    pointer-events: none;
}

@keyframes float {
    0%, 100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-15px);
    }
}

.robot-head {
    width: 120px;
    height: 100px;
    background: linear-gradient(145deg, #ffffff, #cbd5e1);
    border-radius: 45px 45px 35px 35px;
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
    border: 1px solid #94a3b8;
}

    .robot-head::before {
        content: '';
        position: absolute;
        top: -6px;
        width: 45px;
        height: 12px;
        background: linear-gradient(90deg, #3b82f6, #0ea5e9);
        border-radius: 10px 10px 0 0;
    }

.robot-ear {
    position: absolute;
    top: 25px;
    width: 20px;
    height: 50px;
    background: linear-gradient(145deg, #ffffff, #e2e8f0);
    border-radius: 10px;
    border: 1px solid #94a3b8;
    z-index: -1;
}

    .robot-ear.left {
        left: -12px;
    }

    .robot-ear.right {
        right: -12px;
    }

.robot-face {
    width: 85px;
    height: 70px;
    background: #050505;
    border-radius: 20px 20px 25px 25px;
    border: 2px solid #1e293b;
    box-shadow: inset 0 0 20px rgba(0,0,0,0.9);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 10px;
    position: relative;
    overflow: hidden;
}

    .robot-face::after {
        content: '';
        position: absolute;
        top: -15px;
        left: -15px;
        width: 120px;
        height: 45px;
        background: rgba(255,255,255,0.06);
        transform: rotate(-15deg);
        pointer-events: none;
    }

.robot-eyes {
    display: flex;
    gap: 14px;
}

.robot-eye {
    width: 18px;
    height: 16px;
    background: var(--cyan-glow);
    border-radius: 50%;
    box-shadow: 0 0 12px var(--cyan-glow);
    animation: blink 4s infinite;
}

@keyframes blink {
    0%, 95%, 100% {
        transform: scaleY(1);
    }

    97% {
        transform: scaleY(0.1);
    }
}

.robot-mouth {
    width: 32px;
    height: 6px;
    background: var(--cyan-glow);
    border-radius: 4px;
    box-shadow: 0 0 12px var(--cyan-glow);
    transition: all 0.1s ease;
}

.robot-container.speaking .robot-mouth {
    animation: speak 0.15s infinite alternate;
}

.robot-container.speaking .robot-eye {
    animation: none;
    transform: scaleY(1.1);
}

@keyframes speak {
    0% {
        height: 4px;
        width: 32px;
        border-radius: 4px;
    }

    50% {
        height: 16px;
        width: 20px;
        border-radius: 10px;
    }

    100% {
        height: 8px;
        width: 28px;
        border-radius: 6px;
    }
}

.robot-body {
    width: 90px;
    height: 70px;
    background: linear-gradient(145deg, #ffffff, #e2e8f0);
    border-radius: 20px 20px 45px 45px;
    margin-top: -10px;
    z-index: -2;
    position: relative;
    display: flex;
    justify-content: center;
    border: 1px solid #cbd5e1;
    overflow: hidden;
}

    .robot-body::before {
        content: '';
        position: absolute;
        top: 0;
        width: 100%;
        height: 25px;
        background: linear-gradient(90deg, #3b82f6, #0ea5e9);
        border-radius: 20px 20px 50% 50%;
    }

.robot-core {
    width: 22px;
    height: 22px;
    background: #ffffff;
    border-radius: 50%;
    border: 4px solid #1e40af;
    box-shadow: 0 0 15px var(--cyan-glow);
    margin-top: 15px;
    position: relative;
    z-index: 2;
}

/* --- APP FOOTER --- */
.app-footer {
    width: 100%;
    padding: 10px 24px;
    background: rgba(10, 12, 22, 0.8);
    border-top: 1px solid var(--glass-border);
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.75rem;
    color: var(--text-muted);
    position: fixed;
    bottom: 0;
    left: 0;
    z-index: 1000;
    backdrop-filter: blur(12px);
}

.footer-left {
    color: var(--cyan-glow);
    font-weight: 500;
}

.footer-right span {
    margin: 0 2px;
    font-size: 1.1em;
}

/* --- RESPONSIVE MEDIA QUERIES --- */
@media (max-width: 1400px) {
    .server-monitor-left {
        display: none;
    }
}

@media (max-width: 850px) {
    .robot-container {
        top: auto;
        bottom: 140px;
        left: auto;
        right: 40px;
        transform: scale(1.2);
        transform-origin: bottom right;
        animation: float-mobile 4s ease-in-out infinite;
    }

    @keyframes float-mobile {
        0%, 100% {
            transform: scale(1.2) translateY(0);
        }

        50% {
            transform: scale(1.2) translateY(-15px);
        }
    }
}

@media (max-width: 600px) {
    .app-container {
        padding: 12px;
        height: calc(100vh - 60px);
    }

    header {
        flex-direction: column;
        gap: 12px;
        padding: 16px;
        border-radius: 16px;
        width: 100%;
        margin-bottom: 24px;
        text-align: center;
    }

    .brand-wrap {
        align-items: center;
    }

    .brand {
        font-size: 1.15rem;
        margin-bottom: 0;
        justify-content: center;
    }

    .brand-subtitle {
        position: static; /* Resets the old absolute positioning */
        margin-left: 0;
        margin-top: 6px;
        font-size: 0.65rem;
        line-height: 1.3;
        max-width: 250px;
    }

    .system-controls {
        display: flex;
        width: 100%;
        justify-content: center;
        margin-top: 4px;
    }

    .btn-pill {
        justify-content: center;
        font-size: 0.8rem;
        padding: 10px 20px;
        width: 100%;
        max-width: 250px;
    }

    .language-bar {
        width: 100%;
        display: grid;
        grid-template-columns: 1fr auto 1fr;
        gap: 12px;
        padding: 14px;
        border-radius: 16px;
        margin-bottom: 24px;
    }

    .lang-select-wrapper {
        flex-direction: column;
        gap: 6px;
    }

        .lang-select-wrapper label {
            text-align: center;
        }

    select {
        width: 100%;
        padding: 8px;
        font-size: 0.85rem;
        text-align: center;
    }

    .chat-card {
        padding: 5px;
        gap: 8px;
        border-radius: 11px;
    }

    .transcript-bubble, .translation-bubble, .translating-wrapper {
        font-size: 0.95rem;
    }

    .meta-tag {
        font-size: 0.6rem;
    }

    .bottom-voice-bar {
        width: calc(100% - 24px);
        padding: 12px 16px;
        bottom: 56px;
        border-radius: 24px;
    }

    .voice-status-info {
        max-width: 55%;
    }

    .voice-status-title {
        font-size: 0.85rem;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .voice-status-sub {
        font-size: 0.75rem;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .waveform {
        display: none;
    }

    .mic-orb {
        width: 65px;
        height: 65px;
    }

    .app-footer {
        flex-direction: column;
        gap: 4px;
        padding: 8px;
        text-align: center;
    }

    .chat-container {
        padding-bottom: 210px;
    }

    .robot-container {
        bottom: 140px;
        right: 10px;
        transform: scale(0.9);
        transform-origin: bottom right;
        animation: float-small 4s ease-in-out infinite;
    }

    @keyframes float-small {
        0%, 100% {
            transform: scale(0.9) translateY(0);
        }

        50% {
            transform: scale(0.9) translateY(-10px);
        }
    }
}
