:root {
  --navy: #0f172a;
  --navy-light: #1e293b;
  --gold: #f59e0b;
  --gold-light: #fbbf24;
  --gold-dark: #d97706;
  --text: #e2e8f0;
  --text-muted: #94a3b8;
  --bg: #0f172a;
  --bg-card: #1e293b;
  --bg-hover: #334155;
  --border: #334155;
  --success: #22c55e;
  --danger: #ef4444;
  --radius: 12px;
  --radius-sm: 8px;
  --shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
  --font: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --header-h: 64px;
}

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

html, body {
  height: 100%;
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--gold); text-decoration: none; }
a:hover { color: var(--gold-light); text-decoration: underline; }

button {
  cursor: pointer;
  font-family: var(--font);
  font-size: 14px;
  border: none;
  border-radius: var(--radius-sm);
  padding: 10px 20px;
  transition: all 0.2s;
}

.btn-primary {
  background: linear-gradient(135deg, var(--gold), var(--gold-dark));
  color: #0f172a;
  font-weight: 600;
}
.btn-primary:hover {
  background: linear-gradient(135deg, var(--gold-light), var(--gold));
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(245, 158, 11, 0.3);
}

.btn-outline {
  background: transparent;
  border: 1.5px solid var(--border);
  color: var(--text);
}
.btn-outline:hover {
  border-color: var(--gold);
  color: var(--gold);
}

.btn-ghost {
  background: transparent;
  color: var(--text-muted);
  padding: 8px 14px;
}
.btn-ghost:hover {
  background: var(--bg-hover);
  color: var(--text);
}

input, textarea, select {
  font-family: var(--font);
  font-size: 14px;
  background: var(--bg);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  padding: 10px 14px;
  width: 100%;
  transition: border-color 0.2s;
  outline: none;
}
input:focus, textarea:focus, select:focus {
  border-color: var(--gold);
}

label {
  display: block;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-muted);
  margin-bottom: 6px;
}

/* Header / Nav */
.header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--header-h);
  background: rgba(15, 23, 42, 0.95);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 20px;
  z-index: 100;
}

.header-logo {
  font-size: 20px;
  font-weight: 700;
  color: var(--text);
  letter-spacing: 1px;
}
.header-logo span {
  color: var(--gold);
}

.header-nav {
  display: flex;
  gap: 4px;
}
.header-nav .nav-link {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  font-size: 14px;
  transition: all 0.2s;
  cursor: pointer;
  background: none;
  border: none;
  font-family: var(--font);
}
.header-nav .nav-link:hover,
.header-nav .nav-link.active {
  background: var(--bg-hover);
  color: var(--text);
}
.header-nav .nav-link.active {
  color: var(--gold);
}

.header-nav .nav-link svg {
  width: 18px;
  height: 18px;
}

/* Main */
.main {
  margin-top: var(--header-h);
  min-height: calc(100vh - var(--header-h));
  padding: 24px 20px;
}

.page {
  display: none;
  max-width: 800px;
  margin: 0 auto;
}
.page.active { display: block; }

/* Hero */
.hero {
  text-align: center;
  padding: 60px 0 40px;
}
.hero h1 {
  font-size: 40px;
  font-weight: 800;
  line-height: 1.2;
  margin-bottom: 16px;
  background: linear-gradient(135deg, var(--text), var(--gold));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.hero p {
  font-size: 18px;
  color: var(--text-muted);
  max-width: 560px;
  margin: 0 auto 32px;
  line-height: 1.7;
}
.hero .cta-buttons {
  display: flex;
  gap: 12px;
  justify-content: center;
  flex-wrap: wrap;
}

/* Features */
.features {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
  margin: 40px 0;
}
.feature-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  transition: all 0.2s;
}
.feature-card:hover {
  border-color: var(--gold);
  transform: translateY(-2px);
}
.feature-card .icon {
  width: 40px;
  height: 40px;
  background: rgba(245, 158, 11, 0.1);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 16px;
  font-size: 20px;
}
.feature-card h3 {
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 8px;
}
.feature-card p {
  font-size: 13px;
  color: var(--text-muted);
  line-height: 1.6;
}

/* Page header */
.page-header {
  margin-bottom: 24px;
}
.page-header h2 {
  font-size: 24px;
  font-weight: 700;
}
.page-header p {
  color: var(--text-muted);
  margin-top: 4px;
}

/* Form */
.form-group {
  margin-bottom: 20px;
}
.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

/* Chat Page */
.chat-page {
  display: flex;
  flex-direction: column;
  height: calc(100vh - var(--header-h) - 48px);
  padding-top: 0;
  max-width: 100%;
}
.chat-page .page-header {
  flex-shrink: 0;
  margin-bottom: 16px;
}
.chat-container {
  flex: 1;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
.chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.chat-message {
  max-width: 80%;
  padding: 12px 16px;
  border-radius: 12px;
  font-size: 14px;
  line-height: 1.5;
}
.chat-message.bot {
  align-self: flex-start;
  background: var(--bg-hover);
  border-bottom-left-radius: 4px;
}
.chat-message.user {
  align-self: flex-end;
  background: linear-gradient(135deg, var(--gold), var(--gold-dark));
  color: #0f172a;
  border-bottom-right-radius: 4px;
  font-weight: 500;
}
.chat-input-area {
  display: flex;
  gap: 8px;
  padding: 12px 16px;
  border-top: 1px solid var(--border);
  background: var(--navy-light);
}
.chat-input-area input {
  flex: 1;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  color: var(--text);
  font-size: 14px;
}
.chat-input-area input:focus {
  border-color: var(--gold);
  outline: none;
}

/* Orders */
.orders-empty {
  text-align: center;
  padding: 80px 20px;
  color: var(--text-muted);
}
.orders-empty svg {
  width: 48px;
  height: 48px;
  margin-bottom: 16px;
  opacity: 0.4;
}
.orders-empty h3 {
  font-size: 18px;
  margin-bottom: 8px;
  color: var(--text);
}

/* Mobile nav */
.mobile-nav {
  display: none;
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: rgba(15, 23, 42, 0.97);
  backdrop-filter: blur(12px);
  border-top: 1px solid var(--border);
  padding: 8px 0 env(safe-area-inset-bottom);
  z-index: 100;
}
.mobile-nav-links {
  display: flex;
  justify-content: space-around;
}
.mobile-nav-link {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 6px 12px;
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 10px;
  font-family: var(--font);
  cursor: pointer;
  transition: color 0.2s;
}
.mobile-nav-link.active {
  color: var(--gold);
}
.mobile-nav-link svg {
  width: 22px;
  height: 22px;
}

/* Coze Bot Embed Container */
.coze-embed {
  display: none;
  flex: 1;
  border: none;
}
.coze-embed.active {
  display: block;
}

.coze-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  flex: 1;
  padding: 40px;
  text-align: center;
  color: var(--text-muted);
}
.coze-placeholder.hidden {
  display: none;
}

/* Toast / Notifications */
.toast {
  position: fixed;
  bottom: 80px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px 20px;
  font-size: 14px;
  box-shadow: var(--shadow);
  z-index: 200;
  opacity: 0;
  transition: opacity 0.3s;
  pointer-events: none;
}
.toast.show {
  opacity: 1;
}

/* Typing indicator */
.typing-dots {
  display: flex;
  gap: 4px;
  padding: 4px 0;
}
.typing-dots span {
  width: 6px;
  height: 6px;
  background: var(--text-muted);
  border-radius: 50%;
  animation: typing 1.4s infinite;
}
.typing-dots span:nth-child(2) { animation-delay: 0.2s; }
.typing-dots span:nth-child(3) { animation-delay: 0.4s; }

@keyframes typing {
  0%, 60%, 100% { opacity: 0.3; transform: translateY(0); }
  30% { opacity: 1; transform: translateY(-4px); }
}

/* Responsive */
@media (max-width: 768px) {
  .header-nav { display: none; }
  .mobile-nav { display: block; }
  .main { padding-bottom: 80px; }
  .hero h1 { font-size: 28px; }
  .hero p { font-size: 16px; }
  .form-row { grid-template-columns: 1fr; }
  .features { grid-template-columns: 1fr; }
  .chat-message { max-width: 90%; }
  .page-header h2 { font-size: 20px; }
}

@media (min-width: 769px) {
  .main { padding-top: 32px; }
}
