:root {
    --bg-dark: #020608;
    --primary-cyan: #00EAFF;
    --secondary-cyan: #00A8BB;
    --text-light: #E9FEFF;
    --text-muted: #72969C;
    --danger-red: #FF3366;
    --glass-bg: rgba(0, 234, 255, 0.05);
    --glass-border: rgba(0, 234, 255, 0.2);
    --font-display: 'Orbitron', sans-serif;
    --font-body: 'Rajdhani', sans-serif;
}

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

body {
    background-color: var(--bg-dark);
    color: var(--text-light);
    font-family: var(--font-body);
    height: 100vh;
    overflow: hidden;
    background-image: 
        radial-gradient(circle at center, rgba(0, 234, 255, 0.03) 0%, transparent 60%),
        linear-gradient(rgba(2, 6, 8, 0.9), rgba(2, 6, 8, 0.9)),
        url('data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMjAiIGhlaWdodD0iMjAiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PGNpcmNsZSBjeD0iMiIgY3k9IjIiIHI9IjEiIGZpbGw9IiMwMEVBRkYiIGZpbGwtb3BhY2l0eT0iMC4wNSIvPjwvc3ZnPg==');
}

/* Glassmorphism HUD Container */
.hud-container {
    display: flex;
    flex-direction: column;
    height: 100vh;
    padding: 20px 40px;
}

/* Header */
.hud-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--glass-border);
    padding-bottom: 15px;
    margin-bottom: 20px;
}

.logo-area {
    display: flex;
    align-items: center;
    gap: 15px;
}

.logo-icon {
    width: 40px;
    height: 40px;
    border: 2px solid var(--primary-cyan);
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 20px;
    color: var(--primary-cyan);
    box-shadow: 0 0 10px var(--primary-cyan);
}

.logo-text h1 {
    font-family: var(--font-display);
    font-size: 24px;
    letter-spacing: 3px;
    color: var(--text-light);
    text-shadow: 0 0 8px rgba(0, 234, 255, 0.5);
}

.logo-text span {
    font-size: 12px;
    color: var(--secondary-cyan);
    letter-spacing: 2px;
}

.system-status {
    text-align: right;
    font-family: var(--font-display);
}

.status-indicator {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    color: var(--primary-cyan);
    margin-bottom: 5px;
}

.dot {
    width: 8px;
    height: 8px;
    background-color: var(--primary-cyan);
    border-radius: 50%;
    box-shadow: 0 0 8px var(--primary-cyan);
}

.blinking {
    animation: blink 2s infinite;
}

.clock {
    font-size: 20px;
    letter-spacing: 2px;
}

/* Main Layout Grid */
.main-layout {
    display: flex;
    flex: 1;
    gap: 40px;
    overflow: hidden;
}

/* Left Panel - Core Section */
.core-section {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    border: 1px solid var(--glass-border);
    background: var(--glass-bg);
    border-radius: 20px;
    backdrop-filter: blur(10px);
    position: relative;
}

/* AI Core Animations */
.ai-core-container {
    width: 250px;
    height: 250px;
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
    margin-bottom: 40px;
}

.ring {
    position: absolute;
    border-radius: 50%;
    border: 2px solid transparent;
}

.outer-ring {
    width: 250px;
    height: 250px;
    border-top: 2px solid var(--primary-cyan);
    border-bottom: 2px solid var(--secondary-cyan);
    animation: rotate 10s linear infinite;
}

.middle-ring {
    width: 200px;
    height: 200px;
    border-left: 2px dashed var(--primary-cyan);
    border-right: 2px dashed var(--primary-cyan);
    animation: rotate-reverse 7s linear infinite;
}

.inner-ring {
    width: 150px;
    height: 150px;
    border-top: 3px solid rgba(0, 234, 255, 0.8);
    animation: rotate 4s linear infinite;
}

.core-center {
    width: 100px;
    height: 100px;
    background: radial-gradient(circle, rgba(0,234,255,0.4) 0%, rgba(0,0,0,0) 70%);
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    box-shadow: 0 0 30px var(--primary-cyan);
    animation: breathe 3s ease-in-out infinite;
}

.core-symbol {
    font-family: var(--font-display);
    font-size: 40px;
    color: var(--text-light);
    text-shadow: 0 0 15px var(--primary-cyan);
    font-weight: 900;
}

/* Status Text */
.status-display {
    text-align: center;
    margin-bottom: 40px;
    height: 60px;
}

.status-display h2 {
    font-family: var(--font-display);
    font-size: 28px;
    letter-spacing: 4px;
    color: var(--primary-cyan);
    text-shadow: 0 0 10px var(--primary-cyan);
}

.status-display p {
    color: var(--text-muted);
    font-size: 14px;
    letter-spacing: 1px;
    margin-top: 5px;
}

/* Microphone Button */
.mic-button {
    background: rgba(0, 234, 255, 0.1);
    border: 1px solid var(--primary-cyan);
    color: var(--primary-cyan);
    width: 70px;
    height: 70px;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 0 15px rgba(0, 234, 255, 0.2);
    display: flex;
    justify-content: center;
    align-items: center;
}

.mic-button:hover {
    background: rgba(0, 234, 255, 0.3);
    box-shadow: 0 0 25px var(--primary-cyan);
    transform: scale(1.05);
}

/* State Modifiers for Core */
/* READY */
.state-ready .outer-ring { animation-duration: 10s; }
.state-ready .core-center { animation: breathe 3s infinite; box-shadow: 0 0 20px var(--primary-cyan); }

/* LISTENING */
.state-listening .outer-ring { animation-duration: 4s; border-color: var(--primary-cyan); }
.state-listening .middle-ring { animation-duration: 3s; border-color: var(--text-light); }
.state-listening .core-center { animation: pulse-fast 1s infinite; box-shadow: 0 0 40px var(--primary-cyan); }
.state-listening ~ .mic-button { background: var(--primary-cyan); color: var(--bg-dark); }

/* THINKING */
.state-thinking .outer-ring { animation-duration: 1.5s; border-color: var(--secondary-cyan); }
.state-thinking .middle-ring { animation-duration: 1s; }
.state-thinking .inner-ring { animation-duration: 0.5s; }
.state-thinking .core-center { animation: breathe 1s infinite; opacity: 0.7; }

/* SPEAKING */
.state-speaking .outer-ring { animation-duration: 6s; }
.state-speaking .core-center { animation: pulse-voice 0.3s infinite alternate; box-shadow: 0 0 50px var(--primary-cyan); }

/* ERROR */
.state-error .outer-ring, .state-error .middle-ring, .state-error .inner-ring { border-color: var(--danger-red); }
.state-error .core-center { background: radial-gradient(circle, rgba(255,51,102,0.4) 0%, rgba(0,0,0,0) 70%); box-shadow: 0 0 30px var(--danger-red); }
.state-error .core-symbol { text-shadow: 0 0 15px var(--danger-red); }

/* Right Panel - Chat Section */
.chat-section {
    flex: 1;
    display: flex;
    flex-direction: column;
    border: 1px solid var(--glass-border);
    background: var(--glass-bg);
    border-radius: 20px;
    backdrop-filter: blur(10px);
    overflow: hidden;
}

.chat-header {
    padding: 20px;
    border-bottom: 1px solid var(--glass-border);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.chat-header h3 {
    font-family: var(--font-display);
    font-size: 16px;
    letter-spacing: 2px;
    color: var(--secondary-cyan);
}

.clear-button {
    background: transparent;
    border: 1px solid var(--text-muted);
    color: var(--text-muted);
    padding: 5px 10px;
    font-family: var(--font-display);
    font-size: 10px;
    cursor: pointer;
    border-radius: 4px;
    transition: 0.3s;
}

.clear-button:hover {
    border-color: var(--danger-red);
    color: var(--danger-red);
}

.chat-history {
    flex: 1;
    padding: 20px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 15px;
}

/* Scrollbar styling */
.chat-history::-webkit-scrollbar { width: 6px; }
.chat-history::-webkit-scrollbar-track { background: transparent; }
.chat-history::-webkit-scrollbar-thumb { background: var(--secondary-cyan); border-radius: 10px; }

.message {
    display: flex;
    gap: 15px;
    max-width: 85%;
}

.user-msg {
    align-self: flex-end;
    flex-direction: row-reverse;
}

.syawal-msg {
    align-self: flex-start;
}

.avatar {
    width: 35px;
    height: 35px;
    border-radius: 5px;
    display: flex;
    justify-content: center;
    align-items: center;
    font-family: var(--font-display);
    font-weight: 700;
    flex-shrink: 0;
}

.user-msg .avatar {
    background: rgba(233, 254, 255, 0.1);
    border: 1px solid var(--text-muted);
    color: var(--text-light);
}

.syawal-msg .avatar {
    background: rgba(0, 234, 255, 0.1);
    border: 1px solid var(--primary-cyan);
    color: var(--primary-cyan);
    box-shadow: 0 0 10px rgba(0, 234, 255, 0.3);
}

.bubble {
    background: rgba(0, 0, 0, 0.5);
    padding: 12px 18px;
    border-radius: 10px;
    border: 1px solid rgba(255,255,255,0.05);
    font-size: 16px;
    line-height: 1.5;
}

.user-msg .bubble {
    border-top-right-radius: 0;
    border-color: var(--text-muted);
}

.syawal-msg .bubble {
    border-top-left-radius: 0;
    border-color: var(--glass-border);
    color: var(--primary-cyan);
}

/* Input Area */
.chat-input-area {
    padding: 20px;
    border-top: 1px solid var(--glass-border);
    display: flex;
    gap: 10px;
}

.chat-input-area input {
    flex: 1;
    background: rgba(0,0,0,0.4);
    border: 1px solid var(--glass-border);
    padding: 12px 20px;
    border-radius: 8px;
    color: var(--text-light);
    font-family: var(--font-body);
    font-size: 16px;
    outline: none;
    transition: 0.3s;
}

.chat-input-area input:focus {
    border-color: var(--primary-cyan);
    box-shadow: 0 0 10px rgba(0, 234, 255, 0.2);
}

.send-button {
    background: rgba(0, 234, 255, 0.1);
    border: 1px solid var(--primary-cyan);
    color: var(--primary-cyan);
    padding: 0 25px;
    border-radius: 8px;
    font-family: var(--font-display);
    font-weight: 700;
    cursor: pointer;
    transition: 0.3s;
}

.send-button:hover {
    background: var(--primary-cyan);
    color: var(--bg-dark);
    box-shadow: 0 0 15px var(--primary-cyan);
}

/* Keyframes */
@keyframes rotate { 100% { transform: rotate(360deg); } }
@keyframes rotate-reverse { 100% { transform: rotate(-360deg); } }
@keyframes breathe { 0%, 100% { transform: scale(1); opacity: 1; } 50% { transform: scale(1.05); opacity: 0.8; } }
@keyframes blink { 0%, 100% { opacity: 1; } 50% { opacity: 0.3; } }
@keyframes pulse-fast { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.15); } }
@keyframes pulse-voice { 0% { transform: scale(1); opacity: 0.8; } 100% { transform: scale(1.2); opacity: 1; } }

/* Responsive */
@media (max-width: 900px) {
    .main-layout { flex-direction: column; overflow-y: auto; padding-bottom: 20px; }
    .core-section { min-height: 450px; flex: none; }
    .chat-section { min-height: 500px; flex: none; }
    body { overflow-y: auto; }
}
