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

:root {
  --primary: #d6336c;
  --primary-light: #f06595;
  --primary-dark: #a61e4d;
  --primary-bg: rgba(214, 51, 108, 0.08);
  --primary-glow: rgba(214, 51, 108, 0.3);
  --bg: #fafafa;
  --surface: #ffffff;
  --surface-hover: #f5f5f5;
  --border: #e8e8e8;
  --border-light: #f0f0f0;
  --green: #2ecc71;
  --red: #e74c3c;
  --text: #1a1a2e;
  --text-secondary: #555;
  --text-muted: #999;
  --radius: 14px;
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.06);
  --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.08);
  --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.12);
}

body {
  font-family: 'Inter', -apple-system, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100dvh;
  overflow: hidden;
}

.app {
  display: flex;
  flex-direction: column;
  height: 100dvh;
}

/* Header */
.header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  height: 60px;
  background: var(--primary);
  color: white;
  box-shadow: 0 2px 12px rgba(214, 51, 108, 0.3);
  z-index: 10;
}

.header-left {
  display: flex;
  align-items: center;
  gap: 32px;
}

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

.logo-icon {
  font-size: 28px;
  color: white;
}

.logo h1 {
  font-size: 22px;
  font-weight: 800;
  color: white;
  letter-spacing: -0.5px;
}

.nav {
  display: flex;
  gap: 4px;
}

.nav-link {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.75);
  text-decoration: none;
  transition: all 0.2s;
}

.nav-link .material-icons-round {
  font-size: 18px;
}

.nav-link:hover {
  background: rgba(255, 255, 255, 0.15);
  color: white;
}

.nav-link.active {
  background: rgba(255, 255, 255, 0.2);
  color: white;
  font-weight: 600;
}

.header-right {
  display: flex;
  align-items: center;
  gap: 12px;
}

.status {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px;
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.15);
  font-size: 12px;
  color: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(4px);
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.5);
  transition: all 0.3s;
}

.status.listening .status-dot {
  background: #2ecc71;
  box-shadow: 0 0 8px rgba(46, 204, 113, 0.6);
  animation: pulse-dot 1.5s ease infinite;
}

.status.processing .status-dot {
  background: #f1c40f;
  animation: pulse-dot 0.8s ease infinite;
}

.status.speaking .status-dot {
  background: #2ecc71;
  box-shadow: 0 0 8px rgba(46, 204, 113, 0.6);
  animation: pulse-dot 1s ease infinite;
}

@keyframes pulse-dot {

  0%,
  100% {
    opacity: 1;
  }

  50% {
    opacity: 0.4;
  }
}

/* Main */
.main {
  display: flex;
  flex: 1;
  overflow: hidden;
}

/* Recipe Panel */
.recipe-panel {
  width: 380px;
  min-width: 380px;
  border-right: 1px solid var(--border);
  overflow-y: auto;
  padding: 20px;
  background: var(--bg);
}

.recipe-panel::-webkit-scrollbar {
  width: 4px;
}

.recipe-panel::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 4px;
}

.recipe-card {
  background: var(--surface);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-md);
  border: 1px solid var(--border-light);
}

.recipe-header {
  padding: 24px;
  background: linear-gradient(135deg, var(--primary), var(--primary-light));
  color: white;
}

.recipe-badge {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.2);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 1px;
  margin-bottom: 12px;
}

.recipe-header h2 {
  font-size: 18px;
  font-weight: 700;
  margin-bottom: 14px;
}

.recipe-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  font-size: 12px;
}

.recipe-meta span {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.15);
}

.recipe-meta .material-icons-round {
  font-size: 14px;
}

.recipe-body {
  padding: 0;
}

.recipe-section {
  padding: 20px 24px;
  border-bottom: 1px solid var(--border-light);
}

.recipe-section:last-child {
  border-bottom: none;
}

.recipe-section h3 {
  font-size: 14px;
  font-weight: 700;
  margin-bottom: 14px;
  color: var(--primary);
  display: flex;
  align-items: center;
  gap: 8px;
}

.recipe-section h3 .material-icons-round {
  font-size: 20px;
}

.ingredient-group {
  margin-bottom: 14px;
}

.ingredient-group:last-child {
  margin-bottom: 0;
}

.ingredient-group h4 {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-muted);
  margin-bottom: 8px;
}

.ingredient-group ul {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.ingredient-group li {
  font-size: 13px;
  color: var(--text-secondary);
  padding: 5px 0 5px 20px;
  position: relative;
}

.ingredient-group li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--primary-bg);
  border: 2px solid var(--primary-light);
}

.steps {
  list-style: none;
  counter-reset: step;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.steps li {
  counter-increment: step;
  font-size: 13px;
  line-height: 1.7;
  color: var(--text-secondary);
  padding-left: 36px;
  position: relative;
}

.steps li::before {
  content: counter(step);
  position: absolute;
  left: 0;
  top: 0;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--primary);
  color: white;
  font-size: 12px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
}

.recipe-tip {
  display: flex;
  gap: 12px;
  padding: 16px 24px;
  background: #fff8e1;
  border-top: 1px solid #ffe082;
  align-items: flex-start;
}

.recipe-tip .material-icons-round {
  color: #f9a825;
  font-size: 22px;
  flex-shrink: 0;
  margin-top: 2px;
}

.recipe-tip strong {
  font-size: 12px;
  font-weight: 700;
  color: #e65100;
  display: block;
  margin-bottom: 4px;
}

.recipe-tip p {
  font-size: 12px;
  color: #795548;
  line-height: 1.5;
}

/* Chat Panel */
.chat-panel {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: #f8f8fa;
}

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

.chat-messages::-webkit-scrollbar {
  width: 4px;
}

.chat-messages::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 4px;
}

/* Messages */
.message {
  display: flex;
  gap: 12px;
  max-width: 80%;
  animation: fadeSlideUp 0.3s ease;
}

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

.message-avatar {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  box-shadow: var(--shadow-sm);
}

.message.chef .message-avatar {
  background: var(--primary);
  color: white;
}

.message.chef .message-avatar .material-icons-round {
  font-size: 20px;
}

.message.user .message-avatar {
  background: #e8e8e8;
  color: var(--text);
}

.message.user .message-avatar .material-icons-round {
  font-size: 20px;
}

.message-content {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.message-name {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.message.chef .message-name {
  color: var(--primary);
}

.message.user .message-name {
  color: var(--text-muted);
  text-align: right;
}

.message-bubble {
  padding: 14px 18px;
  border-radius: 16px;
  font-size: 14px;
  line-height: 1.6;
}

.message.chef .message-bubble {
  background: var(--surface);
  border: 1px solid var(--border);
  border-top-left-radius: 4px;
  box-shadow: var(--shadow-sm);
}

.message.user .message-bubble {
  background: var(--primary);
  color: white;
  border-top-right-radius: 4px;
  box-shadow: 0 2px 8px rgba(214, 51, 108, 0.25);
}

.message-bubble p {
  color: inherit;
}

.message.chef .message-bubble p {
  color: var(--text-secondary);
}

/* Typing */
.message.thinking .message-bubble {
  display: flex;
  gap: 6px;
  padding: 16px 22px;
}

.typing-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--text-muted);
  animation: typingBounce 1.4s ease infinite;
}

.typing-dot:nth-child(2) {
  animation-delay: 0.2s;
}

.typing-dot:nth-child(3) {
  animation-delay: 0.4s;
}

@keyframes typingBounce {

  0%,
  60%,
  100% {
    transform: translateY(0);
    opacity: 0.4;
  }

  30% {
    transform: translateY(-8px);
    opacity: 1;
  }
}

/* Transcript Bar */
.transcript-bar {
  padding: 10px 24px;
  border-top: 1px solid var(--border);
  background: var(--surface);
  display: none;
  gap: 10px;
  align-items: center;
  min-height: 44px;
}

.transcript-bar.active {
  display: flex;
}

.transcript-icon {
  font-size: 18px;
  color: var(--green);
}

.transcript-text {
  font-size: 13px;
  color: var(--text-secondary);
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Mic control / Chat input */
.chat-input-area {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding: 16px;
  border-top: 1px solid var(--border);
  background: var(--surface);
  box-shadow: 0 -2px 8px rgba(0, 0, 0, 0.03);
}

.mic-btn {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  border: none;
  background: var(--primary);
  color: white;
  cursor: pointer;
  transition: all 0.3s ease;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 16px rgba(214, 51, 108, 0.35);
}

.mic-btn:hover:not(:disabled) {
  transform: scale(1.08);
  box-shadow: 0 6px 24px rgba(214, 51, 108, 0.45);
}

.mic-btn:disabled {
  background: #ccc;
  box-shadow: none;
  cursor: not-allowed;
}

.mic-btn.active {
  background: var(--red);
  box-shadow: 0 4px 20px rgba(231, 76, 60, 0.4);
  animation: mic-pulse 2s ease infinite;
}

@keyframes mic-pulse {

  0%,
  100% {
    box-shadow: 0 4px 20px rgba(231, 76, 60, 0.4);
  }

  50% {
    box-shadow: 0 4px 32px rgba(231, 76, 60, 0.6), 0 0 0 12px rgba(231, 76, 60, 0.1);
  }
}

.mic-icon {
  width: 26px;
  height: 26px;
  z-index: 1;
}

.mic-btn.active .mic-icon {
  display: none;
}

.mic-waves {
  display: none;
  align-items: center;
  gap: 3px;
  height: 26px;
}

.mic-btn.active .mic-waves {
  display: flex;
}

.mic-waves span {
  width: 3px;
  border-radius: 3px;
  background: white;
  animation: wave 0.8s ease-in-out infinite;
}

.mic-waves span:nth-child(1) {
  height: 12px;
  animation-delay: 0s;
}

.mic-waves span:nth-child(2) {
  height: 20px;
  animation-delay: 0.1s;
}

.mic-waves span:nth-child(3) {
  height: 26px;
  animation-delay: 0.2s;
}

.mic-waves span:nth-child(4) {
  height: 20px;
  animation-delay: 0.3s;
}

.mic-waves span:nth-child(5) {
  height: 12px;
  animation-delay: 0.4s;
}

@keyframes wave {

  0%,
  100% {
    transform: scaleY(0.5);
  }

  50% {
    transform: scaleY(1);
  }
}

.mic-hint {
  font-size: 12px;
  color: var(--text-muted);
  font-weight: 500;
}

/* Animations */
@keyframes fadeSlideUp {
  from {
    opacity: 0;
    transform: translateY(12px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Responsive */
@media (max-width: 860px) {
  .main {
    flex-direction: column;
  }

  .nav {
    display: none;
  }

  .recipe-panel {
    width: 100%;
    min-width: unset;
    max-height: 30vh;
    border-right: none;
    border-bottom: 1px solid var(--border);
    padding: 12px;
    flex-shrink: 0;
  }

  .chat-panel {
    flex: 1;
    min-height: 0;
  }

  .chat-messages {
    padding: 16px;
  }

  .chat-input-area {
    padding: 12px 16px;
    padding-bottom: calc(12px + env(safe-area-inset-bottom));
    flex-shrink: 0;
  }
}
