@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&family=JetBrains+Mono:wght@400;500&display=swap');

:root {
  --bg-base:        #eaecf4;
  --bg-surface:     #f2f4fb;
  --bg-white:       #ffffff;
  --primary:        #6b2fa0;
  --primary-dark:   #541f80;
  --primary-light:  #f3eaff;
  --primary-mid:    #8b4fc8;
  --accent:         #f97316;
  --accent-light:   #fff4ed;
  --text:           #1e1e2d;
  --text-muted:     #6b7280;
  --text-light:     #9ca3af;
  --border:         #dde0ef;
  --border-light:   #eef0f8;
  --shadow-sm:      0 1px 3px rgba(107,47,160,0.08), 0 1px 2px rgba(0,0,0,0.04);
  --shadow-md:      0 4px 16px rgba(107,47,160,0.1), 0 2px 6px rgba(0,0,0,0.05);
  --shadow-lg:      0 10px 40px rgba(107,47,160,0.15), 0 4px 12px rgba(0,0,0,0.06);
  --radius:         12px;
  --radius-lg:      16px;
  --radius-full:    9999px;
  --transition:     all 0.2s ease;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--bg-base);
  color: var(--text);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  line-height: 1.6;
  font-size: 15px;
}

a { color: var(--primary); text-decoration: none; transition: var(--transition); }
a:hover { color: var(--primary-dark); }

/* ─── NAVBAR ──────────────────────────────────────────────────────── */
.navbar {
  background: var(--bg-white);
  padding: 0 2.5rem;
  height: 72px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  box-shadow: var(--shadow-sm);
  position: sticky;
  top: 0;
  z-index: 100;
  border-bottom: 1px solid var(--border-light);
}

.nav-brand a {
  font-size: 1.4rem;
  font-weight: 800;
  color: var(--primary);
  letter-spacing: -0.5px;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.nav-brand .brand-icon {
  width: 36px;
  height: 36px;
  background: linear-gradient(135deg, var(--primary) 0%, var(--accent) 100%);
  border-radius: 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 1rem;
  font-weight: 800;
  flex-shrink: 0;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 0.15rem;
  font-size: 0.875rem;
}

.nav-links a {
  color: var(--text-muted);
  padding: 0.45rem 0.85rem;
  border-radius: var(--radius-full);
  font-weight: 500;
  transition: var(--transition);
}

.nav-links a:hover {
  color: var(--primary);
  background: var(--primary-light);
}

.nav-user {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--primary);
  background: var(--primary-light);
  border: 1px solid rgba(107,47,160,0.15);
  padding: 0.3rem 0.85rem;
  border-radius: var(--radius-full);
}

.nav-links a.btn-nav-primary {
  background: var(--primary);
  color: #fff;
  padding: 0.45rem 1.1rem;
  border-radius: var(--radius-full);
}

.nav-links a.btn-nav-primary:hover {
  background: var(--primary-dark);
  color: #fff;
}

/* ─── CONTAINER ───────────────────────────────────────────────────── */
.container {
  max-width: 900px;
  margin: 0 auto;
  padding: 2.5rem 1.5rem;
  flex: 1;
  width: 100%;
}

/* ─── HERO ────────────────────────────────────────────────────────── */
.hero {
  text-align: center;
  padding: 4rem 1rem 3rem;
  position: relative;
}

.hero-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 1.2px;
  text-transform: uppercase;
  color: var(--primary);
  background: var(--primary-light);
  border: 1px solid rgba(107,47,160,0.15);
  padding: 0.35rem 1rem;
  border-radius: var(--radius-full);
  margin-bottom: 1.5rem;
}

.hero h1 {
  font-size: clamp(2rem, 5vw, 3.2rem);
  font-weight: 800;
  letter-spacing: -1.5px;
  line-height: 1.15;
  color: var(--text);
  margin-bottom: 1.25rem;
}

.hero h1 span {
  color: var(--primary);
}

.hero p {
  font-size: 1.05rem;
  color: var(--text-muted);
  margin-bottom: 2.5rem;
  max-width: 540px;
  margin-left: auto;
  margin-right: auto;
  line-height: 1.7;
}

.hero-actions {
  display: flex;
  gap: 0.75rem;
  justify-content: center;
  flex-wrap: wrap;
}

.welcome-banner {
  background: var(--primary-light);
  border: 1px solid rgba(107,47,160,0.2);
  padding: 1rem 1.5rem;
  border-radius: var(--radius);
  margin-bottom: 2rem;
  color: var(--primary);
  font-size: 0.9rem;
  font-weight: 500;
  text-align: left;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.welcome-banner::before { content: '👋'; }

/* ─── STATS ───────────────────────────────────────────────────────── */
.stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1.25rem;
  margin-top: 3rem;
}

.stat-card {
  background: var(--bg-white);
  padding: 2rem 1.75rem;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
  transition: var(--transition);
  position: relative;
  overflow: hidden;
}

.stat-card::before {
  content: '';
  position: absolute;
  bottom: 0; left: 0; right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--primary), var(--accent));
  transform: scaleX(0);
  transition: var(--transition);
  transform-origin: left;
}

.stat-card:hover {
  box-shadow: var(--shadow-md);
  border-color: rgba(107,47,160,0.25);
  transform: translateY(-3px);
}

.stat-card:hover::before { transform: scaleX(1); }

.stat-icon {
  width: 48px;
  height: 48px;
  background: var(--primary-light);
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
  margin-bottom: 1.1rem;
}

.stat-card h3 {
  color: var(--text);
  margin-bottom: 0.4rem;
  font-size: 1rem;
  font-weight: 700;
}

.stat-card p {
  color: var(--text-muted);
  font-size: 0.875rem;
  line-height: 1.55;
}

/* ─── BUTTONS ─────────────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.6rem 1.5rem;
  border: none;
  border-radius: var(--radius-full);
  cursor: pointer;
  font-size: 0.875rem;
  font-weight: 600;
  font-family: inherit;
  text-decoration: none;
  transition: var(--transition);
  white-space: nowrap;
}

.btn-primary {
  background: var(--primary);
  color: #fff;
  box-shadow: 0 4px 14px rgba(107,47,160,0.3);
}

.btn-primary:hover {
  background: var(--primary-dark);
  color: #fff;
  box-shadow: 0 6px 20px rgba(107,47,160,0.4);
  transform: translateY(-1px);
}

.btn-secondary {
  background: var(--bg-white);
  color: var(--text);
  border: 1.5px solid var(--border);
}

.btn-secondary:hover {
  background: var(--bg-base);
  border-color: var(--primary);
  color: var(--primary);
}

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

.btn-outline:hover {
  background: var(--primary-light);
  color: var(--primary-dark);
}

.btn-accent {
  background: var(--accent);
  color: #fff;
  box-shadow: 0 4px 14px rgba(249,115,22,0.3);
}

.btn-accent:hover {
  background: #ea6c0a;
  color: #fff;
  transform: translateY(-1px);
}

.btn-danger {
  background: #fef2f2;
  color: #dc2626;
  border: 1.5px solid #fecaca;
}

.btn-danger:hover {
  background: #fee2e2;
  color: #b91c1c;
}

.btn-small { padding: 0.3rem 0.85rem; font-size: 0.78rem; }

/* ─── FORMS ───────────────────────────────────────────────────────── */
.form-container {
  max-width: 480px;
  margin: 0 auto;
  background: var(--bg-white);
  padding: 2.5rem;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-lg);
}

.form-container h2 {
  margin-bottom: 0.4rem;
  color: var(--text);
  font-size: 1.5rem;
  font-weight: 800;
  letter-spacing: -0.5px;
}

.form-container h3 {
  margin-bottom: 1rem;
  color: var(--text);
  font-size: 1.05rem;
  font-weight: 700;
}

.form-container > p {
  color: var(--text-muted);
  font-size: 0.875rem;
  margin-bottom: 1.75rem;
}

.form-group { margin-bottom: 1.15rem; }

.form-group label {
  display: block;
  margin-bottom: 0.4rem;
  color: var(--text);
  font-size: 0.82rem;
  font-weight: 600;
}

.form-group input,
.form-group textarea,
.form-group select {
  width: 100%;
  padding: 0.7rem 1rem;
  border: 1.5px solid var(--border);
  border-radius: 10px;
  background: var(--bg-surface);
  color: var(--text);
  font-size: 0.9rem;
  font-family: inherit;
  transition: var(--transition);
}

.form-group input::placeholder,
.form-group textarea::placeholder { color: var(--text-light); }

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
  outline: none;
  border-color: var(--primary);
  background: var(--bg-white);
  box-shadow: 0 0 0 3px rgba(107,47,160,0.1);
}

.form-group input[type="file"] { padding: 0.5rem; cursor: pointer; }

.form-footer {
  margin-top: 1.1rem;
  text-align: center;
  color: var(--text-muted);
  font-size: 0.85rem;
}

/* ─── ALERTS ──────────────────────────────────────────────────────── */
.alert {
  padding: 0.9rem 1.1rem;
  border-radius: var(--radius);
  margin-bottom: 1rem;
  font-size: 0.875rem;
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
}

.alert-error {
  background: #fef2f2;
  border: 1px solid #fecaca;
  color: #dc2626;
}

.alert-success {
  background: #f0fdf4;
  border: 1px solid #bbf7d0;
  color: #16a34a;
}

.alert-info {
  background: var(--primary-light);
  border: 1px solid rgba(107,47,160,0.2);
  color: var(--primary);
}

/* ─── BADGE ───────────────────────────────────────────────────────── */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 0.2rem 0.65rem;
  border-radius: var(--radius-full);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.3px;
  text-transform: uppercase;
}

.badge, .badge-default {
  background: var(--primary-light);
  color: var(--primary);
  border: 1px solid rgba(107,47,160,0.15);
}

.badge-admin {
  background: #fff4ed;
  color: var(--accent);
  border: 1px solid rgba(249,115,22,0.2);
}

.badge-premium {
  background: #fefce8;
  color: #ca8a04;
  border: 1px solid rgba(202,138,4,0.2);
}

/* ─── SORT CONTROLS ───────────────────────────────────────────────── */
.sort-controls {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 1.5rem;
  color: var(--text-muted);
  font-size: 0.82rem;
  font-weight: 500;
}

/* ─── PAGE HEADER ─────────────────────────────────────────────────── */
.page-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 2rem;
}

.page-header h2 {
  font-size: 1.5rem;
  font-weight: 800;
  letter-spacing: -0.5px;
  color: var(--text);
}

/* ─── POSTS ───────────────────────────────────────────────────────── */
.posts-list { display: flex; flex-direction: column; gap: 0.85rem; }

.post-card {
  background: var(--bg-white);
  padding: 1.5rem 1.75rem;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
  transition: var(--transition);
  position: relative;
  overflow: hidden;
}

.post-card::before {
  content: '';
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 4px;
  background: linear-gradient(180deg, var(--primary), var(--accent));
  opacity: 0;
  transition: var(--transition);
}

.post-card:hover {
  box-shadow: var(--shadow-md);
  border-color: rgba(107,47,160,0.2);
  transform: translateY(-2px);
}

.post-card:hover::before { opacity: 1; }

.post-card h3 { font-size: 1.05rem; font-weight: 700; }
.post-card h3 a { color: var(--text); }
.post-card h3 a:hover { color: var(--primary); }

.post-meta {
  color: var(--text-light);
  font-size: 0.8rem;
  margin: 0.4rem 0 0.5rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.post-meta a { color: var(--text-muted); }
.post-meta a:hover { color: var(--primary); }

.post-excerpt {
  color: var(--text-muted);
  font-size: 0.875rem;
  line-height: 1.6;
}

.post-actions {
  margin-top: 0.85rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 0.8rem;
  color: var(--text-light);
}

.post-detail {
  background: var(--bg-white);
  padding: 2.5rem;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
}

.post-detail h2 {
  color: var(--text);
  margin-bottom: 0.75rem;
  font-size: 1.75rem;
  letter-spacing: -0.5px;
  font-weight: 800;
}

.post-body {
  margin-top: 1.25rem;
  line-height: 1.85;
  color: var(--text-muted);
  font-size: 0.95rem;
}

/* ─── COMMENTS ────────────────────────────────────────────────────── */
.comments-section { margin-top: 2.5rem; }

.comments-section h3 {
  margin-bottom: 1.25rem;
  color: var(--text);
  font-size: 1rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.comments-section h3::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border);
}

.comment {
  background: var(--bg-surface);
  padding: 1.1rem 1.25rem;
  border-radius: var(--radius);
  margin-bottom: 0.65rem;
  border: 1px solid var(--border);
  border-left: 3px solid var(--primary);
}

.comment-meta {
  font-size: 0.78rem;
  color: var(--text-light);
  margin-bottom: 0.45rem;
}

.comment-meta a { color: var(--text-muted); }
.comment-body { color: var(--text-muted); font-size: 0.9rem; }
.comment-form { margin-top: 2rem; }

/* ─── SEARCH ──────────────────────────────────────────────────────── */
.search-form .form-group { display: flex; gap: 0.5rem; }
.search-form .form-group input { flex: 1; }
.search-info { margin: 1rem 0; color: var(--text-muted); font-size: 0.875rem; }

/* ─── PROFILE ─────────────────────────────────────────────────────── */
.profile-card {
  background: var(--bg-white);
  padding: 2.5rem;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
  position: relative;
  overflow: hidden;
}

.profile-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 4px;
  background: linear-gradient(90deg, var(--primary), var(--accent));
}

.profile-avatar {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.75rem;
  font-weight: 800;
  color: #fff;
  margin-bottom: 1.25rem;
  box-shadow: 0 4px 14px rgba(107,47,160,0.3);
}

.profile-info h2 {
  color: var(--text);
  font-size: 1.6rem;
  font-weight: 800;
  letter-spacing: -0.5px;
  margin-bottom: 0.75rem;
}

.profile-info p {
  margin-bottom: 0.5rem;
  color: var(--text-muted);
  font-size: 0.9rem;
}

.profile-info strong {
  color: var(--text);
  font-weight: 600;
}

/* ─── ADMIN ───────────────────────────────────────────────────────── */
.admin-page h2 {
  color: var(--text);
  margin-bottom: 2rem;
  font-size: 1.5rem;
  font-weight: 800;
  letter-spacing: -0.5px;
}

.admin-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 1.25rem;
  margin-bottom: 1.25rem;
}

.admin-section {
  background: var(--bg-white);
  padding: 1.75rem;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
}

.admin-section h3 {
  color: var(--primary);
  margin-bottom: 1.25rem;
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--border);
}

.admin-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.85rem;
}

.admin-table th,
.admin-table td {
  padding: 0.65rem 0.75rem;
  text-align: left;
  border-bottom: 1px solid var(--border-light);
}

.admin-table th {
  color: var(--text-light);
  font-weight: 700;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  background: var(--bg-surface);
}

.admin-table td { color: var(--text-muted); }
.admin-table tr:last-child td { border-bottom: none; }

.admin-table tr:hover td { background: var(--bg-surface); }

.admin-table select {
  background: var(--bg-surface);
  color: var(--text);
  border: 1px solid var(--border);
  padding: 0.25rem 0.5rem;
  border-radius: 6px;
  font-size: 0.8rem;
  font-family: inherit;
}

/* ─── SHOP ────────────────────────────────────────────────────────── */
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1.25rem;
  margin: 1.5rem 0;
}

.card {
  background: var(--bg-white);
  padding: 2rem 1.75rem;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
  transition: var(--transition);
  text-align: center;
  position: relative;
  overflow: hidden;
}

.card-accent-bar {
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 4px;
  background: linear-gradient(90deg, var(--primary), var(--accent));
}

.card:hover {
  box-shadow: var(--shadow-md);
  border-color: rgba(107,47,160,0.2);
  transform: translateY(-3px);
}

.card h3 { color: var(--text); margin-bottom: 0.5rem; font-weight: 700; }
.card p { color: var(--text-muted); font-size: 0.875rem; margin-bottom: 1rem; }
.card .price { color: var(--primary); font-weight: 800; font-size: 1.1rem; margin-bottom: 1.1rem; }

/* ─── ERROR ───────────────────────────────────────────────────────── */
.error-page { text-align: center; padding: 4rem 1.5rem; }

.error-code {
  font-size: 6rem;
  font-weight: 800;
  letter-spacing: -4px;
  color: var(--primary);
  opacity: 0.15;
  line-height: 1;
  margin-bottom: -1rem;
}

.error-page h2 {
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--text);
  margin-bottom: 1rem;
}

.stack-trace {
  margin-top: 2rem;
  text-align: left;
  background: #1e1e2d;
  padding: 1.5rem;
  border-radius: var(--radius);
  border: 1px solid #3a3a5c;
  overflow-x: auto;
}

.stack-trace h3 {
  color: #f87171;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 1rem;
  font-family: 'JetBrains Mono', monospace;
}

.stack-trace pre {
  font-family: 'JetBrains Mono', 'Fira Code', monospace;
  font-size: 0.78rem;
  color: #fca5a5;
  line-height: 1.7;
}

/* ─── DIVIDER ─────────────────────────────────────────────────────── */
hr {
  border: none;
  border-top: 1px solid var(--border);
  margin: 2rem 0;
}

/* ─── FOOTER ──────────────────────────────────────────────────────── */
.footer {
  background: var(--bg-white);
  border-top: 1px solid var(--border);
  padding: 2rem;
  text-align: center;
  color: var(--text-muted);
  font-size: 0.82rem;
  margin-top: auto;
}

.footer-inner {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 2rem;
  flex-wrap: wrap;
  margin-bottom: 1rem;
}

.footer a { color: var(--text-muted); }
.footer a:hover { color: var(--primary); }
.footer-copy { color: var(--text-light); font-size: 0.8rem; }

/* ─── SECTION TITLE ───────────────────────────────────────────────── */
.section-title {
  font-size: 1.3rem;
  font-weight: 800;
  color: var(--text);
  letter-spacing: -0.5px;
  margin-bottom: 1.5rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.section-title::after {
  content: '';
  flex: 1;
  height: 2px;
  background: linear-gradient(90deg, var(--border), transparent);
}

/* ─── FORM INPUT ICON ─────────────────────────────────────────────── */
.input-icon-wrap {
  position: relative;
}

.input-icon-wrap .icon {
  position: absolute;
  left: 1rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-light);
  font-size: 0.9rem;
  pointer-events: none;
}

.input-icon-wrap input { padding-left: 2.5rem; }

/* ─── UTILITY ─────────────────────────────────────────────────────── */
.text-primary  { color: var(--primary); }
.text-accent   { color: var(--accent); }
.text-muted    { color: var(--text-muted); }
.text-light    { color: var(--text-light); }
.mono          { font-family: 'JetBrains Mono', monospace; }
.mt-1          { margin-top: 1rem; }
.mt-2          { margin-top: 2rem; }
.mb-1          { margin-bottom: 1rem; }
.fw-bold       { font-weight: 700; }
.form-input    { width: 100%; padding: 0.7rem 1rem; border: 1.5px solid var(--border); border-radius: 10px; background: var(--bg-surface); color: var(--text); font-family: inherit; font-size: 0.9rem; }

/* ─── RESPONSIVE ──────────────────────────────────────────────────── */
@media (max-width: 640px) {
  .navbar { padding: 0 1rem; }
  .nav-links { gap: 0; font-size: 0.8rem; }
  .container { padding: 1.5rem 1rem; }
  .form-container { padding: 1.75rem 1.25rem; }
  .admin-grid { grid-template-columns: 1fr; }
  .hero h1 { font-size: 1.9rem; }
  .hero { padding: 2.5rem 0 2rem; }
}
