/* ============================================================
   Pixsre Theme — Creative Studio Design System
   Deep navy canvas with indigo & sky-blue accents.
   Designed for creators: clean, inviting, expressive.
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@500;600;700;800&family=Zen+Kaku+Gothic+New:wght@400;500;700&family=JetBrains+Mono:wght@400;500&display=swap');

:root {
  --bg:             #0b0e18;
  --bg-alt:         #101526;
  --surface:        #151b2e;
  --surface-hover:  #1c2338;
  --border:         #222d48;
  --border-glow:    #2e3c5c;
  --text:           #8e9ab8;
  --text-dim:       #4c5a78;
  --text-bright:    #c8d0e4;
  --text-white:     #e8edf8;
  --accent:         #5b8af5;
  --accent-soft:    #82a8f8;
  --accent-dim:     rgba(91, 138, 245, 0.1);
  --sub:            #7c6ec4;
  --sub-soft:       #9a8ed8;
  --sub-dim:        rgba(124, 110, 196, 0.1);
  --glow-accent:    0 0 12px rgba(91, 138, 245, 0.12);
  --glow-sub:       0 0 12px rgba(124, 110, 196, 0.12);
  --font-display:   'Plus Jakarta Sans', sans-serif;
  --font-body:      'Zen Kaku Gothic New', sans-serif;
  --font-mono:      'JetBrains Mono', monospace;
  --radius:         8px;
  --radius-lg:      16px;
}

/* --- Reset & Base --- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--text);
  min-height: 100dvh;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* --- Dot Grid Background --- */
.hex-bg {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background-image: radial-gradient(circle, var(--border) 0.8px, transparent 0.8px);
  background-size: 24px 24px;
  opacity: 0.4;
}
.hex-bg::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 60% 50% at 15% 25%, rgba(91, 138, 245, 0.04), transparent),
    radial-gradient(ellipse 50% 45% at 85% 70%, rgba(124, 110, 196, 0.03), transparent);
}

/* --- Top Ad Banner --- */
.top-ad-banner {
  width: 100%;
  min-height: 72px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  position: relative;
  z-index: 2;
}

/* --- Header --- */
.header {
  position: sticky;
  top: 0;
  z-index: 10;
  background: rgba(11, 14, 24, 0.9);
  backdrop-filter: blur(16px);
  padding: 16px 20px;
  display: flex;
  align-items: center;
  gap: 14px;
  border-bottom: 1px solid var(--border);
}
.header::after {
  content: "";
  position: absolute;
  bottom: -1px;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg, var(--accent), transparent 35%, transparent 65%, var(--sub));
  opacity: 0.15;
}

.back-link {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 500;
  color: var(--text-dim);
  text-decoration: none;
  cursor: pointer;
  border: 1px solid transparent;
  background: none;
  padding: 4px 10px;
  border-radius: var(--radius);
  transition: color 0.2s, background 0.2s;
  letter-spacing: 0.02em;
  white-space: nowrap;
}
.back-link:hover {
  color: var(--accent);
  background: var(--accent-dim);
}

.page-title {
  font-family: var(--font-display);
  font-size: 17px;
  font-weight: 700;
  color: var(--text-white);
  letter-spacing: -0.01em;
  line-height: 1;
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* --- Main Content Area --- */
.main {
  position: relative;
  z-index: 1;
  flex: 1;
  padding: 24px 20px 40px;
  max-width: 560px;
  width: 100%;
  margin: 0 auto;
}

/* --- Section Head --- */
.section-head {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 20px;
}
.section-tag {
  font-family: var(--font-display);
  font-size: 11px;
  font-weight: 700;
  color: var(--accent);
  letter-spacing: 0.04em;
  white-space: nowrap;
}
.section-rule {
  flex: 1;
  height: 1px;
  background: linear-gradient(90deg, var(--border), transparent);
}
.section-count {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--text-dim);
  letter-spacing: 0.04em;
}

/* --- Button --- */
.neon-btn {
  font-family: var(--font-display);
  font-size: 12px;
  font-weight: 600;
  padding: 8px 20px;
  letter-spacing: 0.02em;
  color: var(--accent);
  background: transparent;
  border: 1px solid rgba(232, 116, 97, 0.2);
  border-radius: var(--radius);
  cursor: pointer;
  transition: color 0.2s, background 0.2s, border-color 0.2s;
}
.neon-btn:hover {
  color: var(--text-white);
  background: var(--accent-dim);
  border-color: var(--accent);
}
.neon-btn span { position: relative; z-index: 1; }

.neon-btn--magenta {
  color: var(--sub);
  border-color: rgba(155, 142, 196, 0.2);
}
.neon-btn--magenta:hover {
  background: var(--sub-dim);
  border-color: var(--sub);
}

/* --- Form Fields --- */
.field {
  flex: 1;
  min-width: 0;
  padding: 9px 12px;
  font-family: var(--font-body);
  font-size: 13px;
  color: var(--text-bright);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  transition: border-color 0.2s;
}
.field:focus {
  border-color: var(--accent-soft);
  outline: none;
}
.field::placeholder { color: var(--text-dim); opacity: 0.7; }
select.field {
  appearance: none;
  cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='8' height='5'%3E%3Cpath d='M0 0l4 5 4-5z' fill='%235c5c6e'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  padding-right: 24px;
}

/* --- Empty State --- */
.empty {
  padding: 56px 20px;
  text-align: center;
  color: var(--text-dim);
  font-size: 13px;
  line-height: 1.8;
  border: 1px dashed var(--border);
  border-radius: var(--radius);
}

/* --- Subtle grain overlay --- */
.scanline-overlay {
  position: fixed;
  inset: 0;
  z-index: 9999;
  pointer-events: none;
  opacity: 0.3;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.04'/%3E%3C/svg%3E");
}

/* --- Keyframes --- */
@keyframes fade-in-up {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* --- Utility --- */
.animate-in {
  animation: fade-in-up 0.4s ease-out both;
}

/* --- Empty State (Enhanced) --- */
.empty-state {
  padding: 48px 20px;
  text-align: center;
  border: 1px dashed var(--border);
  border-radius: var(--radius);
  animation: fade-in-up 0.4s ease-out both;
}
.empty-state-icon {
  font-size: 32px;
  margin-bottom: 12px;
  opacity: 0.6;
}
.empty-state-title {
  font-family: var(--font-display);
  font-size: 14px;
  font-weight: 700;
  color: var(--text-bright);
  margin-bottom: 6px;
}
.empty-state-text {
  font-size: 13px;
  color: var(--text-dim);
  line-height: 1.6;
  margin-bottom: 16px;
}
.empty-state-cta {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font-display);
  font-size: 12px;
  font-weight: 600;
  padding: 10px 24px;
  border: 1px solid rgba(91, 138, 245, 0.25);
  border-radius: var(--radius);
  background: var(--accent-dim);
  color: var(--accent);
  cursor: pointer;
  transition: all 0.2s;
  text-decoration: none;
}
.empty-state-cta:hover {
  background: rgba(91, 138, 245, 0.18);
  border-color: var(--accent);
  color: var(--text-white);
}

/* --- Context Hint --- */
.context-hint {
  font-size: 11px;
  color: var(--text-dim);
  margin-top: 4px;
  letter-spacing: 0.02em;
}

/* --- Toast Notification --- */
.toast {
  position: fixed;
  top: 20px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 10000;
  padding: 12px 24px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text-bright);
  font-size: 13px;
  backdrop-filter: blur(12px);
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.3);
  animation: fade-in-up 0.3s ease-out both;
  pointer-events: none;
}
.toast.toast-hide {
  opacity: 0;
  transition: opacity 0.3s ease;
}

/* --- Lightbox --- */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.85);
  backdrop-filter: blur(8px);
  opacity: 0;
  transition: opacity 0.2s ease;
  cursor: zoom-out;
}
.lightbox.is-active {
  opacity: 1;
}
.lightbox img {
  max-width: 92vw;
  max-height: 88vh;
  border-radius: var(--radius-lg);
  object-fit: contain;
  box-shadow: 0 8px 40px rgba(0, 0, 0, 0.5);
  transform: scale(0.92);
  transition: transform 0.25s ease;
}
.lightbox.is-active img {
  transform: scale(1);
}

/* --- Terms of Use Modal --- */
.terms-overlay {
  position: fixed;
  inset: 0;
  z-index: 99999;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(5, 7, 14, 0.92);
  backdrop-filter: blur(12px);
  animation: fade-in-up 0.3s ease-out both;
}
.terms-overlay.terms-closing {
  opacity: 0;
  transition: opacity 0.25s ease;
}
.terms-modal {
  max-width: 440px;
  width: calc(100% - 40px);
  max-height: 80dvh;
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
}
.terms-header {
  font-family: var(--font-display);
  font-size: 15px;
  font-weight: 700;
  color: var(--text-white);
  padding: 18px 22px;
  border-bottom: 1px solid var(--border);
  letter-spacing: 0.02em;
  display: flex;
  align-items: center;
  gap: 10px;
}
.terms-back-btn {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-white);
  background: none;
  border: 1px solid transparent;
  border-radius: var(--radius);
  padding: 4px 10px;
  cursor: pointer;
  transition: color 0.2s, background 0.2s;
  white-space: nowrap;
  flex-shrink: 0;
}
.terms-back-btn:hover {
  color: var(--accent);
  background: var(--accent-dim);
}
.terms-body {
  padding: 18px 22px;
  overflow-y: auto;
  font-size: 13px;
  line-height: 1.75;
  color: var(--text-bright);
}
.terms-body ul {
  padding-left: 20px;
  margin: 10px 0;
}
.terms-body li {
  margin-bottom: 6px;
  color: var(--text-white);
}
.terms-body p {
  margin-bottom: 8px;
  color: var(--text-white);
}
.terms-body h3 {
  font-size: 15px;
  color: var(--text-white);
  margin-bottom: 12px;
}
.terms-body h4 {
  font-size: 13px;
  color: var(--text-white);
  margin-top: 18px;
  margin-bottom: 8px;
  padding-bottom: 4px;
  border-bottom: 1px solid var(--border);
}
.terms-link {
  color: var(--accent);
  text-decoration: underline;
  cursor: pointer;
  font-weight: 600;
}
.terms-link:hover {
  color: var(--accent-soft);
}
.terms-agree-btn {
  font-family: var(--font-display);
  font-size: 13px;
  font-weight: 600;
  padding: 14px;
  margin: 16px 22px 18px;
  border: 1px solid var(--accent);
  border-radius: var(--radius);
  background: var(--accent-dim);
  color: var(--accent);
  cursor: pointer;
  letter-spacing: 0.04em;
  transition: background 0.2s, color 0.2s;
}
.terms-agree-btn:hover {
  background: var(--accent);
  color: var(--text-white);
}
