﻿/* Logo Theme Switching Logic */
[data-theme="dark"] .logo-dark {
  display: block;
}

[data-theme="dark"] .logo-light {
  display: none;
}

[data-theme="light"] .logo-dark {
  display: none;
}

[data-theme="light"] .logo-light {
  display: block;
}

:root {
  --bg: #0a0a0f;
  --surface: #111118;
  --surface2: #1a1a25;
  --surface3: #22223a;
  --border: rgba(139, 92, 246, 0.15);
  --border2: rgba(139, 92, 246, 0.3);
  --accent: #8b5cf6;
  --accent2: #06b6d4;
  --accent3: #f59e0b;
  --accent4: #10b981;
  --text: #f0f0ff;
  --text2: #a0a0c0;
  --text3: #606080;
  --danger: #ef4444;
  --glow: rgba(139, 92, 246, 0.4);
  --glow2: rgba(6, 182, 212, 0.3);
  --card-shadow: 0 8px 40px rgba(0, 0, 0, 0.5);
  --radius: 16px;
  --radius-sm: 8px;
  --font-display: 'Poppins', sans-serif;
  --font-body: 'Inter', sans-serif;
  --font-mono: 'JetBrains Mono', monospace;
}

[data-theme="light"] {
  --bg: #f5f3ff;
  --surface: #ffffff;
  --surface2: #ede9fe;
  --surface3: #ddd6fe;
  --border: rgba(139, 92, 246, 0.2);
  --border2: rgba(139, 92, 246, 0.4);
  --text: #1a1a2e;
  --text2: #4a4a6a;
  --text3: #8888aa;
  --glow: rgba(139, 92, 246, 0.2);
  --card-shadow: 0 8px 40px rgba(139, 92, 246, 0.1);
}

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

html {
  scroll-behavior: smooth
}

body {
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  overflow-x: hidden;
  transition: background 0.4s, color 0.4s;
}

/* ── NOISE TEXTURE OVERLAY ── */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)' opacity='0.03'/%3E%3C/svg%3E");
  pointer-events: none;
  z-index: 9999;
  opacity: 0.4;
}

/* ── SCROLLBAR ── */
::-webkit-scrollbar {
  width: 4px
}

::-webkit-scrollbar-track {
  background: var(--bg)
}

::-webkit-scrollbar-thumb {
  background: var(--accent);
  border-radius: 2px
}

/* ── PAGES ── */
.page {
  display: none;
  min-height: 100vh;
  animation: fadeSlideIn 0.5s ease forwards
}

.page.active {
  display: flex;
  flex-direction: column
}

@keyframes fadeSlideIn {
  from {
    opacity: 0;
    transform: translateY(20px)
  }

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

@keyframes spin {
  to { transform: rotate(360deg) }
}

@keyframes msgFade {
  0%,100% { opacity:1 }
  45%,55%  { opacity:0 }
}

/* ── ORBITAL BG ANIMATION ── */
.orb {
  position: fixed;
  border-radius: 50%;
  filter: blur(80px);
  pointer-events: none;
  z-index: 0;
  animation: orbFloat 8s ease-in-out infinite;
}

.orb1 {
  width: 500px;
  height: 500px;
  background: radial-gradient(circle, rgba(139, 92, 246, 0.15), transparent 70%);
  top: -100px;
  right: -100px;
  animation-delay: 0s
}

.orb2 {
  width: 400px;
  height: 400px;
  background: radial-gradient(circle, rgba(6, 182, 212, 0.1), transparent 70%);
  bottom: 0;
  left: -100px;
  animation-delay: -3s
}

.orb3 {
  width: 300px;
  height: 300px;
  background: radial-gradient(circle, rgba(245, 158, 11, 0.08), transparent 70%);
  top: 50%;
  left: 50%;
  animation-delay: -6s
}

@keyframes orbFloat {

  0%,
  100% {
    transform: translate(0, 0) scale(1)
  }

  33% {
    transform: translate(30px, -20px) scale(1.05)
  }

  66% {
    transform: translate(-20px, 30px) scale(0.95)
  }
}

/* ── GLASS CARD ── */
.glass {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  backdrop-filter: blur(20px);
  box-shadow: var(--card-shadow);
}

.glass-heavy {
  background: rgba(17, 17, 24, 0.85);
  border: 1px solid var(--border2);
  backdrop-filter: blur(40px);
}

[data-theme="light"] .glass-heavy {
  background: rgba(255, 255, 255, 0.85)
}

/* ── BUTTONS ── */
.btn {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 0.85rem;
  letter-spacing: 0.05em;
  padding: 10px 24px;
  border-radius: 100px;
  border: none;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
  position: relative;
  overflow: hidden;
}

.btn::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.15), transparent);
  opacity: 0;
  transition: opacity 0.3s;
}

.btn:hover::after {
  opacity: 1
}

.btn:hover {
  transform: translateY(-2px)
}

.btn:active {
  transform: translateY(0) scale(0.98)
}

.btn-primary {
  background: linear-gradient(135deg, var(--accent), #6d28d9);
  color: #fff;
  box-shadow: 0 4px 20px var(--glow)
}

.btn-primary:hover {
  box-shadow: 0 8px 30px var(--glow)
}

.btn-secondary {
  background: var(--surface2);
  color: var(--text);
  border: 1px solid var(--border2)
}

.btn-secondary:hover {
  border-color: var(--accent)
}

.btn-ghost {
  background: transparent;
  color: var(--text2);
  border: 1px solid var(--border)
}

.btn-ghost:hover {
  color: var(--text);
  border-color: var(--border2)
}

.btn-danger {
  background: linear-gradient(135deg, var(--danger), #dc2626);
  color: #fff
}

.btn-cyan {
  background: linear-gradient(135deg, var(--accent2), #0891b2);
  color: #fff;
  box-shadow: 0 4px 20px var(--glow2)
}

.btn-sm {
  padding: 6px 16px;
  font-size: 0.78rem
}

.btn-icon {
  width: 40px;
  height: 40px;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%
}

/* ── INPUTS ── */
.input-wrap {
  margin-bottom: 20px
}

.input-wrap label {
  display: block;
  font-size: 0.78rem;
  font-weight: 500;
  color: var(--text2);
  margin-bottom: 8px;
  letter-spacing: 0.08em;
  text-transform: uppercase
}

.input {
  width: 100%;
  padding: 12px 16px;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 0.95rem;
  transition: all 0.3s;
  outline: none;
}

.input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.15)
}

.input::placeholder {
  color: var(--text3)
}

select.input option {
  background: var(--surface2)
}

.pw-wrap {
  position: relative;
}

.pw-wrap .input {
  padding-right: 44px;
  box-sizing: border-box;
}

.pw-toggle {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text3);
  padding: 0;
  display: flex;
  align-items: center;
  transition: color 0.2s;
}

.pw-toggle:hover {
  color: var(--text);
}

/* ── NAV ── */
.nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  padding: 16px 32px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(10, 10, 15, 0.8);
  backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border);
}

[data-theme="light"] .nav {
  background: rgba(245, 243, 255, 0.8)
}

.nav-logo span {
  color: var(--text3);
  font-size: 0.65rem;
  font-weight: 400;
  display: block;
  letter-spacing: 0.15em;
  -webkit-text-fill-color: var(--text3)
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: 12px
}

.nav-user {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.85rem;
  color: var(--text2);
}

.avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.8rem;
  color: #fff;
}

/* ── SIDEBAR ── */
.layout {
  display: flex;
  padding-top: 73px;
  min-height: 100vh
}

.sidebar {
  width: 260px;
  flex-shrink: 0;
  border-right: 1px solid var(--border);
  padding: 24px 16px;
  position: fixed;
  top: 73px;
  bottom: 0;
  overflow-y: auto;
  background: var(--surface);
  transition: transform 0.3s;
  z-index: 50;
}

.sidebar-section {
  margin-bottom: 28px
}

.sidebar-label {
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.15em;
  color: var(--text3);
  text-transform: uppercase;
  padding: 0 12px;
  margin-bottom: 8px
}

.sidebar-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 10px;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text2);
  cursor: pointer;
  transition: all 0.2s;
  margin-bottom: 2px;
}

.sidebar-item:hover {
  background: var(--surface2);
  color: var(--text)
}

.sidebar-item.active {
  background: linear-gradient(135deg, rgba(139, 92, 246, 0.2), rgba(6, 182, 212, 0.1));
  color: var(--accent);
  border: 1px solid rgba(139, 92, 246, 0.2)
}

.sidebar-item .icon {
  font-size: 1.1rem;
  width: 22px;
  text-align: center
}

.history-item {
  padding: 10px 12px;
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.2s;
  margin-bottom: 4px;
  position: relative;
}

.history-item:hover {
  background: var(--surface2)
}

.history-item:hover .history-del {
  opacity: 1
}

.history-title {
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis
}

.history-date {
  font-size: 0.7rem;
  color: var(--text3);
  margin-top: 2px
}

.history-score {
  font-size: 0.7rem;
  font-family: var(--font-mono);
  color: var(--accent);
  background: rgba(139, 92, 246, 0.1);
  padding: 1px 6px;
  border-radius: 4px;
  display: inline-block;
  margin-top: 4px;
}

.history-del {
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  opacity: 0;
  font-size: 0.8rem;
  color: var(--danger);
  transition: opacity 0.2s
}

/* ── MAIN CONTENT ── */
.main {
  margin-left: 260px;
  flex: 1;
  padding: 32px;
  max-width: calc(100% - 260px)
}

/* ── HERO/LANDING ── */
#landing {
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 40px 20px;
  background: var(--bg);
  position: relative;
  overflow: hidden;
}

.hero-eyebrow {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  letter-spacing: 0.2em;
  color: var(--accent2);
  text-transform: uppercase;
  margin-bottom: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
}

.hero-eyebrow::before,
.hero-eyebrow::after {
  content: '';
  width: 40px;
  height: 1px;
  background: var(--accent2);
  opacity: 0.5
}

.hero-title {
  font-family: var(--font-display);
  font-size: clamp(3rem, 8vw, 7rem);
  font-weight: 800;
  line-height: 0.95;
  letter-spacing: -0.03em;
  margin-bottom: 24px;
}

.hero-title .line1 {
  display: block;
  color: var(--text)
}

.hero-title .line2 {
  display: block;
  background: linear-gradient(135deg, var(--accent), var(--accent2), var(--accent3));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero-sub {
  font-size: 1.1rem;
  color: var(--text2);
  max-width: 560px;
  margin: 0 auto 40px;
  line-height: 1.7
}

.hero-cta {
  display: flex;
  gap: 16px;
  justify-content: center;
  flex-wrap: wrap
}

.hero-badges {
  display: flex;
  gap: 12px;
  justify-content: center;
  margin-top: 60px;
  flex-wrap: wrap;
}

.badge {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  padding: 6px 14px;
  border-radius: 100px;
  background: var(--surface2);
  border: 1px solid var(--border2);
  color: var(--text2);
  display: flex;
  align-items: center;
  gap: 6px;
}

.badge .dot {
  width: 6px;
  height: 6px;
  border-radius: 50%
}

.big5-preview {
  display: flex;
  gap: 16px;
  justify-content: center;
  margin-top: 60px;
  flex-wrap: wrap;
}

.trait-card-mini {
  padding: 20px;
  border-radius: 14px;
  background: var(--surface);
  border: 1px solid var(--border);
  min-width: 140px;
  text-align: left;
  transition: all 0.3s;
  cursor: default;
  animation: floatCard 4s ease-in-out infinite;
}

.trait-card-mini:nth-child(2) {
  animation-delay: -1s
}

.trait-card-mini:nth-child(3) {
  animation-delay: -2s
}

.trait-card-mini:nth-child(4) {
  animation-delay: -3s
}

.trait-card-mini:nth-child(5) {
  animation-delay: -0.5s
}

@keyframes floatCard {

  0%,
  100% {
    transform: translateY(0)
  }

  50% {
    transform: translateY(-8px)
  }
}

.trait-card-mini:hover {
  border-color: var(--accent);
  transform: translateY(-4px) scale(1.02);
  box-shadow: 0 12px 40px var(--glow)
}

.trait-icon {
  font-size: 1.8rem;
  margin-bottom: 8px
}

.trait-name {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.9rem;
  margin-bottom: 4px
}

.trait-bar {
  height: 3px;
  border-radius: 2px;
  background: var(--surface3);
  margin-top: 8px;
  overflow: hidden
}

.trait-fill {
  height: 100%;
  border-radius: 2px;
  animation: fillAnim 2s ease-out forwards
}

@keyframes fillAnim {
  from {
    width: 0
  }

  to {
    width: var(--w)
  }
}

/* ── AUTH ── */
#auth {
  align-items: center;
  justify-content: center;
  padding: 40px 20px;
  background: var(--bg)
}

.auth-card {
  width: 100%;
  max-width: 440px;
  padding: 40px;
  position: relative;
  z-index: 1;
}

.auth-title {
  font-family: var(--font-display);
  font-size: 2rem;
  font-weight: 800;
  margin-bottom: 8px
}

.auth-sub {
  color: var(--text2);
  margin-bottom: 32px;
  font-size: 0.9rem
}

.auth-tabs {
  display: flex;
  gap: 4px;
  background: var(--surface2);
  padding: 4px;
  border-radius: 100px;
  margin-bottom: 32px
}

.auth-tab {
  flex: 1;
  padding: 8px;
  border-radius: 100px;
  text-align: center;
  font-family: var(--font-display);
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s;
  color: var(--text2);
}

.auth-tab.active {
  background: var(--accent);
  color: #fff;
  box-shadow: 0 4px 16px var(--glow)
}

.auth-divider {
  text-align: center;
  color: var(--text3);
  font-size: 0.8rem;
  margin: 20px 0;
  position: relative
}

.auth-divider::before,
.auth-divider::after {
  content: '';
  position: absolute;
  top: 50%;
  width: 40%;
  height: 1px;
  background: var(--border)
}

.auth-divider::before {
  left: 0
}

.auth-divider::after {
  right: 0
}

.admin-link {
  text-align: center;
  margin-top: 20px;
  font-size: 0.82rem;
  color: var(--text3)
}

.admin-link a {
  color: var(--accent);
  cursor: pointer;
  text-decoration: none
}

.admin-link a:hover {
  text-decoration: underline
}

/* ── DASHBOARD ── */
.dash-header {
  margin-bottom: 32px
}

.dash-title {
  font-family: var(--font-display);
  font-size: 1.8rem;
  font-weight: 800
}

.dash-sub {
  color: var(--text2);
  margin-top: 4px
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 16px;
  margin-bottom: 32px
}

.stat-card {
  padding: 20px;
  border-radius: var(--radius);
  background: var(--surface);
  border: 1px solid var(--border);
  position: relative;
  overflow: hidden;
}

.stat-card::before {
  content: '';
  position: absolute;
  top: 0;
  right: 0;
  width: 80px;
  height: 80px;
  border-radius: 50%;
  filter: blur(30px);
  opacity: 0.5;
}

.stat-card.purple::before {
  background: var(--accent)
}

.stat-card.cyan::before {
  background: var(--accent2)
}

.stat-card.amber::before {
  background: var(--accent3)
}

.stat-card.green::before {
  background: var(--accent4)
}

.stat-val {
  font-family: var(--font-display);
  font-size: 2rem;
  font-weight: 800;
  line-height: 1
}

.stat-label {
  font-size: 0.78rem;
  color: var(--text2);
  margin-top: 6px
}

.stat-change {
  font-size: 0.72rem;
  margin-top: 8px;
  color: var(--accent4)
}

.quick-actions {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
  margin-bottom: 32px
}

.action-card {
  padding: 24px;
  border-radius: var(--radius);
  cursor: pointer;
  background: var(--surface);
  border: 1px solid var(--border);
  transition: all 0.3s;
  text-align: center;
}

.action-card:hover {
  border-color: var(--accent);
  transform: translateY(-4px);
  box-shadow: 0 12px 40px var(--glow)
}

.action-icon {
  font-size: 2.5rem;
  margin-bottom: 12px
}

.action-title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1rem;
  margin-bottom: 6px
}

.action-desc {
  font-size: 0.8rem;
  color: var(--text2)
}

/* ── ANALYSIS PANEL ── */
.analysis-layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px
}

@media(max-width:900px) {
  .analysis-layout {
    grid-template-columns: 1fr
  }
}

.panel-card {
  padding: 24px;
  border-radius: var(--radius);
  background: var(--surface);
  border: 1px solid var(--border)
}

.panel-title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.1rem;
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 8px
}

.panel-title .icon {
  font-size: 1.2rem
}

/* ── WAVEFORM ── */
.waveform {
  height: 80px;
  background: var(--surface2);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 2px;
  padding: 8px;
  margin: 16px 0;
  overflow: hidden;
}

.wave-bar {
  width: 3px;
  border-radius: 2px;
  background: linear-gradient(to top, var(--accent), var(--accent2));
  animation: waveAnim 0.8s ease-in-out infinite alternate;
  transition: height 0.1s;
}

@keyframes waveAnim {
  from {
    opacity: 0.4
  }

  to {
    opacity: 1
  }
}

.record-btn {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  border: none;
  cursor: pointer;
  background: linear-gradient(135deg, var(--danger), #dc2626);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.8rem;
  margin: 0 auto;
  box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.4);
  transition: all 0.3s;
}

.record-btn.recording {
  animation: pulse-red 1.5s ease-in-out infinite
}

@keyframes pulse-red {
  0% {
    box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.4)
  }

  70% {
    box-shadow: 0 0 0 20px rgba(239, 68, 68, 0)
  }

  100% {
    box-shadow: 0 0 0 0 rgba(239, 68, 68, 0)
  }
}

.record-controls {
  display: flex;
  gap: 12px;
  margin-top: 16px;
  justify-content: center;
  flex-wrap: wrap
}

.timer {
  font-family: var(--font-mono);
  font-size: 1.2rem;
  color: var(--danger);
  text-align: center;
  margin-top: 8px
}

.prompt-card {
  background: linear-gradient(135deg, rgba(139, 92, 246, 0.1), rgba(6, 182, 212, 0.05));
  border: 1px solid var(--border2);
  border-radius: var(--radius-sm);
  padding: 20px;
  margin-bottom: 16px;
  font-size: 0.95rem;
  line-height: 1.8;
  color: var(--text);
  font-style: italic;
}

.prompt-label {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: var(--accent2);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-bottom: 8px
}

.mode-tabs {
  display: flex;
  gap: 4px;
  margin-bottom: 20px;
  background: var(--surface2);
  padding: 4px;
  border-radius: 100px
}

.mode-tab {
  flex: 1;
  padding: 8px;
  text-align: center;
  border-radius: 100px;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s;
  color: var(--text2)
}

.mode-tab.active {
  background: var(--accent);
  color: #fff
}

/* ── RESULTS ── */
.result-header {
  background: linear-gradient(135deg, rgba(139, 92, 246, 0.15), rgba(6, 182, 212, 0.1));
  border: 1px solid var(--border2);
  border-radius: var(--radius);
  padding: 28px;
  margin-bottom: 24px;
  text-align: center;
}

.result-title {
  font-family: var(--font-display);
  font-size: 1.4rem;
  font-weight: 800;
  margin-bottom: 4px
}

.result-sub {
  color: var(--text2);
  font-size: 0.9rem
}

.personality-type {
  font-family: var(--font-display);
  font-size: 2.5rem;
  font-weight: 800;
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin: 16px 0 8px;
}

.big5-grid {
  display: grid;
  gap: 16px;
  margin-bottom: 24px
}

.trait-row {
  padding: 16px;
  border-radius: var(--radius-sm);
  background: var(--surface2);
  border: 1px solid var(--border)
}

.trait-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px
}

.trait-name-full {
  font-family: var(--font-display);
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 8px
}

.trait-pct {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  color: var(--accent)
}

.trait-desc {
  font-size: 0.8rem;
  color: var(--text2);
  margin-bottom: 10px
}

.trait-bar-full {
  height: 6px;
  border-radius: 3px;
  background: var(--surface3);
  overflow: hidden
}

.trait-fill-full {
  height: 100%;
  border-radius: 3px;
  transition: width 1.5s cubic-bezier(0.16, 1, 0.3, 1)
}

.tips-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 16px;
  margin-bottom: 24px
}

.tip-card {
  padding: 20px;
  border-radius: var(--radius-sm);
  background: var(--surface2);
  border: 1px solid var(--border);
}

.tip-card-icon {
  font-size: 2rem;
  margin-bottom: 12px
}

.tip-card-title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.95rem;
  margin-bottom: 8px
}

.tip-card-body {
  font-size: 0.82rem;
  color: var(--text2);
  line-height: 1.6
}

.profession-card {
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.1), rgba(16, 185, 129, 0.05));
  border: 1px solid rgba(245, 158, 11, 0.2);
  border-radius: var(--radius);
  padding: 24px;
  margin-bottom: 24px;
}

.profession-tag {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--accent3);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-bottom: 12px;
}

.profession-title {
  font-family: var(--font-display);
  font-size: 1.2rem;
  font-weight: 700;
  margin-bottom: 12px
}

.profession-body {
  font-size: 0.88rem;
  color: var(--text2);
  line-height: 1.7
}

.progress-ring {
  position: relative;
  width: 120px;
  height: 120px;
  margin: 0 auto 20px
}

.progress-ring svg {
  transform: rotate(-90deg)
}

.ring-bg {
  fill: none;
  stroke: var(--surface3);
  stroke-width: 8
}

.ring-progress {
  fill: none;
  stroke-width: 8;
  stroke-linecap: round;
  transition: stroke-dashoffset 2s cubic-bezier(0.16, 1, 0.3, 1)
}

.ring-label {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1.4rem;
}

.ring-sublabel {
  font-size: 0.65rem;
  color: var(--text2);
  font-weight: 400;
  margin-top: 2px
}

/* ── COMPARISON ── */
.compare-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 20px
}

.compare-card {
  padding: 20px;
  border-radius: var(--radius);
  background: var(--surface);
  border: 1px solid var(--border);
}

.compare-date {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--text3);
  margin-bottom: 8px
}

.compare-type {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1.2rem;
  color: var(--accent);
  margin-bottom: 12px
}

.mini-bars {
  display: flex;
  flex-direction: column;
  gap: 6px
}

.mini-bar-row {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.75rem
}

.mini-bar-label {
  width: 60px;
  color: var(--text2);
  text-align: right;
  flex-shrink: 0
}

.mini-bar-track {
  flex: 1;
  height: 4px;
  background: var(--surface3);
  border-radius: 2px;
  overflow: hidden
}

.mini-bar-fill {
  height: 100%;
  border-radius: 2px
}

/* ── SETTINGS ── */
.settings-section {
  margin-bottom: 32px
}

.settings-title {
  font-family: var(--font-display);
  font-size: 1.1rem;
  font-weight: 700;
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border)
}

.toggle-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 0;
  border-bottom: 1px solid var(--border)
}

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

.toggle-info {}

.toggle-label {
  font-size: 0.9rem;
  font-weight: 500;
  margin-bottom: 2px
}

.toggle-desc {
  font-size: 0.78rem;
  color: var(--text2)
}

.toggle {
  width: 48px;
  height: 26px;
  border-radius: 13px;
  background: var(--surface3);
  position: relative;
  cursor: pointer;
  transition: background 0.3s;
  flex-shrink: 0
}

.toggle.on {
  background: var(--accent)
}

.toggle::after {
  content: '';
  position: absolute;
  top: 3px;
  left: 3px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #fff;
  transition: transform 0.3s;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3)
}

.toggle.on::after {
  transform: translateX(22px)
}

.theme-picker {
  display: flex;
  gap: 12px;
  margin-top: 8px
}

.theme-opt {
  padding: 8px 20px;
  border-radius: 100px;
  border: 1px solid var(--border2);
  cursor: pointer;
  font-size: 0.82rem;
  font-weight: 600;
  transition: all 0.3s;
}

.theme-opt.selected {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent)
}

/* ── ADMIN ── */
.admin-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
  margin-bottom: 28px
}

.admin-stat {
  padding: 20px;
  border-radius: var(--radius);
  background: var(--surface);
  border: 1px solid var(--border);
  text-align: center;
}

.admin-stat-val {
  font-family: var(--font-display);
  font-size: 2.2rem;
  font-weight: 800;
  color: var(--accent)
}

.admin-stat-label {
  font-size: 0.8rem;
  color: var(--text2);
  margin-top: 4px
}

.table {
  width: 100%;
  border-collapse: collapse
}

.table th {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text3);
  font-weight: 600;
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
  text-align: left
}

.table td {
  padding: 12px;
  font-size: 0.87rem;
  border-bottom: 1px solid var(--border)
}

.table tr:hover td {
  background: var(--surface2)
}

.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 10px;
  border-radius: 100px;
  font-size: 0.72rem;
  font-weight: 600;
}

.status-active {
  background: rgba(16, 185, 129, 0.15);
  color: var(--accent4)
}

.status-inactive {
  background: rgba(100, 100, 120, 0.2);
  color: var(--text3)
}

.chart-bar-h {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
}

.chart-bar-label {
  width: 80px;
  font-size: 0.78rem;
  color: var(--text2);
  text-align: right;
  flex-shrink: 0
}

.chart-bar-track {
  flex: 1;
  height: 20px;
  background: var(--surface3);
  border-radius: 4px;
  overflow: hidden
}

.chart-bar-fill {
  height: 100%;
  border-radius: 4px;
  display: flex;
  align-items: center;
  padding-left: 8px;
  font-size: 0.72rem;
  font-weight: 600;
  color: #fff;
  transition: width 1s ease;
}

/* ── CHATBOT ── */
.chat-area {
  flex: 1;
  overflow-y: auto;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  max-height: calc(100vh - 280px);
}

.chat-msg {
  display: flex;
  gap: 12px;
  animation: msgIn 0.3s ease
}

@keyframes msgIn {
  from {
    opacity: 0;
    transform: translateY(10px)
  }

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

.chat-msg.user {
  flex-direction: row-reverse
}

.chat-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  font-weight: 700
}

.chat-bubble {
  max-width: 70%;
  padding: 12px 16px;
  border-radius: 16px;
  font-size: 0.9rem;
  line-height: 1.6;
}

.chat-msg.bot .chat-bubble {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 4px 16px 16px 16px
}

.chat-msg.user .chat-bubble {
  background: linear-gradient(135deg, var(--accent), #6d28d9);
  color: #fff;
  border-radius: 16px 4px 16px 16px
}

.chat-input-area {
  padding: 16px;
  border-top: 1px solid var(--border);
  display: flex;
  gap: 12px;
  align-items: center;
}

.chat-input {
  flex: 1;
  padding: 10px 16px;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 100px;
  color: var(--text);
  font-family: var(--font-body);
  font-size: 0.9rem;
  outline: none;
  transition: border-color 0.3s;
}

.chat-input:focus {
  border-color: var(--accent)
}

.typing-indicator {
  display: flex;
  gap: 4px;
  align-items: center;
  padding: 12px 16px
}

.typing-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--text3);
  animation: typingBounce 1s ease-in-out infinite
}

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

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

@keyframes typingBounce {

  0%,
  100% {
    transform: translateY(0)
  }

  50% {
    transform: translateY(-6px)
  }
}

/* ── MODALS ── */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(8px);
  z-index: 1000;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.modal-overlay.open {
  display: flex;
  animation: fadeIn 0.2s ease
}

@keyframes fadeIn {
  from {
    opacity: 0
  }

  to {
    opacity: 1
  }
}

.modal {
  width: 100%;
  max-width: 520px;
  padding: 32px;
  border-radius: var(--radius);
  position: relative;
  animation: modalIn 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes modalIn {
  from {
    opacity: 0;
    transform: scale(0.9)
  }

  to {
    opacity: 1;
    transform: scale(1)
  }
}

.modal-close {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--surface2);
  border: none;
  color: var(--text2);
  cursor: pointer;
  font-size: 1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s
}

.modal-close:hover {
  background: var(--surface3);
  color: var(--text)
}

.modal-title {
  font-family: var(--font-display);
  font-size: 1.4rem;
  font-weight: 800;
  margin-bottom: 8px
}

.modal-sub {
  color: var(--text2);
  font-size: 0.88rem;
  margin-bottom: 24px
}

/* ── TOAST ── */
.toast {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 2000;
  padding: 14px 20px;
  border-radius: 12px;
  min-width: 260px;
  background: var(--surface);
  border: 1px solid var(--border2);
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.4);
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 0.87rem;
  font-weight: 500;
  animation: toastIn 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
  transition: opacity 0.3s;
}

@keyframes toastIn {
  from {
    opacity: 0;
    transform: translateX(100%)
  }

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

.toast.hiding {
  opacity: 0;
  transform: translateX(20px)
}

.toast-icon {
  font-size: 1.2rem
}

/* ── UPLOAD ZONE ── */
.upload-zone {
  border: 2px dashed var(--border2);
  border-radius: var(--radius);
  padding: 40px;
  text-align: center;
  cursor: pointer;
  transition: all 0.3s;
  background: var(--surface2);
}

.upload-zone:hover,
.upload-zone.drag {
  border-color: var(--accent);
  background: rgba(139, 92, 246, 0.05)
}

.upload-icon {
  font-size: 3rem;
  margin-bottom: 12px
}

.upload-text {
  font-size: 0.9rem;
  color: var(--text2)
}

.upload-text strong {
  color: var(--accent)
}

/* ── CROP CONTROLS ── */
.crop-controls {
  background: var(--surface2);
  border-radius: var(--radius-sm);
  padding: 16px;
  margin-top: 12px;
}

.crop-slider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px
}

.crop-slider label {
  font-size: 0.78rem;
  color: var(--text2);
  width: 60px
}

input[type=range] {
  flex: 1;
  accent-color: var(--accent)
}

/* ── RESPONSIVE ── */
@media(max-width:768px) {
  .sidebar {
    transform: translateX(-100%)
  }

  .sidebar.open {
    transform: translateX(0)
  }

  .main {
    margin-left: 0;
    max-width: 100%
  }

  .nav {
    padding: 12px 20px
  }

  .analysis-layout {
    grid-template-columns: 1fr
  }

  .settings-two-col {
    grid-template-columns: 1fr !important
  }
}

/* ── LOADING SCREEN ── */
#loading {
  position: fixed;
  inset: 0;
  background: var(--bg);
  z-index: 9998;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  transition: opacity 0.5s;
}

#loading.hidden {
  opacity: 0;
  pointer-events: none
}

.loading-logo {
  font-family: var(--font-display);
  font-size: 3rem;
  font-weight: 800;
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: 24px;
}

.loading-bar {
  width: 200px;
  height: 2px;
  background: var(--surface2);
  border-radius: 1px;
  overflow: hidden
}

.loading-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--accent), var(--accent2));
  border-radius: 1px;
  animation: loadFill 1.5s ease-out forwards
}

@keyframes loadFill {
  from {
    width: 0
  }

  to {
    width: 100%
  }
}

.loading-text {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--text3);
  margin-top: 16px;
  letter-spacing: 0.1em
}

/* ── MISC ── */
.section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px
}

.section-head h2 {
  font-family: var(--font-display);
  font-size: 1.3rem;
  font-weight: 800
}

.divider {
  height: 1px;
  background: var(--border);
  margin: 24px 0
}

.tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 10px;
  border-radius: 100px;
  font-size: 0.72rem;
  font-weight: 600;
  background: rgba(139, 92, 246, 0.15);
  color: var(--accent);
}

.empty-state {
  text-align: center;
  padding: 60px 20px;
  color: var(--text2)
}

.empty-state .empty-icon {
  font-size: 3rem;
  margin-bottom: 16px;
  opacity: 0.5
}

.empty-state p {
  font-size: 0.9rem
}

.alert {
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  margin-bottom: 16px;
  font-size: 0.85rem;
  display: flex;
  align-items: center;
  gap: 10px
}

.alert-info {
  background: rgba(6, 182, 212, 0.1);
  border: 1px solid rgba(6, 182, 212, 0.2);
  color: var(--accent2)
}

.alert-warn {
  background: rgba(245, 158, 11, 0.1);
  border: 1px solid rgba(245, 158, 11, 0.2);
  color: var(--accent3)
}

/* ── RADAR CHART ── */
.radar-wrap {
  display: flex;
  justify-content: center;
  margin: 16px 0
}

svg.radar {
  overflow: visible
}

.radar-web {
  fill: none;
  stroke: var(--border2);
  stroke-width: 1
}

.radar-fill {
  fill: rgba(139, 92, 246, 0.2);
  stroke: var(--accent);
  stroke-width: 2
}

.radar-dot {
  fill: var(--accent)
}

.radar-label {
  font-family: var(--font-display);
  font-size: 11px;
  fill: var(--text2);
  font-weight: 600
}

/* ── Q&A STYLE ── */
.qa-item {
  padding: 16px;
  border-radius: var(--radius-sm);
  background: var(--surface2);
  margin-bottom: 12px;
  border: 1px solid var(--border);
  cursor: pointer;
  transition: all 0.2s
}

.qa-item:hover,
.qa-item.selected {
  border-color: var(--accent);
  background: rgba(139, 92, 246, 0.08)
}

.qa-q {
  font-weight: 600;
  font-size: 0.9rem;
  margin-bottom: 4px
}

.qa-hint {
  font-size: 0.78rem;
  color: var(--text2)
}

.qa-check {
  float: right;
  color: var(--accent);
  opacity: 0
}

.qa-item.selected .qa-check {
  opacity: 1
}

/* ── ONBOARDING ── */
@keyframes obLogoFloat {

  0%,
  100% {
    transform: translateY(0) rotate(-2deg)
  }

  50% {
    transform: translateY(-12px) rotate(2deg)
  }
}

.ob-step {
  animation: fadeSlideIn 0.5s ease forwards
}

.ob-feature-card {
  padding: 16px;
  border-radius: var(--radius-sm);
  background: var(--surface);
  border: 1px solid var(--border);
  transition: all 0.3s
}

.ob-feature-card:hover {
  border-color: var(--accent2);
  transform: translateY(-3px)
}

.ob-prof-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 12px
}

.ob-prof-card {
  padding: 20px 14px;
  border-radius: var(--radius);
  background: var(--surface);
  border: 2px solid var(--border);
  cursor: pointer;
  text-align: center;
  transition: all 0.25s cubic-bezier(0.34, 1.56, 0.64, 1)
}

.ob-prof-card:hover {
  border-color: var(--accent2);
  transform: translateY(-3px) scale(1.02);
  background: rgba(6, 182, 212, 0.05)
}

.ob-prof-card.selected {
  border-color: #06b6d4;
  background: rgba(6, 182, 212, 0.1);
  box-shadow: 0 0 0 3px rgba(6, 182, 212, 0.15)
}

.ob-prof-icon {
  font-size: 2rem;
  margin-bottom: 8px
}

.ob-prof-name {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.85rem;
  margin-bottom: 3px
}

.ob-prof-sub {
  font-size: 0.72rem;
  color: var(--text2)
}

.ob-goal-grid {
  display: flex;
  flex-direction: column;
  gap: 10px
}

.ob-goal-card {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px 18px;
  border-radius: var(--radius-sm);
  background: var(--surface);
  border: 2px solid var(--border);
  cursor: pointer;
  transition: all 0.2s;
  position: relative
}

.ob-goal-card:hover {
  border-color: rgba(139, 92, 246, 0.4);
  background: var(--surface2)
}

.ob-goal-card.selected {
  border-color: var(--accent);
  background: rgba(139, 92, 246, 0.08)
}

.ob-goal-icon {
  font-size: 1.4rem;
  flex-shrink: 0
}

.ob-goal-name {
  font-size: 0.9rem;
  font-weight: 500;
  flex: 1
}

.ob-goal-check {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  border: 2px solid var(--border2);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  color: transparent;
  transition: all 0.2s;
  flex-shrink: 0
}

.ob-goal-card.selected .ob-goal-check {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff
}

.ob-pref-chip {
  padding: 8px 18px;
  border-radius: 100px;
  background: var(--surface2);
  border: 2px solid var(--border);
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s
}

.ob-pref-chip:hover {
  border-color: var(--accent2)
}

.ob-pref-chip.selected {
  background: linear-gradient(135deg, rgba(6, 182, 212, 0.2), rgba(14, 165, 233, 0.1));
  border-color: #06b6d4;
  color: var(--accent2)
}
