/* MeetLingo — Visual polish layer */

:root {
  --bg: #050810;
  --surface: rgba(14, 20, 36, 0.82);
  --surface-2: rgba(22, 31, 53, 0.9);
  --surface-3: #1c2844;
  --border: rgba(148, 163, 184, 0.12);
  --border-strong: rgba(148, 163, 184, 0.22);
  --text: #f8fafc;
  --text-muted: #94a3b8;
  --accent: #3b82f6;
  --accent-2: #8b5cf6;
  --accent-glow: rgba(59, 130, 246, 0.45);
  --tr-color: #fcd34d;
  --radius: 16px;
  --radius-lg: 20px;
  --shadow-card: 0 4px 24px rgba(0, 0, 0, 0.35), 0 0 0 1px rgba(255, 255, 255, 0.04) inset;
  --glass: rgba(255, 255, 255, 0.03);
}

body {
  font-family: 'Plus Jakarta Sans', system-ui, -apple-system, sans-serif;
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}

/* Ambient background */
.ambient-bg {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
}

.ambient-orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  opacity: 0.45;
}

.ambient-orb-1 {
  width: 520px;
  height: 520px;
  top: -180px;
  left: -120px;
  background: radial-gradient(circle, rgba(59, 130, 246, 0.35) 0%, transparent 70%);
  animation: floatOrb1 18s ease-in-out infinite;
}

.ambient-orb-2 {
  width: 480px;
  height: 480px;
  bottom: -160px;
  right: -100px;
  background: radial-gradient(circle, rgba(139, 92, 246, 0.28) 0%, transparent 70%);
  animation: floatOrb2 22s ease-in-out infinite;
}

.ambient-grid {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.02) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.02) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: radial-gradient(ellipse 80% 60% at 50% 30%, black 20%, transparent 100%);
}

@keyframes floatOrb1 {
  0%, 100% { transform: translate(0, 0); }
  50% { transform: translate(30px, 20px); }
}

@keyframes floatOrb2 {
  0%, 100% { transform: translate(0, 0); }
  50% { transform: translate(-25px, -15px); }
}

.app {
  position: relative;
  z-index: 1;
  padding: 1.25rem 1.5rem;
  gap: 1.15rem;
}

/* Header */
.header {
  padding-bottom: 0.25rem;
}

.brand-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.brand-badge {
  font-size: 0.62rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding: 0.15rem 0.45rem;
  border-radius: 999px;
  background: rgba(59, 130, 246, 0.15);
  color: #93c5fd;
  border: 1px solid rgba(59, 130, 246, 0.25);
}

.logo {
  width: 48px;
  height: 48px;
  border-radius: 14px;
  box-shadow: 0 8px 28px var(--accent-glow);
}

.header h1 {
  font-size: 1.4rem;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.subtitle {
  font-size: 0.82rem;
  margin-top: 0.1rem;
}

/* Glass language bar */
.glass-panel {
  background: var(--surface);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 0.65rem 0.85rem;
  box-shadow: var(--shadow-card);
}

.lang-select-box {
  background: rgba(255, 255, 255, 0.04);
  border-color: var(--border);
  transition: border-color 0.2s, box-shadow 0.2s;
}

.lang-select-box:focus-within {
  border-color: rgba(59, 130, 246, 0.45);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.12);
}

.btn-swap {
  background: rgba(255, 255, 255, 0.04);
  transition: all 0.2s;
}

.btn-swap:hover:not(:disabled) {
  background: rgba(59, 130, 246, 0.12);
  transform: rotate(180deg);
}

/* Workspace — unified main card */
.workspace-card {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  background: var(--surface);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
  overflow: hidden;
}

.workspace-divider {
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--border-strong), transparent);
  flex-shrink: 0;
}

.translation-panel,
.coach-panel {
  background: transparent;
  border: none;
  border-radius: 0;
  border-left: none;
  box-shadow: none;
}

.translation-panel {
  padding: 1.35rem 1.75rem 1.25rem;
}

.coach-panel {
  padding: 1.25rem 1.75rem 1.5rem;
}

.panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.65rem;
}

.panel-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  padding: 0.35rem 0.7rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border);
  color: var(--text-muted);
}

.panel-badge-live .pulse-dot {
  width: 8px;
  height: 8px;
}

.panel-badge-live.listening {
  color: #86efac;
  border-color: rgba(34, 197, 94, 0.35);
  background: rgba(34, 197, 94, 0.08);
}

.panel-label {
  margin-bottom: 0.85rem;
  font-size: 0.82rem;
}

.translation-display {
  min-height: 130px;
  padding: 0.5rem 0;
}

.translation-target {
  font-weight: 700;
  letter-spacing: -0.02em;
  text-shadow: 0 2px 24px rgba(252, 211, 77, 0.15);
}

.translation-target.loading {
  animation: shimmer 1.2s ease-in-out infinite;
}

@keyframes shimmer {
  0%, 100% { opacity: 0.45; }
  50% { opacity: 0.85; }
}

/* Coach panel */
.coach-title {
  align-items: flex-start;
  width: 100%;
  gap: 0.75rem;
}

.coach-title #coachSource {
  margin-left: auto;
  align-self: flex-start;
}

.coach-icon-wrap {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  background: rgba(139, 92, 246, 0.15);
  color: #c4b5fd;
  flex-shrink: 0;
}

.coach-title h3 {
  font-size: 0.95rem;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.coach-title .coach-desc {
  margin-top: 0.15rem;
  font-size: 0.78rem;
}

.coach-question-wrap {
  background: rgba(139, 92, 246, 0.06);
  border: 1px solid rgba(139, 92, 246, 0.15);
}

.coach-empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 2rem 1.5rem;
  gap: 0.5rem;
  min-height: 140px;
}

.coach-empty-icon {
  font-size: 2rem;
  opacity: 0.7;
  margin-bottom: 0.25rem;
}

.coach-empty-state strong {
  font-size: 0.9rem;
  color: var(--text);
}

.coach-empty-state p {
  font-size: 0.8rem;
  color: var(--text-muted);
  max-width: 280px;
  line-height: 1.5;
}

.coach-answer {
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.03);
  transition: transform 0.15s, border-color 0.15s;
}

.coach-answer:hover {
  transform: translateY(-1px);
  border-color: rgba(168, 85, 247, 0.35);
}

/* Sidebar */
.sidebar-tabs {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 0.3rem;
  gap: 0.25rem;
}

.tab-btn {
  border: none;
  background: transparent;
  border-radius: 8px;
  font-weight: 600;
  transition: all 0.2s;
}

.tab-btn:hover:not(.active) {
  background: rgba(255, 255, 255, 0.04);
  color: var(--text);
}

.tab-btn.active {
  color: white;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  box-shadow: 0 4px 16px rgba(59, 130, 246, 0.35);
}

.control-card {
  background: var(--surface);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-card);
  transition: border-color 0.2s;
}

.control-card:hover {
  border-color: var(--border-strong);
}

.control-card h3 {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.08em;
}

/* Profile preview card */
.profile-preview {
  display: flex;
  gap: 0.85rem;
  align-items: flex-start;
}

.profile-avatar {
  width: 44px;
  height: 44px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  font-weight: 800;
  color: white;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  border-radius: 12px;
  box-shadow: 0 4px 14px var(--accent-glow);
}

.profile-preview-body {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.profile-preview-body strong {
  font-size: 0.95rem;
  font-weight: 700;
}

.profile-card {
  border-left: 3px solid var(--accent);
}

.cv-analyzer {
  border-left: 3px solid var(--success);
}

/* Custom toggles */
.toggle-row {
  position: relative;
  padding: 0.65rem 0;
  border-bottom: 1px solid var(--border);
}

.toggle-row:last-child {
  border-bottom: none;
}

.toggle-row input[type="checkbox"] {
  appearance: none;
  width: 42px;
  height: 24px;
  background: var(--surface-3);
  border-radius: 999px;
  border: 1px solid var(--border);
  cursor: pointer;
  position: relative;
  transition: background 0.2s, border-color 0.2s;
  flex-shrink: 0;
}

.toggle-row input[type="checkbox"]::before {
  content: '';
  position: absolute;
  top: 2px;
  left: 2px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: white;
  transition: transform 0.2s;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.toggle-row input[type="checkbox"]:checked {
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  border-color: transparent;
}

.toggle-row input[type="checkbox"]:checked::before {
  transform: translateX(18px);
}

.slider-row input[type="range"] {
  accent-color: var(--accent);
  width: 100px;
}

.radio-option:has(input:checked) {
  background: rgba(59, 130, 246, 0.1);
  border-color: rgba(59, 130, 246, 0.3);
}

/* Inputs & buttons */
.input-field {
  background: rgba(255, 255, 255, 0.04);
  border-color: var(--border);
  border-radius: 10px;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.input-field:focus {
  border-color: rgba(59, 130, 246, 0.5);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.12);
}

.btn-primary {
  border-radius: 10px;
  box-shadow: 0 4px 16px var(--accent-glow);
  transition: transform 0.15s, box-shadow 0.15s;
}

.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 22px var(--accent-glow);
}

.btn-secondary,
.btn-danger-outline {
  border-radius: 10px;
}

/* Footer action bar */
.action-bar {
  padding-top: 0.5rem;
}

.action-bar-inner {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.85rem;
  padding: 0.65rem 1rem;
  background: var(--surface);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--border);
  border-radius: 999px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
  max-width: 520px;
  margin: 0 auto;
  width: 100%;
}

.btn-listen {
  border-radius: 999px;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.btn-listen:not(.listening) {
  animation: listenGlow 3s ease-in-out infinite;
}

@keyframes listenGlow {
  0%, 100% { box-shadow: 0 4px 24px var(--accent-glow); }
  50% { box-shadow: 0 6px 36px rgba(139, 92, 246, 0.45); }
}

.btn-clear {
  border-radius: 999px;
  font-weight: 600;
}

/* Toast */
.toast {
  border-radius: 12px;
  backdrop-filter: blur(12px);
}

/* Scrollbars global */
* {
  scrollbar-width: thin;
  scrollbar-color: var(--border-strong) transparent;
}

/* Mobile polish */
@media (max-width: 768px) {
  .workspace-card {
    border-radius: 14px;
  }

  .translation-panel {
    padding: 0.9rem 1rem 0.75rem;
    border-radius: 14px 14px 0 0;
  }

  .coach-panel {
    padding: 0.85rem 1rem 1rem;
    border-radius: 0 0 14px 14px;
  }

  .workspace-divider {
    margin: 0;
  }

  .coach-title {
    flex-wrap: wrap;
  }

  .coach-title #coachSource {
    margin-left: 0;
    width: 100%;
  }

  .action-bar-inner {
    border-radius: 14px;
    max-width: none;
    padding: 0.5rem 0.65rem;
  }

  .glass-panel {
    padding: 0.5rem 0.65rem;
    border-radius: 12px;
  }

  .brand-badge {
    display: none;
  }
}
