/* DormBoss — Main Stylesheet */

:root {
  --bg-dark: #0a0a0f;
  --bg-card: #12121a;
  --bg-accent: #1a1a2e;
  --fg: #e8e6e3;
  --fg-muted: #8a8a9a;
  --accent-lime: #c8ff00;
  --accent-purple: #a855f7;
  --accent-blue: #38bdf8;
  --gradient-1: linear-gradient(135deg, #c8ff00, #38bdf8);
  --gradient-2: linear-gradient(135deg, #a855f7, #c8ff00);
  --radius: 16px;
  --space-xs: 8px;
  --space-sm: 16px;
  --space-md: 32px;
  --space-lg: 64px;
  --space-xl: 96px;
  --space-2xl: 128px;
}

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

body {
  background: var(--bg-dark);
  color: var(--fg);
  font-family: 'DM Sans', sans-serif;
  font-size: 17px;
  line-height: 1.6;
  overflow-x: hidden;
}

a { color: inherit; text-decoration: none; }

/* ============================================================
   NAV
   ============================================================ */

.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-sm) var(--space-md);
  border-bottom: 1px solid rgba(255,255,255,0.05);
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(10,10,15,0.9);
  backdrop-filter: blur(12px);
}

.nav-logo {
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 700;
  font-size: 20px;
  background: var(--gradient-1);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
}

.btn {
  display: inline-block;
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 600;
  font-size: 14px;
  padding: 10px 22px;
  border-radius: 100px;
  cursor: pointer;
  transition: opacity 0.15s, transform 0.1s;
  border: none;
  text-align: center;
}

.btn:hover { opacity: 0.85; transform: translateY(-1px); }
.btn:active { transform: translateY(0); }

.btn-primary {
  background: var(--accent-lime);
  color: #0a0a0f;
}

.btn-ghost {
  background: transparent;
  color: var(--fg-muted);
  border: 1px solid rgba(255,255,255,0.12);
}

.btn-ghost:hover { color: var(--fg); border-color: rgba(255,255,255,0.3); }

/* ============================================================
   HERO
   ============================================================ */

.hero {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: var(--space-xl) var(--space-md);
  position: relative;
  overflow: hidden;
}

.hero::before {
  content: '';
  position: absolute;
  top: -200px;
  right: -200px;
  width: 600px;
  height: 600px;
  background: radial-gradient(circle, rgba(200, 255, 0, 0.08) 0%, transparent 70%);
  pointer-events: none;
}

.hero::after {
  content: '';
  position: absolute;
  bottom: -100px;
  left: -100px;
  width: 400px;
  height: 400px;
  background: radial-gradient(circle, rgba(168, 85, 247, 0.06) 0%, transparent 70%);
  pointer-events: none;
}

.hero-inner {
  max-width: 900px;
  position: relative;
  z-index: 1;
}

.hero-badge {
  display: inline-block;
  background: var(--bg-accent);
  border: 1px solid rgba(200, 255, 0, 0.2);
  color: var(--accent-lime);
  font-family: 'Space Grotesk', sans-serif;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 6px 16px;
  border-radius: 100px;
  margin-bottom: var(--space-md);
}

.hero h1 {
  font-family: 'Space Grotesk', sans-serif;
  font-size: clamp(3rem, 7vw, 5.5rem);
  font-weight: 700;
  line-height: 1.05;
  letter-spacing: -0.03em;
  margin-bottom: var(--space-md);
}

.hero h1 .highlight {
  background: var(--gradient-1);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero-sub {
  font-size: clamp(1.05rem, 2vw, 1.25rem);
  color: var(--fg-muted);
  max-width: 600px;
  margin-bottom: var(--space-lg);
}

.hero-actions {
  display: flex;
  gap: var(--space-sm);
  flex-wrap: wrap;
}

/* ============================================================
   PROBLEM
   ============================================================ */

.problem {
  padding: var(--space-xl) var(--space-md);
  border-top: 1px solid rgba(255,255,255,0.05);
}

.problem-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: var(--space-md);
  max-width: 960px;
}

.problem-card {
  background: var(--bg-card);
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: var(--radius);
  padding: var(--space-md);
}

.problem-card .label {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--accent-lime);
  margin-bottom: var(--space-sm);
  display: block;
}

.problem-card h3 {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 1.4rem;
  font-weight: 700;
  margin-bottom: var(--space-xs);
}

.problem-card p {
  color: var(--fg-muted);
  font-size: 0.95rem;
}

/* ============================================================
   FEATURES
   ============================================================ */

.features {
  padding: var(--space-xl) var(--space-md);
}

.features-header {
  max-width: 540px;
  margin-bottom: var(--space-lg);
}

.features-header h2 {
  font-family: 'Space Grotesk', sans-serif;
  font-size: clamp(2rem, 4vw, 3rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-bottom: var(--space-sm);
}

.features-header p { color: var(--fg-muted); }

.features-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: var(--space-md);
  max-width: 1024px;
}

.feature-item {
  background: var(--bg-card);
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: var(--radius);
  padding: var(--space-md);
  transition: border-color 0.2s;
}

.feature-item:hover { border-color: rgba(200,255,0,0.2); }

.feature-icon {
  font-size: 28px;
  margin-bottom: var(--space-sm);
}

.feature-item h4 {
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 700;
  font-size: 1.05rem;
  margin-bottom: 6px;
}

.feature-item p { color: var(--fg-muted); font-size: 0.9rem; }

/* ============================================================
   NUMBERS
   ============================================================ */

.numbers {
  padding: var(--space-xl) var(--space-md);
  border-top: 1px solid rgba(255,255,255,0.05);
  border-bottom: 1px solid rgba(255,255,255,0.05);
}

.numbers-row {
  display: flex;
  gap: var(--space-lg);
  flex-wrap: wrap;
}

.number-stat .value {
  font-family: 'Space Grotesk', sans-serif;
  font-size: clamp(2.5rem, 5vw, 4rem);
  font-weight: 700;
  background: var(--gradient-1);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  line-height: 1;
  margin-bottom: 8px;
}

.number-stat .desc {
  color: var(--fg-muted);
  font-size: 0.9rem;
  max-width: 180px;
}

/* ============================================================
   CLOSING
   ============================================================ */

.closing {
  padding: var(--space-2xl) var(--space-md);
  max-width: 720px;
}

.closing h2 {
  font-family: 'Space Grotesk', sans-serif;
  font-size: clamp(2rem, 4vw, 3rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-bottom: var(--space-sm);
}

.closing p { color: var(--fg-muted); font-size: 1.05rem; }

.closing .cta-block {
  margin-top: var(--space-md);
}

/* ============================================================
   FOOTER
   ============================================================ */

.footer {
  padding: var(--space-md);
  border-top: 1px solid rgba(255,255,255,0.05);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: var(--space-sm);
}

.footer-logo {
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 700;
  font-size: 18px;
  background: var(--gradient-1);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.footer p { color: var(--fg-muted); font-size: 0.85rem; }

.footer-links {
  display: flex;
  gap: var(--space-sm);
}

.footer-links a {
  color: var(--fg-muted);
  font-size: 0.85rem;
  transition: color 0.15s;
}

.footer-links a:hover { color: var(--fg); }

/* ============================================================
   DASHBOARD LAYOUT
   ============================================================ */

.dash-layout {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--bg-dark);
}

.dash-header {
  padding: var(--space-sm) var(--space-md);
  border-bottom: 1px solid rgba(255,255,255,0.06);
  display: flex;
  align-items: center;
  gap: var(--space-md);
  background: rgba(10,10,15,0.95);
  backdrop-filter: blur(10px);
  position: sticky;
  top: 0;
  z-index: 50;
}

.dash-logo {
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 700;
  font-size: 18px;
  background: var(--gradient-1);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  text-decoration: none;
}

.dash-tabs {
  display: flex;
  gap: 4px;
  background: var(--bg-card);
  border-radius: 100px;
  padding: 4px;
  border: 1px solid rgba(255,255,255,0.07);
}

.dash-tab {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 14px;
  font-weight: 600;
  padding: 7px 20px;
  border-radius: 100px;
  cursor: pointer;
  color: var(--fg-muted);
  transition: all 0.15s;
  text-decoration: none;
  border: none;
  background: transparent;
}

.dash-tab:hover { color: var(--fg); }
.dash-tab.active {
  background: var(--bg-accent);
  color: var(--fg);
  border: 1px solid rgba(200,255,0,0.2);
}

.dash-content {
  flex: 1;
  padding: var(--space-md);
  max-width: 1100px;
  width: 100%;
  margin: 0 auto;
}

/* ============================================================
   STORE TAB — PRODUCT CARDS
   ============================================================ */

.section-title {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 1.6rem;
  font-weight: 700;
  margin-bottom: 6px;
}

.section-sub {
  color: var(--fg-muted);
  font-size: 0.95rem;
  margin-bottom: var(--space-md);
}

.products-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: var(--space-sm);
  margin-bottom: var(--space-lg);
}

.product-card {
  background: var(--bg-card);
  border: 1px solid rgba(255,255,255,0.07);
  border-radius: var(--radius);
  overflow: hidden;
  transition: border-color 0.2s, transform 0.15s;
}

.product-card:hover {
  border-color: rgba(200,255,0,0.25);
  transform: translateY(-2px);
}

.product-card-img {
  width: 100%;
  aspect-ratio: 4/3;
  object-fit: cover;
  background: var(--bg-accent);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 48px;
}

.product-card-body {
  padding: var(--space-sm);
}

.product-card-name {
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 600;
  font-size: 1rem;
  margin-bottom: 4px;
}

.product-card-category {
  font-size: 12px;
  color: var(--accent-lime);
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  margin-bottom: var(--space-xs);
}

.product-card-meta {
  display: flex;
  gap: var(--space-sm);
  align-items: center;
  margin-bottom: var(--space-sm);
}

.product-price-cost {
  font-size: 0.8rem;
  color: var(--fg-muted);
}

.product-price-sell {
  font-size: 1rem;
  font-weight: 700;
  color: var(--fg);
}

.product-margin {
  font-size: 0.8rem;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 100px;
  background: rgba(200,255,0,0.12);
  color: var(--accent-lime);
}

.product-trend {
  font-size: 0.75rem;
  color: var(--fg-muted);
  margin-bottom: var(--space-xs);
}

.product-trend .trend-up { color: var(--accent-lime); font-weight: 700; }
.product-trend .trend-hot { color: #ff6b35; font-weight: 700; }

.product-actions {
  display: flex;
  gap: 8px;
}

.product-actions .btn {
  flex: 1;
  font-size: 13px;
  padding: 8px 12px;
}

.btn-sm {
  font-size: 13px;
  padding: 8px 16px;
}

/* ============================================================
   MARGIN CALCULATOR
   ============================================================ */

.calc-panel {
  background: var(--bg-card);
  border: 1px solid rgba(255,255,255,0.07);
  border-radius: var(--radius);
  padding: var(--space-md);
  margin-bottom: var(--space-lg);
}

.calc-panel h3 {
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 700;
  font-size: 1.1rem;
  margin-bottom: var(--space-sm);
  display: flex;
  align-items: center;
  gap: 8px;
}

.calc-fields {
  display: flex;
  gap: var(--space-sm);
  flex-wrap: wrap;
  align-items: flex-end;
  margin-bottom: var(--space-sm);
}

.calc-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex: 1;
  min-width: 140px;
}

.calc-field label {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--fg-muted);
}

.calc-field input {
  background: var(--bg-dark);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 10px;
  padding: 10px 14px;
  color: var(--fg);
  font-size: 1rem;
  font-family: 'Space Grotesk', sans-serif;
  outline: none;
  transition: border-color 0.15s;
}

.calc-field input:focus { border-color: rgba(200,255,0,0.4); }

.calc-result {
  display: flex;
  gap: var(--space-md);
  padding-top: var(--space-sm);
  border-top: 1px solid rgba(255,255,255,0.06);
  flex-wrap: wrap;
}

.calc-metric {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.calc-metric .metric-label {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--fg-muted);
}

.calc-metric .metric-value {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 1.5rem;
  font-weight: 700;
}

.metric-value.positive { color: var(--accent-lime); }
.metric-value.negative { color: #ff6b6b; }
.metric-value.neutral { color: var(--fg); }

/* ============================================================
   STUDY TAB — CHAT
   ============================================================ */

.study-layout {
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: var(--space-md);
  height: calc(100vh - 160px);
}

@media (max-width: 700px) {
  .study-layout { grid-template-columns: 1fr; height: auto; }
  .study-sidebar { display: none; }
}

.study-sidebar {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.sidebar-label {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--fg-muted);
  padding: 6px 12px;
}

.subject-btn {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  border-radius: 10px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--fg-muted);
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s;
  text-align: left;
  width: 100%;
}

.subject-btn:hover {
  background: var(--bg-card);
  color: var(--fg);
}

.subject-btn.active {
  background: var(--bg-accent);
  border-color: rgba(200,255,0,0.2);
  color: var(--fg);
}

.subject-icon { font-size: 18px; }

.chat-panel {
  background: var(--bg-card);
  border: 1px solid rgba(255,255,255,0.07);
  border-radius: var(--radius);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.chat-header {
  padding: var(--space-sm);
  border-bottom: 1px solid rgba(255,255,255,0.06);
  display: flex;
  align-items: center;
  gap: 10px;
}

.chat-header h4 {
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 600;
  font-size: 1rem;
}

.chat-header-sub {
  font-size: 0.8rem;
  color: var(--fg-muted);
}

.chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: var(--space-sm);
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
  min-height: 300px;
  max-height: 480px;
}

.chat-messages::-webkit-scrollbar { width: 4px; }
.chat-messages::-webkit-scrollbar-track { background: transparent; }
.chat-messages::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.1); border-radius: 2px; }

.msg {
  display: flex;
  gap: 10px;
  max-width: 85%;
}

.msg.user { align-self: flex-end; flex-direction: row-reverse; }
.msg.assistant { align-self: flex-start; }

.msg-avatar {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  flex-shrink: 0;
}

.msg.user .msg-avatar { background: rgba(200,255,0,0.15); }
.msg.assistant .msg-avatar { background: rgba(168,85,247,0.15); }

.msg-bubble {
  padding: 10px 14px;
  border-radius: 14px;
  font-size: 0.9rem;
  line-height: 1.55;
}

.msg.user .msg-bubble {
  background: var(--bg-accent);
  border: 1px solid rgba(200,255,0,0.15);
  border-radius: 14px 14px 4px 14px;
}

.msg.assistant .msg-bubble {
  background: var(--bg-dark);
  border: 1px solid rgba(255,255,255,0.07);
  border-radius: 14px 14px 14px 4px;
}

.msg-bubble pre {
  background: rgba(0,0,0,0.3);
  border-radius: 8px;
  padding: 10px;
  margin-top: 8px;
  font-size: 0.82rem;
  overflow-x: auto;
  white-space: pre-wrap;
}

.msg-bubble p + p { margin-top: 8px; }

.chat-typing {
  display: flex;
  gap: 4px;
  align-items: center;
  padding: 4px 0;
}

.chat-typing span {
  width: 7px;
  height: 7px;
  background: var(--fg-muted);
  border-radius: 50%;
  animation: bounce 1.2s infinite;
}

.chat-typing span:nth-child(2) { animation-delay: 0.2s; }
.chat-typing span:nth-child(3) { animation-delay: 0.4s; }

@keyframes bounce {
  0%, 60%, 100% { transform: translateY(0); opacity: 0.4; }
  30% { transform: translateY(-5px); opacity: 1; }
}

.chat-footer {
  padding: var(--space-sm);
  border-top: 1px solid rgba(255,255,255,0.06);
}

.chat-input-row {
  display: flex;
  gap: 8px;
  align-items: flex-end;
}

.chat-input {
  flex: 1;
  background: var(--bg-dark);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 12px;
  padding: 12px 16px;
  color: var(--fg);
  font-size: 0.9rem;
  font-family: 'DM Sans', sans-serif;
  resize: none;
  outline: none;
  transition: border-color 0.15s;
  min-height: 48px;
  max-height: 120px;
  line-height: 1.5;
}

.chat-input:focus { border-color: rgba(168,85,247,0.4); }
.chat-input::placeholder { color: var(--fg-muted); }

.chat-send {
  background: var(--accent-purple);
  color: white;
  border: none;
  border-radius: 12px;
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: opacity 0.15s;
  font-size: 18px;
  flex-shrink: 0;
}

.chat-send:hover { opacity: 0.85; }
.chat-send:disabled { opacity: 0.4; cursor: not-allowed; }

.chat-hint {
  font-size: 11px;
  color: var(--fg-muted);
  margin-top: 6px;
}

/* ============================================================
   EMPTY STATE / WELCOME
   ============================================================ */

.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100%;
  gap: var(--space-sm);
  padding: var(--space-lg);
  text-align: center;
}

.empty-icon { font-size: 48px; }
.empty-title {
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 700;
  font-size: 1.2rem;
}
.empty-sub { color: var(--fg-muted); font-size: 0.9rem; max-width: 300px; }

/* ============================================================
   SUPPLIER BADGE
   ============================================================ */

.supplier-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: 6px;
  background: rgba(56,189,248,0.1);
  color: var(--accent-blue);
  border: 1px solid rgba(56,189,248,0.2);
  text-decoration: none;
}

.supplier-badge:hover { background: rgba(56,189,248,0.2); }

/* ============================================================
   UTILITIES
   ============================================================ */

.text-muted { color: var(--fg-muted); }
.text-lime { color: var(--accent-lime); }
.text-purple { color: var(--accent-purple); }
.text-blue { color: var(--accent-blue); }

.flex { display: flex; }
.flex-wrap { flex-wrap: wrap; }
.gap-sm { gap: var(--space-sm); }
.gap-xs { gap: var(--space-xs); }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.mb-sm { margin-bottom: var(--space-sm); }
.mb-md { margin-bottom: var(--space-md); }

/* ============================================================
   RESPONSIVE
   ============================================================ */

@media (max-width: 600px) {
  .dash-content { padding: var(--space-sm); }
  .hero { padding: var(--space-lg) var(--space-sm); }
  .problem, .features, .numbers, .closing { padding: var(--space-lg) var(--space-sm); }
  .numbers-row { gap: var(--space-md); }
  .calc-fields { flex-direction: column; }
  .products-grid { grid-template-columns: 1fr; }
}
