/* ============================================
   Z-LAND — Landing Page Styles
   Dark theme, Iraqi-flag inspired palette
   ============================================ */

:root {
  --bg-deep: #07070a;
  --bg-surface: #101014;
  --bg-surface-2: #16161c;
  --border-soft: rgba(255, 255, 255, 0.08);

  --red: #ce1126;
  --red-bright: #ff2d43;
  --green: #007a3d;
  --green-bright: #00c46a;
  --white: #f5f5f7;
  --text-dim: #9a9aa5;
  --text-dimmer: #66666f;

  --gradient-primary: linear-gradient(135deg, var(--red-bright), var(--red));
  --gradient-glow: radial-gradient(circle, rgba(206, 17, 38, 0.35), transparent 70%);

  --radius-lg: 24px;
  --radius-md: 16px;
  --radius-sm: 10px;

  --shadow-lift: 0 20px 60px rgba(0, 0, 0, 0.5);
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
}

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

html {
  scroll-behavior: smooth;
}

body {
  background: var(--bg-deep);
  color: var(--white);
  font-family: "Tajawal", "Cairo", "Segoe UI", sans-serif;
  overflow-x: hidden;
  line-height: 1.6;
}

img {
  max-width: 100%;
  display: block;
}

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

button {
  font-family: inherit;
  cursor: pointer;
}

.container {
  width: min(1180px, 92%);
  margin-inline: auto;
}

/* Background atmosphere */
.bg-glow {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background:
    radial-gradient(ellipse 60% 40% at 20% 0%, rgba(206, 17, 38, 0.16), transparent 60%),
    radial-gradient(ellipse 50% 35% at 85% 15%, rgba(0, 122, 61, 0.14), transparent 60%),
    radial-gradient(ellipse 60% 50% at 50% 100%, rgba(206, 17, 38, 0.08), transparent 70%);
}

.bg-grid {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.035) 1px, transparent 1px);
  background-size: 56px 56px;
  mask-image: radial-gradient(ellipse 80% 60% at 50% 20%, black, transparent 75%);
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 800;
  font-size: 1.35rem;
  letter-spacing: 0.5px;
}

.brand-mark {
  width: 34px;
  height: 34px;
  border-radius: 9px;
  background: var(--gradient-primary);
  display: grid;
  place-items: center;
  font-size: 1rem;
  font-weight: 900;
  box-shadow: 0 6px 20px rgba(206, 17, 38, 0.4);
}

/* The real Z-LAND logo (the globe), wherever the Command Center shows its brand. */
.brand-logo {
  width: 40px;
  height: 40px;
  flex: none;
  border-radius: 50%;
  object-fit: cover;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.14), 0 6px 22px rgba(47, 134, 255, 0.35);
}

/* ===== Buttons ===== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 13px 26px;
  border-radius: 999px;
  font-weight: 700;
  font-size: 0.95rem;
  border: 1px solid transparent;
  transition: transform 0.25s var(--ease), box-shadow 0.25s var(--ease), background 0.25s var(--ease), border-color .25s var(--ease);
  white-space: nowrap;
}

.btn:active {
  transform: scale(0.97);
}

.btn-primary {
  background: var(--gradient-primary);
  color: #fff;
  box-shadow: 0 8px 24px rgba(206, 17, 38, 0.35);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 14px 34px rgba(206, 17, 38, 0.5);
}

.btn-ghost {
  background: rgba(255, 255, 255, 0.04);
  border-color: var(--border-soft);
  color: var(--white);
}

.btn-ghost:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.2);
}

@keyframes driftFog {
  0% { transform: translate(0, 0) scale(1); }
  100% { transform: translate(-3%, 2%) scale(1.06); }
}

@keyframes pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.4; transform: scale(0.7); }
}

@keyframes floatCue {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(6px); }
}

/* ===== Landing sections =====
   Scoped to the landing page: a bare `section` rule here used to pad every
   <section> on the site (settings, panels) by 120px. */
.lg-hero,
.lg-section {
  position: relative;
  z-index: 1;
  overflow: clip;
}

.lg-hero {
  padding: 120px 0;
}

.lg-section[id]::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  opacity: 0.7;
  pointer-events: none;
}

#vision::before {
  background: radial-gradient(ellipse 60% 45% at 15% 10%, rgba(206, 17, 38, 0.08), transparent 65%);
}

#how-it-works::before {
  background: radial-gradient(ellipse 60% 45% at 85% 15%, rgba(0, 122, 61, 0.09), transparent 65%);
}

#features::before {
  background: radial-gradient(ellipse 60% 45% at 15% 85%, rgba(120, 130, 220, 0.07), transparent 65%);
}

#join::before {
  background: radial-gradient(ellipse 65% 50% at 50% 30%, rgba(206, 17, 38, 0.1), transparent 65%);
}

/* ===== Seller form ===== */
.seller-form {
  max-width: 480px;
  margin-inline: auto;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

.seller-form input,
.seller-form select {
  width: 100%;
  padding: 14px 16px;
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-soft);
  color: var(--white);
  font-family: inherit;
  font-size: 0.95rem;
  transition: border-color 0.2s, background 0.2s;
}

.seller-form select {
  color: var(--text-dim);
}

.seller-form select:valid {
  color: var(--white);
}

.seller-form input::placeholder {
  color: var(--text-dimmer);
}

.seller-form input:focus,
.seller-form select:focus {
  outline: none;
  border-color: var(--red-bright);
  background: rgba(255, 255, 255, 0.08);
}

.form-msg {
  min-height: 20px;
  font-size: 0.88rem;
  text-align: center;
}

.form-msg.success {
  color: var(--green-bright);
}

.form-msg.error {
  color: var(--red-bright);
}

@media (max-width: 520px) {
  .form-row {
    grid-template-columns: 1fr;
  }
}

/* ===== Category picker (searchable) ===== */
.cat-picker {
  position: relative;
  width: 100%;
}

.cat-picker-search {
  width: 100%;
  padding: 14px 16px;
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-soft);
  color: var(--white);
  font-family: inherit;
  font-size: 0.95rem;
}

.cat-picker-search::placeholder {
  color: var(--text-dimmer);
}

.cat-picker-search:focus {
  outline: none;
  border-color: var(--zl-primary, var(--red-bright));
  background: rgba(255, 255, 255, 0.08);
}

.cat-picker-results {
  display: none;
  position: absolute;
  z-index: 40;
  top: calc(100% + 6px);
  inset-inline: 0;
  max-height: 240px;
  overflow-y: auto;
  background: var(--bg-surface-2);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-lift);
}

.cat-picker-results.is-open {
  display: block;
}

.cat-picker-option {
  padding: 11px 16px;
  font-size: 0.9rem;
  color: var(--text-dim);
  cursor: pointer;
  border-bottom: 1px solid var(--border-soft);
}

.cat-picker-option:last-child {
  border-bottom: none;
}

.cat-picker-option:hover,
.cat-picker-option.is-active {
  background: rgba(255, 255, 255, 0.06);
  color: var(--white);
}

.cat-picker-empty {
  padding: 14px 16px;
  font-size: 0.85rem;
  color: var(--text-dimmer);
  text-align: center;
}

/* ===== Footer ===== */
footer {
  position: relative;
  z-index: 1;
  border-top: 1px solid var(--border-soft);
  padding: 50px 0 30px;
}

/* ===== Reveal on scroll ===== */
.reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.7s var(--ease), transform 0.7s var(--ease);
}

.reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
}

/* ===== Admin ===== */
.auth-shell {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
  position: relative;
  z-index: 1;
}

.auth-card {
  width: 100%;
  max-width: 380px;
  padding: 40px 34px;
  border-radius: var(--radius-lg);
  background: var(--bg-surface);
  border: 1px solid var(--border-soft);
  box-shadow: var(--shadow-lift);
}

.auth-card .brand {
  justify-content: center;
  margin-bottom: 28px;
}

.auth-card h1 {
  font-size: 1.3rem;
  font-weight: 800;
  text-align: center;
  margin-bottom: 6px;
}

.auth-card .sub {
  text-align: center;
  color: var(--text-dim);
  font-size: 0.88rem;
  margin-bottom: 28px;
}

.field {
  margin-bottom: 16px;
}

.field label {
  display: block;
  font-size: 0.85rem;
  color: var(--text-dim);
  margin-bottom: 8px;
}

.field input {
  width: 100%;
  padding: 13px 16px;
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-soft);
  color: var(--white);
  font-family: inherit;
  font-size: 0.95rem;
}

.field input:focus {
  outline: none;
  border-color: var(--red-bright);
  background: rgba(255, 255, 255, 0.08);
}

.field-error {
  color: var(--red-bright);
  font-size: 0.8rem;
  margin-top: 6px;
}

.admin-shell {
  position: relative;
  z-index: 1;
  min-height: 100vh;
  padding: 32px 0 60px;
}

.admin-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 36px;
  flex-wrap: wrap;
  gap: 16px;
}

.admin-card {
  padding: 26px;
  border-radius: var(--radius-md);
  background: var(--bg-surface);
  border: 1px solid var(--border-soft);
}

.admin-card .big {
  font-size: 2.2rem;
  font-weight: 900;
}

.admin-table-wrap {
  border-radius: var(--radius-md);
  border: 1px solid var(--border-soft);
  overflow: hidden;
  margin-bottom: 8px;
}

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

.admin-table th,
.admin-table td {
  padding: 14px 20px;
  text-align: start;
}

.admin-table thead {
  background: var(--bg-surface-2);
  color: var(--text-dim);
  font-size: 0.8rem;
}

.admin-table tbody tr {
  border-top: 1px solid var(--border-soft);
}

.admin-table tbody tr:nth-child(even) {
  background: rgba(255, 255, 255, 0.02);
}

.empty-state {
  padding: 60px 20px;
  text-align: center;
  color: var(--text-dimmer);
}

/* ===== Category management ===== */
.category-list {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.category-block {
  padding: 22px;
  border-radius: var(--radius-md);
  background: var(--bg-surface);
  border: 1px solid var(--border-soft);
}

.category-block-head {
  display: flex;
  gap: 10px;
  align-items: center;
  margin-bottom: 14px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--border-soft);
}

.category-block-head input {
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-soft);
  color: var(--white);
  font-family: inherit;
  font-weight: 700;
}

.category-subs {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding-inline-start: 16px;
}

.category-sub-row {
  display: flex;
  gap: 8px;
  align-items: center;
}

.category-sub-row input {
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-soft);
  color: var(--text-dim);
  font-family: inherit;
  font-size: 0.9rem;
}

.category-subs form input:focus,
.category-block-head input:focus {
  outline: none;
  border-color: var(--red-bright);
  color: var(--white);
}

/* ===== Responsive ===== */
@media (max-width: 760px) {
  .admin-table-wrap {
    overflow-x: auto;
  }

  table.admin-table {
    min-width: 560px;
  }
}
