:root {
  --background: #101415;
  --surface-container-lowest: #0b0f10;
  --surface-container-low: #191c1e;
  --surface-container: #1d2022;
  --surface-container-high: #272a2c;
  --on-surface: #e0e3e5;
  --on-surface-variant: #c5c5d3;
  --outline: #8f909d;
  --outline-variant: #444651;
  --primary: #b6c4ff;
  --primary-container: #1e3a8a;
  --secondary: #e0b6ff;
  --secondary-container: #632892;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  min-height: 100%;
}

body {
  background: var(--background);
  color: var(--on-surface);
  font-family: 'Inter', sans-serif;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

.material-symbols-outlined {
  font-family: 'Material Symbols Outlined';
  font-weight: normal;
  font-style: normal;
  line-height: 1;
  display: inline-block;
}

.icon { font-size: 20px; color: var(--outline-variant); }
.icon-sm { font-size: 18px; }
.hidden { display: none !important; }

/* Header */
.topbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 50;
  background: rgba(16, 20, 21, 0.8);
  backdrop-filter: blur(20px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}
.topbar__inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px;
  height: 80px;
  display: flex;
  align-items: center;
}
.brand-group { display: flex; align-items: center; gap: 10px; }
.logo-icon { width: 32px; height: 32px; object-fit: contain; border-radius: 6px; }
.brand { font-size: 1.4rem; font-weight: 700; letter-spacing: -0.02em; }
.brand--sm { font-size: 1.1rem; }

/* Hero */
.hero {
  flex: 1;
  position: relative;
  overflow: hidden;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 140px 24px 96px;
  background: radial-gradient(circle at 50% 30%, rgba(30, 58, 138, 0.25) 0%, rgba(16, 20, 21, 1) 70%);
}
.hero__glow {
  position: absolute;
  top: 15%;
  left: 50%;
  transform: translateX(-50%);
  width: 75%;
  height: 75%;
  background: rgba(30, 58, 138, 0.2);
  border-radius: 9999px;
  filter: blur(120px);
  pointer-events: none;
}
.hero__inner {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 720px;
  display: flex;
  flex-direction: column;
  align-items: center;
}
.hero__copy { text-align: center; margin-bottom: 48px; }
.hero__title {
  font-size: 2.75rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.15;
  margin: 0 0 16px;
}
.gradient-text {
  background: linear-gradient(135deg, #b6c4ff 0%, #e0b6ff 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.hero__subtitle {
  color: var(--on-surface-variant);
  max-width: 46ch;
  margin: 0 auto;
  font-size: 1rem;
}

/* Glass panel */
.glass-panel {
  width: 100%;
  background: rgba(30, 41, 59, 0.4);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.25);
  border-radius: 12px;
  padding: 8px;
  display: flex;
  flex-wrap: wrap;
  align-items: stretch;
  gap: 8px;
  margin-bottom: 16px;
  position: relative;
}
.glass-panel__field {
  flex: 1;
  min-width: 220px;
  display: flex;
  align-items: center;
  padding-left: 16px;
}
.glass-panel__field input {
  width: 100%;
  background: transparent;
  border: none;
  outline: none;
  color: var(--on-surface);
  font-family: inherit;
  font-size: 1rem;
  padding: 16px 0;
  margin-left: 12px;
}
.glass-panel__field input::placeholder { color: var(--outline); }

.btn-primary {
  background: linear-gradient(135deg, #1e3a8a 0%, #632892 100%);
  color: white;
  border: none;
  border-radius: 8px;
  padding: 16px 32px;
  font-family: inherit;
  font-weight: 600;
  font-size: 0.9rem;
  letter-spacing: 0.02em;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: opacity 0.2s ease;
}
.btn-primary:hover { opacity: 0.9; }
.btn-primary:disabled { opacity: 0.5; cursor: not-allowed; }

/* Custom language dropdown */
.lang-dropdown {
  position: relative;
  display: flex;
  border-left: 1px solid rgba(255, 255, 255, 0.1);
}
.lang-dropdown__button {
  display: flex;
  align-items: center;
  gap: 8px;
  background: transparent;
  border: none;
  color: var(--on-surface);
  font-family: inherit;
  font-size: 0.95rem;
  padding: 16px 14px;
  cursor: pointer;
  white-space: nowrap;
}
.lang-dropdown__chevron { transition: transform 0.2s ease; color: var(--outline); }
.lang-dropdown.open .lang-dropdown__chevron { transform: rotate(180deg); }
.lang-dropdown__panel {
  list-style: none;
  margin: 0;
  padding: 6px;
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  min-width: 220px;
  max-height: 320px;
  overflow-y: auto;
  background: var(--surface-container-high);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 10px;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.4);
  z-index: 20;
}
.lang-dropdown__item {
  padding: 10px 14px;
  border-radius: 6px;
  color: var(--on-surface-variant);
  cursor: pointer;
  font-size: 0.95rem;
}
.lang-dropdown__item:hover { background: rgba(182, 196, 255, 0.12); color: var(--on-surface); }
.lang-dropdown__item.selected { background: var(--surface-container); color: var(--primary); }

.status {
  min-height: 1.4em;
  color: var(--on-surface-variant);
  font-size: 0.9rem;
  margin: 0 0 24px;
  text-align: center;
}
.status .dots span {
  opacity: 0.2;
  animation: blink 1.4s infinite;
}
.status .dots span:nth-child(2) { animation-delay: 0.2s; }
.status .dots span:nth-child(3) { animation-delay: 0.4s; }
@keyframes blink {
  0%, 80%, 100% { opacity: 0.2; }
  40% { opacity: 1; }
}

/* Actions row: download group + conspect chip */
.actions-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 16px;
  margin-bottom: 40px;
}
.download-group {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 6px 8px 6px 14px;
  border-radius: 9999px;
  background: var(--surface-container);
  border: 1px solid rgba(255, 255, 255, 0.08);
}
.download-group__label { color: var(--on-surface-variant); font-size: 0.9rem; margin-right: 4px; }
.download-group__comma { color: var(--outline); }
.pill {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: 9999px;
  background: transparent;
  border: none;
  color: var(--primary);
  font-family: inherit;
  font-size: 0.9rem;
  cursor: pointer;
  transition: background 0.2s ease;
}
.pill:hover:not(:disabled) { background: rgba(182, 196, 255, 0.12); }
.pill:disabled { opacity: 0.4; cursor: not-allowed; }

.chip {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 18px;
  border-radius: 9999px;
  background: var(--surface-container);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: var(--on-surface-variant);
  font-family: inherit;
  font-size: 0.9rem;
  cursor: pointer;
  transition: all 0.2s ease;
}
.chip:hover:not(:disabled) {
  border-color: rgba(182, 196, 255, 0.5);
  background: var(--surface-container-high);
}
.chip:disabled { opacity: 0.4; cursor: not-allowed; }
.chip--accent { border-color: rgba(182, 196, 255, 0.4); }
.chip__icon-primary { color: var(--primary); }
.chip__icon-secondary { color: var(--secondary); }

/* Result */
.result { width: 100%; margin-bottom: 24px; }
.result.hidden { display: none; }
.result--conspect { margin-top: 40px; }
.result__title {
  font-size: 1.3rem;
  font-weight: 600;
  margin: 0 0 12px;
}
.transcript-card {
  width: 100%;
  background: var(--surface-container);
  border-left: 2px solid var(--primary);
  border-radius: 8px;
  padding: 24px;
  max-height: 340px;
  overflow-y: auto;
  white-space: pre-wrap;
  color: var(--on-surface-variant);
  font-size: 0.95rem;
  line-height: 1.6;
}
.transcript-card::-webkit-scrollbar { width: 8px; }
.transcript-card::-webkit-scrollbar-thumb { background: var(--outline-variant); border-radius: 9999px; }
.transcript-card--accent { border-left-color: var(--secondary); }

.conspect-actions {
  display: flex;
  justify-content: center;
  gap: 10px;
  margin-top: 16px;
  flex-wrap: wrap;
}
.conspect-actions .pill {
  background: var(--surface-container);
  border: 1px solid rgba(255, 255, 255, 0.08);
  padding: 8px 16px;
}
.conspect-actions .pill:hover { border-color: rgba(182, 196, 255, 0.5); }

/* Markdown-предпросмотр конспекта */
.md-h1 { font-size: 1.3rem; margin: 4px 0 12px; color: var(--on-surface); }
.md-h2 { font-size: 1.1rem; margin: 16px 0 8px; color: var(--primary); }
.md-h3 { font-size: 1rem; margin: 12px 0 6px; color: var(--secondary); }
.transcript-card p { margin: 0 0 10px; }
.transcript-card ul { margin: 0 0 12px; padding-left: 20px; }
.transcript-card li { margin-bottom: 6px; }
.md-table {
  width: 100%;
  border-collapse: collapse;
  margin: 8px 0 16px;
  font-size: 0.9rem;
}
.md-table th, .md-table td {
  border: 1px solid var(--outline-variant);
  padding: 8px 10px;
  text-align: left;
}
.md-table th {
  background: var(--surface-container-high);
  color: var(--on-surface);
}

/* Footer */
.footer {
  width: 100%;
  padding: 16px 48px;
  background: var(--surface-container-lowest);
  border-top: 1px solid rgba(255, 255, 255, 0.05);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  text-align: center;
}
.footer__note { color: var(--secondary); font-size: 0.85rem; }

@media (max-width: 640px) {
  .hero__title { font-size: 2.1rem; }
  .glass-panel { flex-direction: column; }
  .lang-dropdown { border-left: none; border-top: 1px solid rgba(255,255,255,0.1); }
}

/* Кольцо прогресса при генерации конспекта */
.progress-ring {
  position: relative;
  width: 64px;
  height: 64px;
  margin: 0 auto 24px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.progress-ring__svg {
  width: 64px;
  height: 64px;
  transform: rotate(-90deg);
}
.progress-ring__bg {
  fill: none;
  stroke: var(--surface-container-high);
  stroke-width: 5;
}
.progress-ring__fg {
  fill: none;
  stroke: url(#none);
  stroke: var(--primary);
  stroke-width: 5;
  stroke-linecap: round;
  stroke-dasharray: 175.9;
  stroke-dashoffset: 175.9;
  transition: stroke-dashoffset 0.2s ease;
}
.progress-ring__label {
  position: absolute;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--on-surface);
}

.footer__note--beta {
  opacity: 0.6;
  font-size: 0.8rem;
}

.footer__social {
  color: var(--on-surface-variant);
  opacity: 0.7;
  display: inline-flex;
  margin-bottom: 4px;
  transition: opacity 0.2s ease, color 0.2s ease;
}
.footer__social:hover {
  opacity: 1;
  color: var(--primary);
}
