/* Netflix-style dark theme */

*,
*::before,
*::after {
  box-sizing: border-box;
}

:root {
  --bg: #000000;
  --bg-elevated: #141414;
  --bg-elevated-soft: #181818;
  --accent: #e50914; /* Netflix red */
  --accent-soft: #f97373;
  --text: #f9fafb;
  --muted: #9ca3af;
  --border-subtle: #27272f;
  --radius-xl: 18px;
  --shadow-card: 0 24px 60px rgba(0, 0, 0, 0.8);
  --font-main: system-ui, -apple-system, BlinkMacSystemFont, "SF Pro Text",
    "Segoe UI", sans-serif;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font-main);
  background: radial-gradient(circle at top, #1f2937 0, #020617 45%, #000 100%);
  color: var(--text);
}

/* Shell */

.app-shell {
  max-width: 1120px;
  margin: 0 auto;
  padding: 20px 16px 40px;
}

/* Top nav */

.nav-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 0 4px;
}

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

.brand-mark {
  width: 26px;
  height: 26px;
  border-radius: 6px;
  background: linear-gradient(135deg, var(--accent), #ff4b81);
  box-shadow: 0 10px 25px rgba(229, 9, 20, 0.75);
}

.brand-text {
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  font-size: 0.9rem;
}

.nav-pill {
  padding: 5px 12px;
  border-radius: 999px;
  border: 1px solid rgba(156, 163, 175, 0.4);
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
}

/* Hero */

.hero {
  padding: 36px 0 24px;
}

.hero h1 {
  margin: 0 0 8px;
  font-size: 2.1rem;
}

.hero p {
  margin: 0;
  color: var(--muted);
  max-width: 520px;
}

/* Layout */

.layout {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 1.3fr);
  gap: 24px;
}

@media (max-width: 900px) {
  .layout {
    grid-template-columns: minmax(0, 1fr);
  }
}

/* Cards */

.card {
  background: radial-gradient(circle at top left, #1f2937 0, #020617 60%);
  border-radius: var(--radius-xl);
  padding: 20px 20px 18px;
  border: 1px solid rgba(148, 163, 184, 0.24);
  box-shadow: var(--shadow-card);
  position: relative;
  overflow: hidden;
}

.card::before {
  content: "";
  position: absolute;
  inset: -40%;
  opacity: 0.18;
  background: radial-gradient(
    circle at top right,
    rgba(248, 113, 113, 0.3),
    transparent 55%
  );
  pointer-events: none;
}

.card h2 {
  margin-top: 0;
  margin-bottom: 12px;
  font-size: 1.05rem;
}

/* Controls */

.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 16px;
  position: relative;
  z-index: 1;
}

.field span {
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
}

input,
select {
  padding: 9px 11px;
  border-radius: 999px;
  border: 1px solid #4b5563;
  background: rgba(15, 23, 42, 0.85);
  color: var(--text);
  outline: none;
  font-size: 0.9rem;
}

input:focus,
select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 1px rgba(229, 9, 20, 0.7);
}

/* Buttons */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border-radius: 999px;
  padding: 8px 18px;
  border: none;
  font-size: 0.9rem;
  cursor: pointer;
  transition: transform 0.08s ease, box-shadow 0.08s ease,
    background-color 0.08s ease, border-color 0.08s ease;
  position: relative;
  z-index: 1;
}

.btn-primary {
  background: var(--accent);
  color: #ffffff;
  box-shadow: 0 12px 30px rgba(229, 9, 20, 0.8);
}

.btn-primary:hover:not(:disabled) {
  background: #ff2027;
  transform: translateY(-1px);
}

.btn-secondary {
  margin-top: 12px;
  background: #374151;
  color: #f9fafb;
}

.btn-secondary:hover:not(:disabled) {
  background: #4b5563;
  transform: translateY(-1px);
}

.btn-ghost {
  background: transparent;
  color: var(--muted);
  border: 1px solid #4b5563;
}

.btn-ghost:hover:not(:disabled) {
  color: #e5e7eb;
  border-color: #9ca3af;
}

.btn:disabled {
  opacity: 0.4;
  cursor: default;
  box-shadow: none;
  transform: none;
}

/* Button row */

.controls-row {
  display: flex;
  gap: 10px;
  margin-top: 8px;
}

/* Output card */

.card-output .block {
  position: relative;
  z-index: 1;
  margin-bottom: 10px;
}

.divider {
  height: 1px;
  margin: 10px 0 12px;
  background: linear-gradient(
    to right,
    transparent,
    rgba(148, 163, 184, 0.6),
    transparent
  );
}

.mono {
  font-family: "SF Mono", ui-monospace, Menlo, Monaco, Consolas, "Liberation Mono",
    "Courier New", monospace;
  font-size: 0.9rem;
  color: #e5e7eb;
  min-height: 24px;
}

.score-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
}

.score-label {
  margin: 4px 0 0;
  font-size: 0.85rem;
  color: var(--muted);
}

.score-label span {
  font-weight: 600;
  color: var(--accent-soft);
}

.feedback-text {
  margin-top: 10px;
  font-size: 0.92rem;
  line-height: 1.5;
  color: #e5e7eb;
}

.problems-list {
  margin: 10px 0 0;
  padding-left: 18px;
  font-size: 0.88rem;
  color: #e5e7eb;
}

/* Footer */

.footer {
  margin-top: 28px;
  font-size: 0.8rem;
  color: var(--muted);
  text-align: center;
}

/* Avatar + meter */

.avatar-wrap { margin-top: 6px; margin-bottom: 18px; position: relative; z-index: 1; }

.avatar {
  width: 160px;
  height: 160px;
  border-radius: 999px;
  margin: 10px auto 10px;
  position: relative;
  border: 1px solid rgba(148, 163, 184, 0.25);
  background: radial-gradient(circle at 30% 30%, rgba(229,9,20,0.35), rgba(2,6,23,0.9));
  box-shadow: 0 30px 80px rgba(0,0,0,0.75);
  transform: translateZ(0);
  overflow: hidden;
}

.avatar-glow{
  position:absolute; inset:-20%;
  background: radial-gradient(circle at 60% 20%, rgba(229,9,20,0.40), transparent 55%);
  opacity: 0.8;
  filter: blur(8px);
}

.avatar-face{
  position:absolute; inset:0;
  display:flex; flex-direction:column;
  align-items:center; justify-content:center;
  gap: 16px;
}

.avatar-eyes span{
  display:inline-block;
  width: 10px; height: 10px;
  border-radius: 999px;
  background: rgba(255,255,255,0.9);
  margin: 0 12px;
  opacity: 0.9;
}

.avatar-mouth{
  width: 46px;
  height: 10px;
  border-radius: 999px;
  background: rgba(255,255,255,0.85);
  opacity: 0.85;
  transform-origin: center;
}

/* states */
.avatar.idle { opacity: 0.95; }
.avatar.listening { animation: pulse 1.2s infinite ease-in-out; }
.avatar.thinking { animation: shimmer 1.0s infinite linear; }
.avatar.speaking .avatar-mouth { animation: talk 0.18s infinite ease-in-out; }

@keyframes pulse {
  0% { transform: scale(1.00); box-shadow: 0 30px 80px rgba(0,0,0,0.75); }
  50% { transform: scale(1.03); box-shadow: 0 34px 90px rgba(229,9,20,0.35); }
  100% { transform: scale(1.00); }
}

@keyframes shimmer {
  0% { filter: saturate(1.0) brightness(1.0); }
  50% { filter: saturate(1.2) brightness(1.1); }
  100% { filter: saturate(1.0) brightness(1.0); }
}

@keyframes talk {
  0% { transform: scaleY(1.0); }
  50% { transform: scaleY(2.3); }
  100% { transform: scaleY(1.0); }
}

.avatar-status{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
  margin: 0 auto;
  max-width: 360px;
  color: var(--muted);
  font-size: 0.85rem;
}

.meter{
  flex:1;
  height: 10px;
  border-radius: 999px;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(148,163,184,0.2);
  overflow:hidden;
}
.meter-bar{
  height:100%;
  width:0%;
  background: linear-gradient(90deg, rgba(229,9,20,0.9), rgba(255,75,129,0.9));
  transition: width 60ms linear;
}

.avatar.listening-active .avatar-glow {
  opacity: 0.9;
  transform: scale(1.05);
}