/* ============ RESET & BASE ============ */
*, *::before, *::after { margin:0; padding:0; box-sizing:border-box; }
:root {
  --bg: #0a0a1a;
  --surface: rgba(255,255,255,0.04);
  --surface-hover: rgba(255,255,255,0.07);
  --border: rgba(255,255,255,0.08);
  --text: #f0f0f5;
  --text-dim: rgba(240,240,245,0.5);
  --accent: #6c5ce7;
  --accent2: #a29bfe;
  --green: #00cec9;
  --orange: #fdcb6e;
  --red: #ff7675;
  --pink: #fd79a8;
  --radius: 16px;
  --radius-sm: 10px;
  --shadow: 0 8px 32px rgba(0,0,0,0.3);
  --glass: blur(20px) saturate(1.2);
}
html { font-size: 16px; scroll-behavior: smooth; }
body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  overflow-x: hidden;
}

/* ============ AMBIENT BACKGROUND ============ */
.ambient {
  position: fixed; inset:0; z-index:0; pointer-events:none; overflow:hidden;
}
.ambient .orb {
  position: absolute; border-radius: 50%; filter: blur(120px); opacity: 0.3;
  animation: orbFloat 20s ease-in-out infinite alternate;
}
.ambient .orb:nth-child(1) {
  width: 600px; height: 600px; background: var(--accent);
  top: -200px; left: -100px; animation-delay: 0s;
}
.ambient .orb:nth-child(2) {
  width: 500px; height: 500px; background: var(--green);
  bottom: -150px; right: -100px; animation-delay: -7s;
}
.ambient .orb:nth-child(3) {
  width: 400px; height: 400px; background: var(--pink);
  top: 50%; left: 50%; transform: translate(-50%,-50%); animation-delay: -14s; opacity: 0.15;
}
@keyframes orbFloat {
  0% { transform: translate(0,0) scale(1); }
  33% { transform: translate(60px,-40px) scale(1.1); }
  66% { transform: translate(-40px,60px) scale(0.95); }
  100% { transform: translate(30px,30px) scale(1.05); }
}

/* ============ LAYOUT ============ */
.app { position: relative; z-index:1; }
.container { max-width: 1280px; margin: 0 auto; padding: 0 24px; }

/* ============ NAV ============ */
nav {
  position: sticky; top: 0; z-index:100;
  background: rgba(10,10,26,0.7);
  backdrop-filter: var(--glass);
  border-bottom: 1px solid var(--border);
}
nav .container {
  display: flex; align-items: center; justify-content: space-between;
  height: 64px;
}
.nav-brand {
  display: flex; align-items: center; gap: 12px;
  font-weight: 800; font-size: 1.25rem;
  background: linear-gradient(135deg, var(--accent2), var(--green));
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
}
.nav-brand .logo {
  width: 36px; height: 36px; border-radius: 10px;
  background: linear-gradient(135deg, var(--accent), var(--green));
  display: flex; align-items: center; justify-content: center;
  font-size: 1.1rem; -webkit-text-fill-color: white;
}
.nav-tabs { display: flex; gap: 4px; flex-wrap: wrap; }
.nav-tab {
  padding: 8px 18px; border-radius: 8px; border: none;
  background: transparent; color: var(--text-dim);
  font-family: inherit; font-size: 0.875rem; font-weight: 500;
  cursor: pointer; transition: all 0.2s;
}
.nav-tab:hover { color: var(--text); background: var(--surface); }
.nav-tab.active {
  background: var(--surface-hover); color: var(--text);
  box-shadow: 0 0 0 1px var(--border);
}

/* ============ HERO ============ */
.hero {
  text-align: center; padding: 80px 0 40px;
}
.hero h1 {
  font-size: 3.5rem; font-weight: 900; line-height: 1.1;
  background: linear-gradient(135deg, #fff 0%, var(--accent2) 50%, var(--green) 100%);
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
  margin-bottom: 16px;
}
.hero p {
  font-size: 1.15rem; color: var(--text-dim); max-width: 520px; margin: 0 auto;
  line-height: 1.7;
}

/* ============ CARDS ============ */
.card {
  background: var(--surface);
  backdrop-filter: var(--glass);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px;
  box-shadow: var(--shadow);
  transition: transform 0.25s, box-shadow 0.25s, border-color 0.25s;
}
.card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow), 0 0 0 1px rgba(108,92,231,0.2);
  border-color: rgba(108,92,231,0.3);
}

/* ============ METRICS GRID ============ */
.metrics {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 20px; margin: 40px 0;
}
.metric {
  text-align: center;
}
.metric .icon {
  width: 52px; height: 52px; border-radius: 14px; margin: 0 auto 16px;
  display: flex; align-items: center; justify-content: center; font-size: 1.5rem;
}
.metric .value {
  font-size: 2.2rem; font-weight: 800; line-height: 1;
}
.metric .label {
  font-size: 0.8rem; font-weight: 500; color: var(--text-dim);
  text-transform: uppercase; letter-spacing: 0.08em; margin-top: 8px;
}
.metric .trend {
  font-size: 0.8rem; font-weight: 600; margin-top: 6px;
}
.trend.up { color: var(--green); }
.trend.down { color: var(--red); }

/* ============ SECTIONS ============ */
.section { display: none; }
.section.active { display: block; animation: fadeIn 0.35s ease; }
@keyframes fadeIn { from { opacity:0; transform: translateY(12px); } to { opacity:1; transform: translateY(0); } }

.section-header {
  display: flex; align-items: center; justify-content: space-between;
  margin: 48px 0 24px;
}
.section-header h2 {
  font-size: 1.5rem; font-weight: 700;
}

/* ============ FEEDBACK LIST ============ */
.feedback-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 20px;
}
.feedback-card .stars { font-size: 1.1rem; margin-bottom: 10px; }
.feedback-card .text { color: var(--text-dim); font-size: 0.9rem; line-height: 1.6; margin: 12px 0; }
.feedback-card .meta {
  font-size: 0.75rem; color: var(--text-dim); display: flex; gap: 16px;
  padding-top: 12px; border-top: 1px solid var(--border);
}
.star { color: var(--orange); }
.star.empty { opacity: 0.25; }

/* ============ FORM ============ */
.form-card {
  max-width: 560px; margin: 0 auto;
}
.form-group { margin-bottom: 20px; }
.form-group label {
  display: block; font-size: 0.8rem; font-weight: 600;
  color: var(--text-dim); text-transform: uppercase; letter-spacing: 0.06em;
  margin-bottom: 8px;
}
.form-group input, .form-group textarea, .form-group select {
  width: 100%; padding: 14px 16px;
  background: rgba(255,255,255,0.05);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text); font-family: inherit; font-size: 0.95rem;
  transition: border-color 0.2s, box-shadow 0.2s;
  outline: none;
}
.form-group input:focus, .form-group textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(108,92,231,0.15);
}
.form-group textarea { resize: vertical; min-height: 80px; }
.star-rating { display: flex; gap: 8px; margin-top: 4px; }
.star-rating .star-btn {
  width: 44px; height: 44px; border-radius: 10px; border: 1px solid var(--border);
  background: transparent; color: var(--text-dim); font-size: 1.3rem;
  cursor: pointer; transition: all 0.2s; display: flex; align-items: center; justify-content: center;
}
.star-rating .star-btn:hover, .star-rating .star-btn.active {
  color: var(--orange); border-color: var(--orange);
  background: rgba(253,203,110,0.1);
  transform: scale(1.1);
}
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 14px 32px; border-radius: var(--radius-sm);
  font-family: inherit; font-size: 0.95rem; font-weight: 600;
  border: none; cursor: pointer; transition: all 0.25s;
}
.btn-primary {
  background: linear-gradient(135deg, var(--accent), #8b5cf6);
  color: white;
  box-shadow: 0 4px 20px rgba(108,92,231,0.3);
}
.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 28px rgba(108,92,231,0.45);
}
.btn-ghost {
  background: transparent; color: var(--text-dim);
  border: 1px solid var(--border);
}
.btn-ghost:hover { background: var(--surface); color: var(--text); }

/* ============ QR SECTION ============ */
.qr-container { text-align: center; }
.qr-card {
  display: inline-block; padding: 40px;
  background: white; border-radius: var(--radius);
}
.qr-card img { display: block; }

/* ============ CHART BARS ============ */
.chart-bars { display: flex; align-items: flex-end; gap: 12px; height: 200px; padding: 20px 0; }
.chart-bar {
  flex: 1; border-radius: 8px 8px 0 0; position: relative;
  min-height: 20px; transition: height 0.5s ease;
}
.chart-bar .bar-label {
  position: absolute; bottom: -24px; left: 50%; transform: translateX(-50%);
  font-size: 0.7rem; color: var(--text-dim); white-space: nowrap;
}
.chart-bar .bar-value {
  position: absolute; top: -22px; left: 50%; transform: translateX(-50%);
  font-size: 0.75rem; font-weight: 700; color: var(--text);
}

/* ============ TABLE ============ */
.table-wrap {
  overflow-x: auto; border-radius: var(--radius);
  border: 1px solid var(--border);
}
table { width: 100%; border-collapse: collapse; }
th, td { padding: 14px 20px; text-align: left; }
th {
  font-size: 0.75rem; font-weight: 600; text-transform: uppercase;
  letter-spacing: 0.06em; color: var(--text-dim);
  border-bottom: 1px solid var(--border);
  background: rgba(255,255,255,0.02);
}
td { border-bottom: 1px solid rgba(255,255,255,0.04); font-size: 0.9rem; }
tr:hover td { background: var(--surface); }

/* ============ TAGS ============ */
.tag {
  display: inline-block; padding: 4px 10px; border-radius: 6px;
  font-size: 0.75rem; font-weight: 600;
}
.tag-purple { background: rgba(108,92,231,0.15); color: var(--accent2); }
.tag-green { background: rgba(0,206,201,0.15); color: var(--green); }
.tag-orange { background: rgba(253,203,110,0.15); color: var(--orange); }
.tag-pink { background: rgba(253,121,168,0.15); color: var(--pink); }
.tag-red { background: rgba(255,118,117,0.15); color: var(--red); }

/* ============ TOAST ============ */
.toast {
  position: fixed; bottom: 24px; right: 24px; z-index:999;
  padding: 16px 24px; border-radius: var(--radius-sm);
  background: rgba(0,206,201,0.15); border: 1px solid rgba(0,206,201,0.3);
  color: var(--green); font-weight: 600; font-size: 0.9rem;
  backdrop-filter: var(--glass);
  transform: translateY(120px); opacity: 0;
  transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}
.toast.show { transform: translateY(0); opacity: 1; }

/* ============ EMPTY STATE ============ */
.empty {
  text-align: center; padding: 60px 20px; color: var(--text-dim);
}
.empty .emoji { font-size: 3rem; margin-bottom: 16px; }
.empty p { font-size: 0.95rem; }

/* ============ SPINNER ============ */
.spinner {
  width: 40px; height: 40px; border-radius: 50%;
  border: 3px solid var(--border);
  border-top-color: var(--accent);
  animation: spin 0.8s linear infinite;
  margin: 40px auto;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ============ RESPONSIVE ============ */
@media (max-width: 768px) {
  .hero h1 { font-size: 2.2rem; }
  .metrics { grid-template-columns: repeat(2, 1fr); }
  .feedback-grid { grid-template-columns: 1fr; }
  .nav-tabs { overflow-x: auto; }
}

/* ============ RATING BAR ============ */
.rating-distribution { margin: 32px 0; }
.rating-row { display: flex; align-items: center; gap: 12px; margin-bottom: 8px; }
.rating-row .rnum { width: 20px; text-align: right; font-weight: 700; font-size: 0.9rem; }
.rating-row .bar-bg {
  flex: 1; height: 28px; border-radius: 6px;
  background: rgba(255,255,255,0.04); overflow: hidden;
}
.rating-row .bar-fill {
  height: 100%; border-radius: 6px;
  background: linear-gradient(90deg, var(--orange), #ffeaa7);
  transition: width 0.6s ease;
}
.rating-row .rcount { width: 40px; color: var(--text-dim); font-size: 0.85rem; }

/* ============ QUANTITY INPUT ============ */
.qty-controls { display: flex; align-items: center; gap: 12px; }
.qty-btn {
  width: 36px; height: 36px; border-radius: 8px;
  border: 1px solid var(--border); background: transparent;
  color: var(--text); font-size: 1.1rem; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: all 0.2s;
}
.qty-btn:hover { background: var(--surface-hover); border-color: var(--accent); }
.qty-value { font-size: 1.1rem; font-weight: 700; min-width: 30px; text-align: center; }
