/* ============================================
   RoboMate-X1 Control Center — Styles
   ============================================ */

/* ---------- Base ---------- */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;600&family=Fira+Code:wght@400;500&display=swap');

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
    font-family: 'Inter', sans-serif;
    background: radial-gradient(circle at center, #FAFAFA 0%, #F0F0F0 100%);
    background-attachment: fixed;
    overflow: hidden;
    height: 100vh;
}

.grid-bg {
    background-image: radial-gradient(rgba(0,0,0,0.03) 1px, transparent 0);
    background-size: 40px 40px;
}

/* ---------- Glass ---------- */
.glass {
    background: rgba(255, 255, 255, 0.7);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.4);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.05);
}

.terminal-glass {
    background: rgba(30, 30, 30, 0.85);
    backdrop-filter: blur(15px);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

/* ---------- Sphere ---------- */
@keyframes breathe {
    0%, 100% {
        transform: scale(0.97);
        box-shadow: 0 0 80px rgba(100, 140, 255, 0.35), 0 0 30px rgba(140, 100, 240, 0.2);
    }
    50% {
        transform: scale(1.03);
        box-shadow: 0 0 100px rgba(100, 140, 255, 0.5), 0 0 50px rgba(140, 100, 240, 0.4);
    }
}

@keyframes pulse-fast {
    0% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(100, 140, 255, 0.4); }
    70% { transform: scale(1.05); box-shadow: 0 0 0 20px rgba(100, 140, 255, 0); }
    100% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(100, 140, 255, 0); }
}

.pearl-sphere {
    width: 200px;
    height: 200px;
    border-radius: 50%;
    background: radial-gradient(circle at 35% 35%,
        rgba(100, 130, 255, 0.85) 0%,
        rgba(140, 100, 240, 0.4) 70%,
        rgba(160, 120, 255, 0.1) 100%);
    box-shadow:
        0 0 80px rgba(100, 140, 255, 0.35),
        0 0 30px rgba(140, 100, 240, 0.2),
        inset -10px -10px 30px rgba(0, 0, 0, 0.1),
        inset 10px 10px 20px rgba(255, 255, 255, 0.2);
    position: relative;
    transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    align-items: center;
    justify-content: center;
}

.sphere-idle { animation: breathe 4s ease-in-out infinite; }
.sphere-connecting { animation: pulse-fast 1s infinite; }

/* ---------- Progress Ring ---------- */
.progress-ring__circle {
    transition: stroke-dashoffset 0.35s;
    transform: rotate(-90deg);
    transform-origin: 50% 50%;
}

@keyframes ring-flash {
    0% { opacity: 1; transform: rotate(-90deg) scale(1); stroke-width: 4; }
    50% { opacity: 0.5; transform: rotate(-90deg) scale(1.05); stroke-width: 8; }
    100% { opacity: 0; transform: rotate(-90deg) scale(1.1); stroke-width: 0; }
}

.ring-flash {
    animation: ring-flash 0.5s ease-out forwards;
}

/* ---------- Sound Bars ---------- */
.bar {
    width: 8px;
    height: 40px;
    background: rgba(255, 255, 255, 0.8);
    margin: 0 4px;
    border-radius: 4px;
    animation: sound-bar 1s ease-in-out infinite;
}

@keyframes sound-bar {
    0%, 100% { height: 10px; }
    50% { height: 40px; }
}

/* ---------- Terminal ---------- */
.code-highlight {
    background: rgba(100, 130, 255, 0.2);
    border-left: 3px solid #6482FF;
    padding-left: 8px;
    transition: all 0.3s;
}

/* ---------- Chat Panel ---------- */
.chat-msg {
    display: flex;
    flex-direction: column;
    gap: 2px;
    animation: chatFadeIn 0.3s ease;
}
@keyframes chatFadeIn {
    from { opacity: 0; transform: translateY(6px); }
    to   { opacity: 1; transform: translateY(0); }
}
.chat-msg .chat-label {
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.5px;
}
.chat-msg .chat-text {
    font-size: 14px;
    line-height: 1.7;
}
.chat-msg-user .chat-label { color: #94a3b8; }
.chat-msg-user .chat-text  { color: #e2e8f0; }

.chat-msg-ai .chat-label { color: #60a5fa; }
.chat-msg-ai .chat-text {
    color: #e2e8f0;
    background: rgba(96, 165, 250, 0.08);
    border-left: 2px solid rgba(96, 165, 250, 0.35);
    padding: 6px 10px;
    border-radius: 0 6px 6px 0;
}

.chat-msg-system {
    align-items: center;
    text-align: center;
}
.chat-msg-system .chat-text {
    font-size: 11px;
    color: #64748b;
}

.chat-msg-cmd {
    align-items: center;
    text-align: center;
}
.chat-msg-cmd .chat-text {
    font-size: 11px;
    color: #94a3b8;
    background: rgba(255, 255, 255, 0.06);
    padding: 2px 10px;
    border-radius: 10px;
    display: inline-block;
}

/* ---------- Code Block in Chat ---------- */
.chat-msg-code {
    padding: 0;
}
.chat-code-block {
    font-family: 'Fira Code', 'Consolas', 'Courier New', monospace;
    font-size: 12px;
    color: #a5d6ff;
    background: rgba(0, 0, 0, 0.35);
    padding: 10px 14px;
    border-radius: 8px;
    border: 1px solid rgba(96, 165, 250, 0.18);
    overflow-x: auto;
    white-space: pre-wrap;
    line-height: 1.7;
    margin: 2px 0;
    tab-size: 2;
}

/* Typewriter blinking cursor */
.typing-cursor {
    display: inline;
    color: #60a5fa;
    font-weight: 300;
    animation: cursor-blink 0.8s step-end infinite;
}
@keyframes cursor-blink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0; }
}

/* Chat progress bar (download ring simulation) */
.chat-progress-bar {
    width: 100%;
    height: 4px;
    background: rgba(255, 255, 255, 0.06);
    border-radius: 2px;
    margin-top: 6px;
    overflow: hidden;
}
.chat-progress-fill {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, #60a5fa, #a78bfa);
    border-radius: 2px;
}

.hide-scrollbar::-webkit-scrollbar { display: none; }
.hide-scrollbar { -ms-overflow-style: none; scrollbar-width: none; }

/* ---------- Direction Arrow ---------- */
.direction-arrow {
    transition: all 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

/* ---------- Command Buttons ---------- */
.cmd-btn {
    transition: all 0.2s ease;
}
.cmd-btn:active:not(:disabled) {
    transform: scale(0.92);
}
.cmd-btn:disabled {
    opacity: 0.3;
    cursor: not-allowed;
    transform: none !important;
}

/* ---------- Mic Button ---------- */
@keyframes mic-pulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(100, 140, 255, 0.4); }
    70% { box-shadow: 0 0 0 16px rgba(100, 140, 255, 0); }
}

.mic-active {
    animation: mic-pulse 1.5s infinite;
    background: rgba(100, 140, 255, 0.15) !important;
}

/* ---------- Connect Button States ---------- */
.btn-connected {
    background: rgba(254, 226, 226, 0.5);  /* bg-red-50/50 equivalent */
}
