/*
Theme Name: Script No Key
Theme URI: https://scriptnokey.com
Author: Team Shadowrise Devs
Author URI: https://scriptnokey.com
Description: A dark, modern theme for Roblox script sharing communities. Fully reusable across multiple sites.
Version: 1.0.0
Requires at least: 6.0
Tested up to: 6.7
Requires PHP: 8.0
License: GNU General Public License v2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: sailor-piece-theme
Tags: dark, custom-colors, custom-logo, custom-menu, featured-images, threaded-comments, translation-ready
*/

/* ── CSS Variables — Dark Mode (default) ───────────────── */
:root {
  --bg-primary:    #0a0a0f;
  --bg-secondary:  #111118;
  --bg-card:       #16161f;
  --border:        rgba(255,255,255,0.08);
  --border-accent: rgba(99,102,241,0.4);
  --accent:        #6366f1;
  --accent-glow:   rgba(99,102,241,0.15);
  --accent-hover:  #818cf8;
  --text-primary:  #f1f5f9;
  --text-secondary:#94a3b8;
  --text-muted:    #475569;
  --success:       #10b981;
  --warning:       #f59e0b;
  --danger:        #ef4444;
  --radius:        12px;
  --shadow:        0 4px 24px rgba(0,0,0,0.4);
  --navbar-bg:     rgba(10,10,15,0.92);
  --navbar-mobile-bg: rgba(10,10,15,0.98);
  --copy-box-bg:   #0f0f1a;
}

/* ── CSS Variables — Light Mode ─────────────────────────── */
/* Anti-flash: applied to <html> before body renders */
html.light-mode-preload body,
body.light-mode {
  --bg-primary:    #f4f6fb;
  --bg-secondary:  #eaecf4;
  --bg-card:       #ffffff;
  --border:        rgba(0,0,0,0.09);
  --border-accent: rgba(99,102,241,0.35);
  --accent:        #6366f1;
  --accent-glow:   rgba(99,102,241,0.12);
  --accent-hover:  #4f46e5;
  --text-primary:  #0f172a;
  --text-secondary:#334155;
  --text-muted:    #94a3b8;
  --success:       #059669;
  --warning:       #d97706;
  --danger:        #dc2626;
  --radius:        12px;
  --shadow:        0 4px 24px rgba(0,0,0,0.10);
  --navbar-bg:     rgba(255,255,255,0.92);
  --navbar-mobile-bg: rgba(255,255,255,0.98);
  --copy-box-bg:   #f1f5f9;
}

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

html { scroll-behavior: smooth; }

body {
  font-family: 'Exo 2', sans-serif;
  background: var(--bg-primary);
  color: var(--text-primary);
  min-height: 100vh;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent-hover); }
img { max-width: 100%; height: auto; display: block; }

/* ── Navbar ─────────────────────────────────────────────── */
.navbar {
  position: sticky;
  top: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  height: 60px;
  background: var(--navbar-bg);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}

.nav-logo {
  font-family: 'Rajdhani', sans-serif;
  font-size: 20px;
  font-weight: 700;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
}

.nav-links { display: flex; gap: 4px; }
.nav-links a {
  font-size: 14px;
  font-weight: 500;
  color: var(--text-secondary);
  padding: 6px 14px;
  border-radius: 8px;
  transition: all .2s;
  text-decoration: none;
}
.nav-links a:hover, .nav-links a.active {
  color: var(--text-primary);
  background: rgba(99,102,241,0.08);
}

.nav-auth { display: flex; align-items: center; gap: 8px; }

.online-pill {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--text-muted);
  background: var(--bg-secondary);
  padding: 4px 10px;
  border-radius: 20px;
  border: 1px solid var(--border);
}
.online-dot {
  width: 6px; height: 6px;
  background: var(--success);
  border-radius: 50%;
  animation: pulse 2s infinite;
}
@keyframes pulse {
  0%,100% { opacity: 1; }
  50% { opacity: .4; }
}

/* ── Buttons ─────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 16px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  font-family: 'Exo 2', sans-serif;
  cursor: pointer;
  transition: all .2s;
  border: none;
  text-decoration: none;
}
.btn-primary {
  background: var(--accent);
  color: #fff;
}
.btn-primary:hover { background: var(--accent-hover); color: #fff; }
.btn-ghost {
  background: var(--bg-secondary);
  color: var(--text-secondary);
  border: 1px solid var(--border);
}
.btn-ghost:hover { background: var(--border); color: var(--text-primary); }
.btn-full {
  width: 100%;
  justify-content: center;
  padding: 12px;
  background: var(--accent);
  color: #fff;
  border-radius: 8px;
  font-size: 15px;
  font-weight: 700;
  font-family: 'Exo 2', sans-serif;
  cursor: pointer;
  border: none;
  transition: all .2s;
}
.btn-full:hover { background: var(--accent-hover); }
.btn-upload {
  background: var(--accent);
  color: #fff;
  padding: 8px 18px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
}
.btn-upload:hover { background: var(--accent-hover); color: #fff; }

/* ── Hero ─────────────────────────────────────────────────── */
.hero {
  text-align: center;
  padding: 80px 24px 60px;
  position: relative;
  overflow: hidden;
}
.hero::before {
  content: '';
  position: absolute;
  top: -100px; left: 50%;
  transform: translateX(-50%);
  width: 600px; height: 600px;
  background: radial-gradient(circle, rgba(99,102,241,0.12) 0%, transparent 70%);
  pointer-events: none;
}
.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(99,102,241,0.1);
  border: 1px solid rgba(99,102,241,0.3);
  color: var(--accent-hover);
  padding: 6px 14px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
  margin-bottom: 20px;
}
.hero h1 {
  font-family: 'Rajdhani', sans-serif;
  font-size: clamp(32px, 6vw, 58px);
  font-weight: 700;
  line-height: 1.1;
  margin-bottom: 16px;
}
.highlight {
  background: linear-gradient(135deg, var(--accent), var(--accent-hover));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}
.hero-subtitle {
  font-size: 16px;
  color: var(--text-secondary);
  max-width: 640px;
  margin: 0 auto 32px;
  line-height: 1.7;
}
.stats-bar {
  display: flex;
  justify-content: center;
  gap: 48px;
  margin-top: 40px;
}
.stat-item { text-align: center; }
.stat-number {
  font-family: 'Rajdhani', sans-serif;
  font-size: 28px;
  font-weight: 700;
  color: var(--accent-hover);
}
.stat-label { font-size: 12px; color: var(--text-muted); margin-top: 2px; }

/* ── Search ───────────────────────────────────────────────── */
.search-wrap {
  position: relative;
  max-width: 540px;
  margin: 0 auto;
}
.search-wrap svg {
  position: absolute;
  left: 16px; top: 50%;
  transform: translateY(-50%);
  width: 18px; height: 18px;
  color: var(--text-muted);
}
.search-input {
  width: 100%;
  background: var(--bg-card);
  border: 1px solid var(--border-accent);
  border-radius: 12px;
  padding: 14px 16px 14px 44px;
  font-size: 14px;
  font-family: 'Exo 2', sans-serif;
  color: var(--text-primary);
  outline: none;
  transition: all .2s;
}
.search-input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-glow); }
.search-input::placeholder { color: var(--text-muted); }

/* ── Features ─────────────────────────────────────────────── */
.features {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 24px 48px;
}
.feature-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  transition: border-color .2s;
}
.feature-card:hover { border-color: var(--border-accent); }
.feature-icon { font-size: 28px; margin-bottom: 12px; }
.feature-title { font-family: 'Rajdhani', sans-serif; font-size: 17px; font-weight: 700; margin-bottom: 6px; }
.feature-desc { font-size: 13px; color: var(--text-secondary); line-height: 1.6; }

/* ── Scripts Section ─────────────────────────────────────── */
.section { max-width: 1100px; margin: 0 auto; padding: 0 24px 48px; }
.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
}
.section-title {
  font-family: 'Rajdhani', sans-serif;
  font-size: 22px;
  font-weight: 700;
  margin-right: 10px;
}
.script-count {
  font-size: 12px;
  color: var(--text-muted);
  background: var(--bg-card);
  border: 1px solid var(--border);
  padding: 3px 10px;
  border-radius: 20px;
}
.filter-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}
.filter-btn {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
  background: var(--bg-card);
  border: 1px solid var(--border);
  padding: 6px 14px;
  border-radius: 8px;
  cursor: pointer;
  transition: all .2s;
  text-decoration: none;
}
.filter-btn:hover, .filter-btn.active {
  color: var(--text-primary);
  border-color: var(--accent);
  background: var(--accent-glow);
}
.sort-select {
  margin-left: auto;
  background: var(--bg-card);
  border: 1px solid var(--border);
  color: var(--text-secondary);
  padding: 6px 12px;
  border-radius: 8px;
  font-size: 13px;
  font-family: 'Exo 2', sans-serif;
  cursor: pointer;
  outline: none;
}

/* ── Script Cards ─────────────────────────────────────────── */
.scripts-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
}
.script-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  text-decoration: none;
  transition: all .2s;
  display: block;
}
.script-card:hover { border-color: var(--border-accent); transform: translateY(-2px); box-shadow: var(--shadow); }
.script-thumb {
  position: relative;
  height: 160px;
  background: var(--bg-secondary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 40px;
  overflow: hidden;
}
.script-thumb img { width: 100%; height: 100%; object-fit: cover; }
.tag-free, .tag-key {
  position: absolute;
  top: 10px; right: 10px;
  font-size: 10px;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 4px;
}
.tag-free { background: rgba(16,185,129,0.9); color: #fff; }
.tag-key  { background: rgba(245,158,11,0.9); color: #000; }
.script-body { padding: 14px; }
.script-meta { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.game-tag {
  font-size: 11px;
  font-weight: 600;
  color: var(--accent-hover);
  background: var(--accent-glow);
  padding: 2px 8px;
  border-radius: 4px;
}
.script-stats { display: flex; gap: 10px; font-size: 12px; color: var(--text-muted); }
.script-title {
  font-size: 15px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 6px;
  line-height: 1.4;
}
.script-time { font-size: 11px; color: var(--text-muted); }

/* ── Pagination ───────────────────────────────────────────── */
.pagination { display: flex; gap: 8px; justify-content: center; margin-top: 32px; flex-wrap: wrap; }
.page-btn {
  width: 36px; height: 36px;
  display: flex; align-items: center; justify-content: center;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 13px;
  color: var(--text-secondary);
  text-decoration: none;
  transition: all .2s;
}
.page-btn:hover, .page-btn.active {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

/* ── FAQ ──────────────────────────────────────────────────── */
.faq-section { max-width: 860px; margin: 0 auto; padding: 0 24px 60px; }
.faq-title {
  font-family: 'Rajdhani', sans-serif;
  font-size: 26px;
  font-weight: 700;
  margin-bottom: 20px;
}
.faq-item {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 10px;
  overflow: hidden;
}
.faq-q {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  cursor: pointer;
  font-size: 15px;
  font-weight: 600;
  color: var(--text-primary);
  transition: background .2s;
}
.faq-q:hover { background: rgba(255,255,255,0.03); }
.faq-a {
  max-height: 0;
  overflow: hidden;
  transition: max-height .3s ease, padding .3s;
  font-size: 14px;
  color: var(--text-secondary);
  line-height: 1.7;
  padding: 0 20px;
}
.faq-item.open .faq-a { max-height: 300px; padding: 0 20px 16px; }
.chevron { width: 18px; height: 18px; transition: transform .3s; flex-shrink: 0; }
.faq-item.open .chevron { transform: rotate(180deg); }

/* ── Content Section ─────────────────────────────────────── */
.content-section { max-width: 900px; margin: 0 auto; padding: 0 24px 60px; position: relative; z-index: 1; }
.content-section h2 { font-family: 'Rajdhani', sans-serif; font-size: 28px; font-weight: 700; margin-bottom: 16px; color: var(--text-primary); }
.content-section h3 { font-family: 'Rajdhani', sans-serif; font-size: 22px; font-weight: 700; margin: 32px 0 12px; color: var(--accent); }
.content-section p { font-size: 15px; color: var(--text-secondary); line-height: 1.8; margin-bottom: 14px; }
.content-section strong { color: var(--text-primary); }
.content-section ol, .content-section ul { padding-left: 20px; margin-bottom: 14px; }
.content-section ol li, .content-section ul li { font-size: 15px; color: var(--text-secondary); line-height: 1.8; margin-bottom: 8px; }
.content-section a { color: var(--accent); text-decoration: none; }
.content-section a:hover { text-decoration: underline; }
.conclusion-box { background: var(--bg-card); border: 1px solid var(--border-accent); border-radius: 12px; padding: 24px; margin-top: 16px; }
.conclusion-box p { margin-bottom: 0; }

/* ── Footer ───────────────────────────────────────────────── */
footer {
  background: var(--bg-secondary);
  border-top: 1px solid var(--border);
  padding: 48px 24px 24px;
}
.footer-inner {
  max-width: 1100px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 40px;
  margin-bottom: 32px;
}
.footer-brand .nav-logo { margin-bottom: 12px; display: inline-flex; }
.footer-desc { font-size: 13px; color: var(--text-muted); line-height: 1.7; margin-bottom: 16px; }
.footer-stat { font-size: 13px; color: var(--text-muted); margin-bottom: 4px; }
.footer-stat strong { color: var(--text-primary); }
.footer-col h4 { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: 1px; color: var(--text-muted); margin-bottom: 14px; }
.footer-col a { display: block; font-size: 13px; color: var(--text-secondary); margin-bottom: 8px; text-decoration: none; transition: color .2s; }
.footer-col a:hover { color: var(--text-primary); }
.footer-bottom {
  max-width: 1100px;
  margin: 0 auto;
  padding-top: 20px;
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 12px;
  color: var(--text-muted);
}

/* ── Auth Pages ───────────────────────────────────────────── */
.auth-page { display: flex; align-items: center; justify-content: center; min-height: 100vh; padding: 24px; }
.auth-box {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 36px;
  width: 100%;
  max-width: 420px;
}
.auth-logo {
  font-family: 'Rajdhani', sans-serif;
  font-size: 22px;
  font-weight: 700;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 24px;
  text-decoration: none;
}
.auth-box h2 { font-family: 'Rajdhani', sans-serif; font-size: 26px; font-weight: 700; margin-bottom: 24px; }
.auth-switch { text-align: center; font-size: 13px; color: var(--text-muted); margin-top: 20px; }
.auth-switch a { color: var(--accent); }

/* ── Forms ────────────────────────────────────────────────── */
.form-group { margin-bottom: 16px; }
.form-group label { display: block; font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: .5px; color: var(--text-secondary); margin-bottom: 7px; }
.form-group input, .form-group textarea, .form-group select {
  width: 100%;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 11px 14px;
  font-size: 14px;
  font-family: 'Exo 2', sans-serif;
  color: var(--text-primary);
  outline: none;
  transition: all .2s;
}
.form-group input:focus, .form-group textarea:focus, .form-group select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-glow);
}
.form-group input::placeholder, .form-group textarea::placeholder { color: var(--text-muted); }

/* ── Alerts ───────────────────────────────────────────────── */
.alert { padding: 12px 16px; border-radius: 8px; font-size: 14px; margin-bottom: 16px; }
.alert-error { background: rgba(239,68,68,0.1); border: 1px solid rgba(239,68,68,0.3); color: #fca5a5; }
.alert-success { background: rgba(16,185,129,0.1); border: 1px solid rgba(16,185,129,0.3); color: #6ee7b7; }

/* ── Static Pages ─────────────────────────────────────────── */
.static-page { max-width: 860px; margin: 0 auto; padding: 50px 24px 80px; position: relative; z-index: 1; }
.static-page h1 { font-family: 'Rajdhani', sans-serif; font-size: clamp(28px, 5vw, 42px); font-weight: 700; margin-bottom: 8px; }
.static-page .page-meta { font-size: 13px; color: var(--text-muted); margin-bottom: 36px; padding-bottom: 20px; border-bottom: 1px solid var(--border); }
.static-page h2 { font-family: 'Rajdhani', sans-serif; font-size: 22px; font-weight: 700; color: var(--accent); margin: 36px 0 12px; }
.static-page h3 { font-family: 'Rajdhani', sans-serif; font-size: 18px; font-weight: 700; color: var(--text-primary); margin: 24px 0 10px; }
.static-page p { font-size: 15px; color: var(--text-secondary); line-height: 1.8; margin-bottom: 14px; }
.static-page ul, .static-page ol { padding-left: 22px; margin-bottom: 14px; }
.static-page ul li, .static-page ol li { font-size: 15px; color: var(--text-secondary); line-height: 1.8; margin-bottom: 6px; }
.static-page strong { color: var(--text-primary); }
.static-page a { color: var(--accent); }

/* ── Script Detail Page ───────────────────────────────────── */
.script-layout { display: grid; grid-template-columns: 1fr 300px; gap: 24px; max-width: 1100px; margin: 0 auto; padding: 32px 24px 60px; }
.script-header-box { background: var(--bg-card); border: 1px solid var(--border); border-radius: 14px; overflow: hidden; margin-bottom: 20px; }
.script-header-thumb { width: 100%; height: 220px; object-fit: cover; background: var(--bg-secondary); display: flex; align-items: center; justify-content: center; font-size: 60px; }
.script-header-body { padding: 20px 24px; }
.script-header-title { font-family: 'Rajdhani', sans-serif; font-size: 26px; font-weight: 700; margin-bottom: 8px; }
.script-header-meta { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; font-size: 13px; color: var(--text-muted); margin-bottom: 12px; }
.copy-box { background: var(--copy-box-bg, var(--bg-secondary)); border: 1px solid var(--border); border-radius: 10px; padding: 16px; margin-bottom: 16px; position: relative; }
.copy-box pre { font-family: 'Courier New', monospace; font-size: 13px; color: var(--text-secondary); white-space: pre-wrap; word-break: break-all; max-height: 200px; overflow-y: auto; }
.copy-btn { position: absolute; top: 10px; right: 10px; background: var(--accent); color: #fff; border: none; padding: 5px 12px; border-radius: 6px; font-size: 12px; cursor: pointer; }

/* ── Upload Page ──────────────────────────────────────────── */
.upload-page { max-width: 760px; margin: 0 auto; padding: 40px 24px 80px; }
.upload-page h1 { font-family: 'Rajdhani', sans-serif; font-size: 32px; font-weight: 700; margin-bottom: 28px; }
.upload-box { background: var(--bg-card); border: 1px solid var(--border); border-radius: 14px; padding: 28px; }

/* ── Responsive ───────────────────────────────────────────── */
.nav-hamburger {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 36px;
  height: 36px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
  border-radius: 8px;
  transition: background .2s;
}
.nav-hamburger:hover { background: rgba(255,255,255,0.06); }
.nav-hamburger span {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--text-primary);
  border-radius: 2px;
  transition: transform .3s, opacity .3s;
}
.nav-hamburger.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-hamburger.open span:nth-child(2) { opacity: 0; }
.nav-hamburger.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

@media (max-width: 768px) {
  .footer-inner { grid-template-columns: 1fr 1fr; }
  .script-layout { grid-template-columns: 1fr; }
  .stats-bar { gap: 24px; }

  .nav-hamburger { display: flex; }

  .nav-links {
    display: none;
    position: absolute;
    top: 60px;
    left: 0;
    right: 0;
    background: var(--navbar-mobile-bg);
    backdrop-filter: blur(16px);
    border-bottom: 1px solid var(--border);
    flex-direction: column;
    padding: 12px 16px 16px;
    gap: 4px;
    z-index: 99;
  }
  .nav-links.open { display: flex; }
  .nav-links a { padding: 10px 14px; font-size: 15px; border-radius: 10px; }
  .nav-auth .online-pill { display: none; }
  .nav-auth .btn { font-size: 12px; padding: 6px 10px; }
}
@media (max-width: 480px) {
  .footer-inner { grid-template-columns: 1fr; }
  .navbar { padding: 0 16px; }
}
