/* Theme: Inspired by xp-calculator.css palette (dark slate + blue accent)
   Kept unique by preserving site-specific component styles & adding subtle gradients. */

:root{
  --bg: #0f172a;           /* slate-900 */
  --surface: #1e293b;      /* slate-800 */
  --panel: #020617;        /* slate-950 */
  --border: #334155;       /* slate-700 */
  --text: #e5e7eb;         /* gray-200 */
  --text-strong: #f1f5f9;  /* slate-100 */
  --muted: #94a3b8;        /* slate-400 */
  --muted-2: #64748b;      /* slate-500 */
  --accent: #3b82f6;       /* blue-500 */
  --accent-2: #2563eb;     /* blue-600 */
  --success: #22c55e;
  --danger: #ef4444;

  --radius-sm: 8px;
  --radius: 12px;
  --radius-lg: 16px;

  --shadow: 0 20px 40px rgba(0,0,0,0.40);
  --shadow-sm: 0 6px 16px rgba(0,0,0,0.28);
}

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

html, body{ height:100%; }

/* === Sticky Footer Layout === */
html, body {
  height: 100%;
  margin: 0;
}

.site-root {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.site-main {
  flex: 1 0 auto;
}

.site-footer {
  flex-shrink: 0;
}


body{
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.6;
  color: var(--text);
  background: radial-gradient(1200px 600px at 20% 0%, rgba(59,130,246,0.14), transparent 60%),
              radial-gradient(900px 500px at 90% 10%, rgba(37,99,235,0.10), transparent 55%),
              var(--bg);
  overflow-x: hidden;
}

a{ color: var(--accent); text-decoration:none; }
a:hover{ color: var(--accent-2); }

.container{
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
}

/* Navigation */
.navbar{
  background: var(--surface);
  color: var(--text);
  padding: 1rem 0;
  border-bottom: 1px solid var(--border);
  box-shadow: 0 10px 24px rgba(0,0,0,0.25);
}

.navbar .container{
  display:flex;
  justify-content: space-between;
  align-items:center;
  flex-wrap: wrap;
  gap: 1rem;
}

.navbar-brand{
  font-size: 1.25rem;
  font-weight: 800;
  letter-spacing: 0.2px;
  color: var(--text-strong);
}

.navbar-nav{
  display:flex;
  list-style:none;
  gap: 1.25rem;
  flex-wrap: wrap;
  align-items: center;
}

.navbar-nav a{
  color: var(--text);
  font-weight: 600;
  transition: color .2s ease;
}
.navbar-nav a:hover{ color: var(--accent); }

/* Mobile nav toggle */
.nav-toggle{
  display:none;
  margin-left:auto;
  border: 1px solid var(--border);
  background: rgba(2,6,23,0.35);
  color: var(--text);
  border-radius: 12px;
  padding: 10px 12px;
  cursor: pointer;
}
.nav-toggle-bar{
  display:block;
  width: 20px;
  height: 2px;
  background: var(--text);
  margin: 4px 0;
  border-radius: 4px;
}

.nav-menu{
  display:block;
}

/* Hero Section */
.hero{
  color: var(--text-strong);
  padding: 5.5rem 0;
  text-align:center;
  background:
    linear-gradient(135deg, rgba(30,41,59,0.92) 0%, rgba(2,6,23,0.92) 100%),
    radial-gradient(900px 400px at 50% -10%, rgba(59,130,246,0.22), transparent 60%);
  border-bottom: 1px solid var(--border);
}

.hero h1{
  font-size: 2.4rem;
  line-height: 1.1;
  margin-bottom: .75rem;
}

.hero p{
  color: var(--muted);
  font-size: 1.05rem;
  margin-bottom: 2rem;
}

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

/* Buttons */
.btn{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  padding: 10px 18px;
  border-radius: var(--radius-sm);
  font-weight: 700;
  border: 1px solid transparent;
  cursor: pointer;
  transition: transform .12s ease, background .2s ease, border-color .2s ease, color .2s ease;
  user-select:none;
}

.btn:active{ transform: translateY(1px); }

.btn-primary{
  background: var(--accent);
  color: white;
}
.btn-primary:hover{ background: var(--accent-2); }

.btn-secondary{
  background: var(--muted-2);
  color: white;
}
.btn-secondary:hover{ background: #475569; }

.btn-outline{
  background: transparent;
  color: var(--text);
  border-color: var(--border);
}
.btn-outline:hover{
  border-color: rgba(59,130,246,0.65);
  color: var(--text-strong);
  background: rgba(59,130,246,0.12);
}

/* Sections */
.features{
  padding: 4rem 0;
  background: transparent;
}

.features h2{
  text-align:center;
  margin-bottom: 2.5rem;
  font-size: 2rem;
  color: var(--text-strong);
}

.feature-grid{
  display:grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.5rem;
}

.feature-card{
  background: var(--surface);
  border: 1px solid var(--border);
  padding: 1.75rem;
  border-radius: var(--radius-lg);
  text-align:center;
  box-shadow: var(--shadow-sm);
  transition: transform .2s ease, border-color .2s ease;
}

.feature-card:hover{
  transform: translateY(-4px);
  border-color: rgba(59,130,246,0.45);
}

.feature-card h3{
  margin-bottom: .75rem;
  color: var(--text-strong);
}

/* ===== Shared UI building blocks (cards, pills, breadcrumbs) ===== */
.page-head{ margin: 18px 0 16px; }
.muted{ color: var(--muted); }

.card{
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}
.card-header{
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
}
.card-header h2{ margin: 0; font-size: 1.15rem; color: var(--text-strong); }
.card-body{ padding: 14px 16px; }

.pill{
  display: inline-block;
  padding: 4px 10px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: rgba(2,6,23,0.35);
  color: var(--text);
  font-weight: 700;
  font-size: .85rem;
}
.dot{ margin: 0 6px; color: rgba(148,163,184,0.7); }

.breadcrumbs{
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin: 10px 0 14px;
  color: var(--muted);
}
.breadcrumbs a{ color: var(--muted); }
.breadcrumbs a:hover{ color: var(--accent); }
.breadcrumbs .sep{ color: rgba(148,163,184,0.55); }

/* ===== Forum ===== */
.forum-grid{
  display:grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: 1.25rem;
}

.category-list,
.thread-list{
  list-style: none;
  padding: 0;
  margin: 0;
}

.category-row,
.thread-row{
  padding: 12px 0;
  border-bottom: 1px solid rgba(148,163,184,0.16);
}
.category-row:last-child,
.thread-row:last-child{ border-bottom: none; }

.category-title,
.thread-title{
  font-weight: 900;
  color: var(--text-strong);
}
.category-title:hover,
.thread-title:hover{ color: var(--accent); }

.category-meta,
.thread-meta{
  margin-top: 6px;
  font-size: .92rem;
  color: var(--muted);
}

.thread-table{
  display:flex;
  flex-direction: column;
  gap: 10px;
}
.thread-item{
  display:flex;
  align-items:flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 12px;
  border: 1px solid rgba(148,163,184,0.16);
  border-radius: var(--radius);
  background: rgba(2,6,23,0.25);
}
.thread-item.is-pinned{ border-color: rgba(59,130,246,0.35); }
.thread-left{ min-width: 0; }
.thread-right{ text-align:right; white-space: nowrap; }
.thread-badges{ display:flex; gap: 8px; flex-wrap: wrap; margin-top: 8px; }

.pagination{
  display:flex;
  gap: 10px;
  justify-content: space-between;
  align-items:center;
  margin-top: 14px;
}

.post{
  display:flex;
  gap: 14px;
  padding: 14px;
  border: 1px solid rgba(148,163,184,0.16);
  border-radius: var(--radius);
  background: rgba(2,6,23,0.25);
}
.post + .post{ margin-top: 12px; }
.post-aside{ width: 52px; flex: 0 0 52px; }
.avatar{
  width: 52px;
  height: 52px;
  border-radius: 999px;
  overflow: hidden;
  border: 1px solid rgba(148,163,184,0.25);
  background: rgba(59,130,246,0.10);
  display:flex;
  align-items:center;
  justify-content:center;
  font-weight: 900;
  color: var(--text-strong);
}
.avatar img{ width:100%; height:100%; object-fit: cover; display:block; }

.post-header{
  display:flex;
  justify-content: space-between;
  gap: 12px;
  align-items: baseline;
}
.post-meta{ color: var(--muted); font-size: .92rem; }
.post-actions{ display:flex; gap: 8px; flex-wrap: wrap; }
.post-content{ margin-top: 10px; line-height: 1.6; }
.post-content pre{ white-space: pre-wrap; }

.forum-actions{
  display:flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin: 10px 0 14px;
}

/* ===== Admin shell ===== */
.admin-shell{ display:flex; gap: 20px; align-items:flex-start; margin-top: 20px; }
.admin-sidebar{ min-width: 240px; }
.admin-sidebar .card-body ul{ list-style: none; padding-left: 0; margin: 0; }
.admin-sidebar .card-body li{ margin: 8px 0; }
.admin-content{ flex: 1; min-width: 0; }

.toolbar{
  display:flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
  margin: 12px 0 14px;
}
.toolbar .form-control{ max-width: 340px; }

@media (max-width: 900px){
  .forum-grid{ grid-template-columns: 1fr; }
  .admin-shell{ flex-direction: column; }
  .admin-sidebar{ width: 100%; min-width: 0; }
}

/* Forms */
.form-group{ margin-bottom: 1rem; }

.form-group label{
  display:block;
  margin-bottom: .5rem;
  font-weight: 700;
  color: var(--text);
}

.form-control{
  width:100%;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 1rem;
  background: var(--panel);
  color: var(--text);
}

.form-control:focus{
  outline: none;
  border-color: rgba(59,130,246,0.65);
  box-shadow: 0 0 0 3px rgba(59,130,246,0.18);
}

/* Cards */
.card{
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  overflow:hidden;
  margin-bottom: 2rem;
}

.card-header{
  background: rgba(2,6,23,0.55);
  padding: 1rem;
  border-bottom: 1px solid var(--border);
  color: var(--text-strong);
}

.card-body{ padding: 1.5rem; }

/* Tables */
.table{
  width:100%;
  border-collapse: collapse;
  margin-bottom: 2rem;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow:hidden;
}

.table th, .table td{
  padding: 12px;
  text-align:left;
  border-bottom: 1px solid rgba(51,65,85,0.7);
}

.table th{
  background: rgba(15,23,42,0.9);
  font-weight: 800;
  color: var(--text-strong);
  position: sticky;
  top: 0;
}

.table-striped tbody tr:nth-child(odd){
  background: rgba(30,41,59,0.28);
}

/* Alerts */
.alert{
  padding: 1rem;
  margin-bottom: 1rem;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: rgba(2,6,23,0.6);
}

.alert-success{
  border-color: rgba(34,197,94,0.35);
  color: var(--text);
  background: rgba(34,197,94,0.12);
}

.alert-error{
  border-color: rgba(239,68,68,0.35);
  color: var(--text);
  background: rgba(239,68,68,0.12);
}

/* Dashboard */
.dashboard-stats{
  display:grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 1.5rem;
  margin-bottom: 3rem;
}

.stat-card{
  background: var(--surface);
  border: 1px solid var(--border);
  padding: 1.5rem;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  text-align:center;
}

.stat-number{
  font-size: 2rem;
  font-weight: 900;
  color: var(--accent);
  margin-bottom: .35rem;
}

.stat-label{ color: var(--muted); font-size: .95rem; }

/* Forum */
.forum-category{
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  margin-bottom: 2rem;
  box-shadow: var(--shadow-sm);
}

.topic-list{ list-style:none; }

.topic-item{
  padding: 1rem;
  border-bottom: 1px solid rgba(51,65,85,0.7);
  display:flex;
  justify-content: space-between;
  align-items:center;
  gap: 1rem;
}

.topic-item:last-child{ border-bottom:none; }

.topic-title{
  font-weight: 800;
  color: var(--text-strong);
}

.topic-title:hover{ color: var(--accent); }

.topic-meta{ color: var(--muted); font-size: .9rem; }

/* Shop */
.product-grid{
  display:grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.5rem;
}

.product-card{
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow:hidden;
  box-shadow: var(--shadow-sm);
  transition: transform .2s ease, border-color .2s ease;
}

.product-card:hover{
  transform: translateY(-4px);
  border-color: rgba(59,130,246,0.45);
}

.product-image{
  width:100%;
  height: 200px;
  object-fit: cover;
  background: rgba(2,6,23,0.5);
}

.product-info{ padding: 1.25rem; }

.product-title{
  font-size: 1.15rem;
  font-weight: 900;
  margin-bottom: .4rem;
  color: var(--text-strong);
}

.product-price{
  font-size: 1.35rem;
  color: var(--success);
  font-weight: 900;
  margin-bottom: 1rem;
}

/* Footer */
footer{
  background: var(--surface);
  border-top: 1px solid var(--border);
  color: var(--muted);
  text-align:center;
  padding: 2rem 0;
  margin-top: 3rem;
}

/* Flash notices */
.notice{
  padding: 10px 12px;
  border-radius: var(--radius);
  margin: 12px 0;
  font-weight: 800;
  border: 1px solid var(--border);
  background: rgba(2,6,23,0.55);
}
.notice.success{ border-color: rgba(34,197,94,0.35); background: rgba(34,197,94,0.12); }
.notice.error{ border-color: rgba(239,68,68,0.35); background: rgba(239,68,68,0.12); }

/* Responsive */
@media (max-width: 768px){
  .navbar .container{ flex-direction: row; gap: 1rem; }
  .nav-toggle{ display:block; }
  .nav-menu{ width:100%; display:none; }
  .nav-menu.is-open{ display:block; }
  .navbar-nav{ flex-direction: column; align-items:flex-start; gap: .75rem; padding-top:.75rem; }
  .hero h1{ font-size: 1.9rem; }
  .hero{ padding: 4rem 0; }
  .feature-grid{ grid-template-columns: 1fr; }
  .dashboard-stats{ grid-template-columns: 1fr; }
  .product-grid{ grid-template-columns: 1fr; }
  .topic-item{ flex-direction: column; align-items: flex-start; }
}
