:root {
  --primary-color: #16213e;
  --secondary-color: #0f3460;
  --accent-color: #e94560;
  --success-color: #2ecc71;
  --text-color: #f1f1f1;
  --bg-color: #1a1a2e;
  --card-bg: #16213e;
  --shadow: 0 4px 6px rgba(0, 0, 0, 0.3);
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
  background: linear-gradient(135deg, var(--bg-color) 0%, var(--primary-color) 100%);
  color: var(--text-color);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  -webkit-font-smoothing: antialiased;
}

.container {
  max-width: 600px;
  margin: 0 auto;
  padding: 20px;
  width: 100%;
}

/* Header */
header {
  text-align: center;
  margin-bottom: 40px;
  padding: 20px 0;
}

header h1 {
  font-size: 2rem;
  margin-bottom: 10px;
  font-weight: 700;
}

.status {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  background: var(--card-bg);
  border-radius: 20px;
  font-size: 0.9rem;
}

.status-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  animation: pulse 2s infinite;
}

.status-dot.online {
  background: var(--success-color);
}

.status-dot.offline {
  background: #95a5a6;
  animation: none;
}

.room-banner {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 10px;
  padding: 8px 16px;
  background: rgba(15, 52, 96, 0.6);
  border: 1px solid rgba(233, 69, 96, 0.25);
  border-radius: 20px;
  font-size: 0.9rem;
}

.room-banner .room-label {
  opacity: 0.9;
}

.room-banner .room-name {
  font-weight: 700;
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

/* Voice Section */
.voice-section {
  background: var(--card-bg);
  border-radius: 20px;
  padding: 40px 20px;
  box-shadow: var(--shadow);
  margin-bottom: 30px;
  text-align: center;
}

.voice-section.remote-active {
  padding: 20px;
}

.voice-section.remote-active .record-btn {
  width: 110px;
  height: 110px;
  margin: 0 auto 14px;
}

.record-btn {
  width: 150px;
  height: 150px;
  border-radius: 50%;
  border: none;
  background: linear-gradient(135deg, var(--accent-color), #c23750);
  color: white;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 8px 16px rgba(233, 69, 96, 0.4);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin: 0 auto 20px;
}

/* Remote Panel */
.remote-panel {
  margin: 0 auto 16px;
  padding: 14px;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.10);
}

.remote-title {
  text-align: center;
  font-size: 0.95rem;
  font-weight: 700;
  margin-bottom: 12px;
  color: rgba(241, 241, 241, 0.9);
}

.remote-dpad {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  grid-template-rows: repeat(3, 48px);
  gap: 10px;
  margin-bottom: 10px;
}

.remote-dpad .remote-btn[data-remote-button="up"] {
  grid-column: 2;
  grid-row: 1;
}

.remote-dpad .remote-btn[data-remote-button="left"] {
  grid-column: 1;
  grid-row: 2;
}

.remote-dpad .remote-btn[data-remote-button="ok"] {
  grid-column: 2;
  grid-row: 2;
}

.remote-dpad .remote-btn[data-remote-button="right"] {
  grid-column: 3;
  grid-row: 2;
}

.remote-dpad .remote-btn[data-remote-button="down"] {
  grid-column: 2;
  grid-row: 3;
}

.remote-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-bottom: 10px;
}

.remote-row:last-child {
  margin-bottom: 0;
}

.remote-btn {
  border: 1px solid rgba(255, 255, 255, 0.18);
  background: rgba(255, 255, 255, 0.06);
  color: var(--text-color);
  padding: 10px 10px;
  border-radius: 12px;
  cursor: pointer;
  font-size: 0.9rem;
  font-weight: 600;
  transition: all 0.15s ease;
  min-height: 44px;
}

.remote-btn:hover:not(:disabled) {
  background: rgba(255, 255, 255, 0.12);
  transform: translateY(-1px);
}

.remote-btn:active:not(:disabled) {
  transform: translateY(0px);
}

.remote-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.remote-ok {
  background: rgba(233, 69, 96, 0.18);
  border-color: rgba(233, 69, 96, 0.35);
}

.remote-power {
  grid-column: 1 / -1;
  background: rgba(233, 69, 96, 0.28);
  border-color: rgba(233, 69, 96, 0.55);
}

.record-btn:hover:not(:disabled) {
  transform: scale(1.05);
  box-shadow: 0 12px 24px rgba(233, 69, 96, 0.6);
}

.record-btn:active:not(:disabled) {
  transform: scale(0.95);
}

.record-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  background: #95a5a6;
}

.record-btn.recording {
  animation: recording-pulse 1.5s infinite;
  background: var(--success-color);
}

@keyframes recording-pulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.1); }
}

.mic-icon {
  width: 48px;
  height: 48px;
}

.record-text {
  font-size: 0.9rem;
  font-weight: 600;
}

.status-message {
  min-height: 30px;
  font-size: 0.95rem;
  color: #bbb;
  margin-top: 15px;
}

.status-message.processing {
  color: var(--accent-color);
  font-weight: 600;
}

.transcript-container {
  margin-top: 20px;
  padding: 20px;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 12px;
  text-align: left;
}

.transcript-label {
  font-size: 0.85rem;
  color: #bbb;
  margin-bottom: 8px;
}

.transcript {
  font-size: 1.1rem;
  color: var(--text-color);
  line-height: 1.6;
}

.clarification-container {
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.clarification-label {
  font-size: 0.85rem;
  color: #bbb;
  margin-bottom: 10px;
}

.clarification-choices {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.clarification-choice-btn {
  border: 1px solid rgba(255, 255, 255, 0.18);
  background: rgba(255, 255, 255, 0.06);
  color: var(--text-color);
  padding: 10px 12px;
  border-radius: 12px;
  cursor: pointer;
  font-size: 0.9rem;
  transition: all 0.2s ease;
}

.clarification-choice-btn:hover {
  background: rgba(255, 255, 255, 0.12);
  transform: translateY(-1px);
}

.clarification-choice-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

/* Log Section */
.log-section {
  background: var(--card-bg);
  border-radius: 20px;
  padding: 20px;
  box-shadow: var(--shadow);
  margin-bottom: 20px;
}

.log-section h2 {
  font-size: 1.3rem;
  margin-bottom: 15px;
}

.command-log {
  max-height: 300px;
  overflow-y: auto;
}

.log-empty {
  text-align: center;
  color: #bbb;
  padding: 30px;
  font-size: 0.9rem;
}

.log-item {
  background: rgba(255, 255, 255, 0.05);
  padding: 15px;
  border-radius: 10px;
  margin-bottom: 10px;
  border-left: 4px solid var(--accent-color);
}

.log-item.success {
  border-left-color: var(--success-color);
}

.log-item.error {
  border-left-color: #e74c3c;
}

.log-item-header {
  display: flex;
  justify-content: space-between;
  margin-bottom: 8px;
  font-size: 0.85rem;
  color: #bbb;
}

.log-item-transcript {
  font-size: 1rem;
  margin-bottom: 5px;
}

.log-item-intent {
  font-size: 0.9rem;
  color: #bbb;
  font-family: 'Courier New', monospace;
}

.log-item-result {
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  font-size: 0.95rem;
  color: var(--text-color);
  white-space: pre-wrap;
}

/* Footer */
footer {
  text-align: center;
  padding: 20px;
  font-size: 0.85rem;
  color: #bbb;
  margin-top: auto;
}

/* Scrollbar */
.command-log::-webkit-scrollbar {
  width: 8px;
}

.command-log::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.05);
  border-radius: 10px;
}

.command-log::-webkit-scrollbar-thumb {
  background: var(--accent-color);
  border-radius: 10px;
}

/* Mobile Responsiveness */
@media (max-width: 480px) {
  header h1 {
    font-size: 1.5rem;
  }

  .record-btn {
    width: 120px;
    height: 120px;
  }

  .mic-icon {
    width: 36px;
    height: 36px;
  }
}

