/* assets/css/style.css */
@import url('https://fonts.googleapis.com/css2?family=Space+Mono:wght@400;700&family=Syne:wght@400;600;700;800&display=swap');

/* ── Variables ───────────────────────────────────────── */
:root {
  --bg:         #0a0a0f;
  --bg2:        #111118;
  --bg3:        #1a1a26;
  --border:     #2a2a3e;
  --accent:     #6c47ff;
  --accent2:    #00e5a0;
  --accent3:    #ff4757;
  --text:       #e8e8f0;
  --text2:      #8888aa;
  --text3:      #55556a;
  --card-bg:    #13131f;
  --radius:     14px;
  --radius-sm:  8px;
  --shadow:     0 8px 40px rgba(108,71,255,.15);
  --transition: .25s cubic-bezier(.4,0,.2,1);
  --font-head:  'Syne', sans-serif;
  --font-mono:  'Space Mono', monospace;
}

/* ── Reset ───────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-head);
  min-height: 100vh;
  overflow-x: hidden;
}
a { color: inherit; text-decoration: none; }
img { max-width: 100%; }
button, input, select, textarea { font-family: inherit; }

/* ── Grid noise background ───────────────────────────── */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  background-image:
    linear-gradient(rgba(108,71,255,.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(108,71,255,.04) 1px, transparent 1px);
  background-size: 40px 40px;
  pointer-events: none;
  z-index: 0;
}

/* ── Navigation ──────────────────────────────────────── */
.navbar {
  position: sticky; top: 0; z-index: 100;
  background: rgba(10,10,15,.85);
  backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border);
  padding: 0 2rem;
  display: flex; align-items: center; gap: 2rem;
  height: 68px;
}
.navbar-brand {
  display: flex; align-items: center; gap: .75rem;
  font-size: 1.25rem; font-weight: 800;
  letter-spacing: -.02em; white-space: nowrap;
}
.navbar-brand .logo-icon {
  width: 36px; height: 36px;
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.1rem;
}
.navbar-search {
  flex: 1; max-width: 420px;
  position: relative;
}
.navbar-search input {
  width: 100%; padding: .6rem 1rem .6rem 2.8rem;
  background: var(--bg3); border: 1px solid var(--border);
  border-radius: 50px; color: var(--text); font-size: .9rem;
  transition: var(--transition);
}
.navbar-search input:focus {
  outline: none; border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(108,71,255,.2);
}
.navbar-search .search-icon {
  position: absolute; left: .9rem; top: 50%; transform: translateY(-50%);
  color: var(--text3); pointer-events: none;
}
.navbar-nav { display: flex; align-items: center; gap: .5rem; margin-left: auto; }
.nav-link {
  padding: .5rem .9rem; border-radius: var(--radius-sm);
  font-size: .88rem; font-weight: 600; color: var(--text2);
  transition: var(--transition);
}
.nav-link:hover { background: var(--bg3); color: var(--text); }
.btn { display: inline-flex; align-items: center; gap: .5rem; cursor: pointer; border: none; border-radius: var(--radius-sm); font-weight: 700; font-size: .9rem; transition: var(--transition); padding: .55rem 1.2rem; }
.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover { background: #7c5cff; transform: translateY(-1px); box-shadow: var(--shadow); }
.btn-secondary { background: var(--bg3); color: var(--text); border: 1px solid var(--border); }
.btn-secondary:hover { border-color: var(--accent); color: var(--accent); }
.btn-success { background: var(--accent2); color: #000; font-weight: 800; }
.btn-success:hover { background: #00ffb2; transform: translateY(-1px); }
.btn-danger { background: var(--accent3); color: #fff; }
.btn-lg { padding: .8rem 2rem; font-size: 1rem; border-radius: var(--radius); }
.btn-sm { padding: .35rem .8rem; font-size: .8rem; }

/* ── Layout ──────────────────────────────────────────── */
.container { max-width: 1280px; margin: 0 auto; padding: 0 1.5rem; position: relative; z-index: 1; }
.section { padding: 4rem 0; }
.section-title { font-size: 1.6rem; font-weight: 800; margin-bottom: 1.5rem; display: flex; align-items: center; gap: .75rem; }
.section-title::before { content: ''; width: 4px; height: 1.4em; background: linear-gradient(var(--accent), var(--accent2)); border-radius: 2px; }

/* ── Hero ────────────────────────────────────────────── */
.hero {
  padding: 6rem 0 4rem;
  text-align: center;
  position: relative;
}
.hero-glow {
  position: absolute; top: -100px; left: 50%; transform: translateX(-50%);
  width: 600px; height: 400px;
  background: radial-gradient(ellipse, rgba(108,71,255,.25) 0%, transparent 70%);
  pointer-events: none;
}
.hero h1 {
  font-size: clamp(2.5rem, 6vw, 4.5rem);
  font-weight: 800; line-height: 1.05;
  letter-spacing: -.03em; margin-bottom: 1rem;
}
.hero h1 span { color: var(--accent2); }
.hero p { color: var(--text2); font-size: 1.15rem; max-width: 560px; margin: 0 auto 2rem; }
.hero-actions { display: flex; gap: 1rem; justify-content: center; flex-wrap: wrap; }
.hero-stats {
  display: flex; gap: 3rem; justify-content: center; margin-top: 3rem;
}
.stat { text-align: center; }
.stat-num { font-size: 2rem; font-weight: 800; color: var(--accent2); }
.stat-label { font-size: .8rem; color: var(--text3); font-family: var(--font-mono); margin-top: .2rem; }

/* ── Category Pills ──────────────────────────────────── */
.category-bar {
  display: flex; gap: .75rem; overflow-x: auto; padding: 1rem 0;
  scrollbar-width: none;
}
.category-bar::-webkit-scrollbar { display: none; }
.cat-pill {
  display: flex; align-items: center; gap: .5rem;
  padding: .5rem 1.1rem; background: var(--bg3);
  border: 1px solid var(--border); border-radius: 50px;
  font-size: .85rem; font-weight: 600; white-space: nowrap;
  cursor: pointer; transition: var(--transition); color: var(--text2);
}
.cat-pill:hover, .cat-pill.active {
  background: var(--accent); border-color: var(--accent); color: #fff;
}

/* ── App Cards ───────────────────────────────────────── */
.apps-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 1.25rem;
}
.app-card {
  background: var(--card-bg); border: 1px solid var(--border);
  border-radius: var(--radius); overflow: hidden;
  transition: var(--transition); cursor: pointer; position: relative;
}
.app-card:hover {
  transform: translateY(-4px);
  border-color: var(--accent);
  box-shadow: 0 20px 60px rgba(108,71,255,.2);
}
.app-card.featured::before {
  content: 'Featured';
  position: absolute; top: 10px; right: 10px; z-index: 2;
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  color: #fff; font-size: .7rem; font-weight: 700;
  padding: .2rem .6rem; border-radius: 50px;
  font-family: var(--font-mono);
}
.app-icon {
  width: 100%; aspect-ratio: 1;
  background: linear-gradient(135deg, var(--bg3), var(--bg2));
  display: flex; align-items: center; justify-content: center;
  font-size: 3.5rem; position: relative; overflow: hidden;
}
.app-icon img { width: 100%; height: 100%; object-fit: cover; }
.app-info { padding: 1rem; }
.app-name { font-size: .95rem; font-weight: 700; margin-bottom: .25rem; }
.app-developer { font-size: .78rem; color: var(--text3); font-family: var(--font-mono); margin-bottom: .5rem; }
.app-meta { display: flex; align-items: center; justify-content: space-between; }
.app-rating { display: flex; align-items: center; gap: .3rem; font-size: .8rem; }
.star { color: #ffb800; font-size: .85rem; }
.star.filled { color: #ffb800; }
.star.half { color: #ffb800; opacity: .6; }
.star:not(.filled):not(.half) { color: var(--text3); }
.app-price {
  font-size: .85rem; font-weight: 800;
  color: var(--accent2);
}
.app-price.free { color: var(--text3); }

/* ── App Detail Page ─────────────────────────────────── */
.app-detail-header {
  display: flex; gap: 2.5rem; align-items: flex-start;
  padding: 3rem 0 2rem;
}
.detail-icon {
  width: 120px; height: 120px; flex-shrink: 0;
  border-radius: 24px; overflow: hidden;
  background: var(--bg3); border: 1px solid var(--border);
  display: flex; align-items: center; justify-content: center; font-size: 4rem;
}
.detail-icon img { width: 100%; height: 100%; object-fit: cover; }
.detail-info h1 { font-size: 2rem; font-weight: 800; margin-bottom: .3rem; }
.detail-developer { color: var(--text2); margin-bottom: .75rem; font-size: .95rem; }
.detail-badges { display: flex; gap: .5rem; flex-wrap: wrap; margin-bottom: 1rem; }
.badge {
  padding: .25rem .7rem; border-radius: 50px; font-size: .75rem; font-weight: 700;
  font-family: var(--font-mono); background: var(--bg3); border: 1px solid var(--border);
  color: var(--text2);
}
.badge.accent { background: rgba(108,71,255,.15); border-color: var(--accent); color: var(--accent); }
.detail-price-box {
  background: var(--card-bg); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 1.5rem;
  display: flex; align-items: center; gap: 1.5rem; flex-wrap: wrap;
  margin: 2rem 0;
}
.price-display { font-size: 2.5rem; font-weight: 800; color: var(--accent2); }
.screenshots-row {
  display: flex; gap: 1rem; overflow-x: auto;
  padding: 1rem 0; scrollbar-width: thin;
}
.screenshots-row img {
  height: 300px; width: auto; border-radius: var(--radius-sm);
  border: 1px solid var(--border); cursor: pointer;
  transition: var(--transition);
}
.screenshots-row img:hover { border-color: var(--accent); }
.detail-layout { display: grid; grid-template-columns: 1fr 300px; gap: 2rem; }
.detail-sidebar { display: flex; flex-direction: column; gap: 1rem; }
.sidebar-card {
  background: var(--card-bg); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 1.25rem;
}
.sidebar-card h4 { font-size: .85rem; color: var(--text2); margin-bottom: .75rem; font-family: var(--font-mono); }
.info-row { display: flex; justify-content: space-between; padding: .4rem 0; border-bottom: 1px solid var(--border); font-size: .88rem; }
.info-row:last-child { border: none; }
.info-row span:first-child { color: var(--text2); }
.info-row span:last-child { font-weight: 600; }

/* ── Reviews ─────────────────────────────────────────── */
.reviews-section { margin-top: 2rem; }
.review-card {
  background: var(--bg3); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 1rem; margin-bottom: 1rem;
}
.review-header { display: flex; justify-content: space-between; margin-bottom: .5rem; }
.review-author { font-weight: 700; font-size: .9rem; }
.review-date { font-size: .78rem; color: var(--text3); font-family: var(--font-mono); }
.review-title { font-weight: 600; margin-bottom: .3rem; }
.review-body { color: var(--text2); font-size: .9rem; line-height: 1.6; }
.review-form { background: var(--card-bg); border: 1px solid var(--border); border-radius: var(--radius); padding: 1.5rem; margin-top: 1.5rem; }
.form-group { margin-bottom: 1rem; }
.form-label { display: block; font-size: .85rem; font-weight: 600; margin-bottom: .4rem; color: var(--text2); }
.form-control {
  width: 100%; padding: .65rem 1rem;
  background: var(--bg3); border: 1px solid var(--border);
  border-radius: var(--radius-sm); color: var(--text); font-size: .9rem;
  transition: var(--transition);
}
.form-control:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(108,71,255,.15); }
textarea.form-control { resize: vertical; min-height: 100px; }
.star-input { display: flex; gap: .3rem; margin-bottom: .5rem; }
.star-input label { font-size: 1.5rem; cursor: pointer; color: var(--text3); transition: color .15s; }
.star-input input { display: none; }
.star-input input:checked ~ label,
.star-input label:hover,
.star-input label:hover ~ label { color: #ffb800; }

/* ── Auth Pages ──────────────────────────────────────── */
.auth-page { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 2rem; }
.auth-card { background: var(--card-bg); border: 1px solid var(--border); border-radius: 20px; padding: 2.5rem; width: 100%; max-width: 440px; }
.auth-card h2 { font-size: 1.8rem; font-weight: 800; margin-bottom: .25rem; }
.auth-card p { color: var(--text2); margin-bottom: 2rem; font-size: .9rem; }
.auth-footer { text-align: center; margin-top: 1.5rem; font-size: .88rem; color: var(--text2); }
.auth-footer a { color: var(--accent); font-weight: 600; }
.alert { padding: .75rem 1rem; border-radius: var(--radius-sm); margin-bottom: 1rem; font-size: .9rem; }
.alert-error { background: rgba(255,71,87,.1); border: 1px solid var(--accent3); color: #ff6b7a; }
.alert-success { background: rgba(0,229,160,.1); border: 1px solid var(--accent2); color: var(--accent2); }

/* ── Dashboard / My Apps ─────────────────────────────── */
.dashboard-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 1.25rem; }
.purchase-card {
  background: var(--card-bg); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 1.25rem;
  display: flex; gap: 1rem; align-items: center;
  transition: var(--transition);
}
.purchase-card:hover { border-color: var(--accent); }
.purchase-icon { width: 60px; height: 60px; border-radius: 14px; overflow: hidden; flex-shrink: 0; background: var(--bg3); display: flex; align-items: center; justify-content: center; font-size: 1.8rem; }
.purchase-icon img { width: 100%; height: 100%; object-fit: cover; }
.purchase-info h4 { font-size: .95rem; font-weight: 700; margin-bottom: .25rem; }
.purchase-info p { font-size: .8rem; color: var(--text2); font-family: var(--font-mono); }

/* ── PayPal Modal ────────────────────────────────────── */
.modal-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,.7);
  z-index: 1000; display: flex; align-items: center; justify-content: center;
  opacity: 0; pointer-events: none; transition: opacity .25s;
}
.modal-overlay.open { opacity: 1; pointer-events: all; }
.modal {
  background: var(--card-bg); border: 1px solid var(--border);
  border-radius: 20px; padding: 2rem; width: 90%; max-width: 480px;
  transform: translateY(20px); transition: transform .25s;
}
.modal-overlay.open .modal { transform: translateY(0); }
.modal-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 1.5rem; }
.modal-title { font-size: 1.3rem; font-weight: 800; }
.modal-close { background: none; border: none; color: var(--text2); font-size: 1.5rem; cursor: pointer; }
#paypal-button-container { min-height: 100px; }

/* ── Lightbox ────────────────────────────────────────── */
.lightbox {
  position: fixed; inset: 0; background: rgba(0,0,0,.92);
  z-index: 2000; display: flex; align-items: center; justify-content: center;
  opacity: 0; pointer-events: none; transition: opacity .2s;
}
.lightbox.open { opacity: 1; pointer-events: all; }
.lightbox img { max-width: 90vw; max-height: 90vh; border-radius: var(--radius); }
.lightbox-close { position: absolute; top: 1.5rem; right: 1.5rem; color: #fff; font-size: 2rem; cursor: pointer; background: none; border: none; }

/* ── Footer ──────────────────────────────────────────── */
footer {
  background: var(--bg2); border-top: 1px solid var(--border);
  padding: 3rem 0 1.5rem; margin-top: 4rem; position: relative; z-index: 1;
}
.footer-grid { display: grid; grid-template-columns: 2fr 1fr 1fr 1fr; gap: 2rem; margin-bottom: 2rem; }
.footer-brand p { color: var(--text2); font-size: .88rem; line-height: 1.7; margin-top: .75rem; }
footer h4 { font-size: .85rem; font-weight: 700; margin-bottom: 1rem; color: var(--text2); text-transform: uppercase; letter-spacing: .05em; font-family: var(--font-mono); }
footer ul { list-style: none; display: flex; flex-direction: column; gap: .5rem; }
footer ul a { color: var(--text2); font-size: .88rem; transition: color .2s; }
footer ul a:hover { color: var(--accent2); }
.footer-bottom { border-top: 1px solid var(--border); padding-top: 1.5rem; display: flex; justify-content: space-between; align-items: center; font-size: .82rem; color: var(--text3); }

/* ── Admin ───────────────────────────────────────────── */
.admin-layout { display: grid; grid-template-columns: 240px 1fr; min-height: calc(100vh - 68px); }
.admin-sidebar {
  background: var(--bg2); border-right: 1px solid var(--border);
  padding: 1.5rem 1rem;
}
.admin-menu { display: flex; flex-direction: column; gap: .25rem; }
.admin-menu a {
  display: flex; align-items: center; gap: .75rem;
  padding: .65rem 1rem; border-radius: var(--radius-sm);
  color: var(--text2); font-size: .9rem; font-weight: 600;
  transition: var(--transition);
}
.admin-menu a:hover, .admin-menu a.active { background: var(--bg3); color: var(--text); }
.admin-menu a.active { border-left: 3px solid var(--accent); }
.admin-content { padding: 2rem; }
.stats-cards { display: grid; grid-template-columns: repeat(4,1fr); gap: 1.25rem; margin-bottom: 2rem; }
.stat-card { background: var(--card-bg); border: 1px solid var(--border); border-radius: var(--radius); padding: 1.25rem; }
.stat-card .num { font-size: 2rem; font-weight: 800; }
.stat-card .label { font-size: .8rem; color: var(--text2); font-family: var(--font-mono); }
.data-table { width: 100%; border-collapse: collapse; }
.data-table th { text-align: left; padding: .75rem 1rem; border-bottom: 2px solid var(--border); font-size: .82rem; font-family: var(--font-mono); color: var(--text2); font-weight: 700; text-transform: uppercase; }
.data-table td { padding: .75rem 1rem; border-bottom: 1px solid var(--border); font-size: .9rem; }
.data-table tr:hover td { background: var(--bg3); }

/* ── Utilities ───────────────────────────────────────── */
.text-muted { color: var(--text2); }
.text-accent { color: var(--accent); }
.text-success { color: var(--accent2); }
.text-danger { color: var(--accent3); }
.mt-1 { margin-top: .5rem; } .mt-2 { margin-top: 1rem; } .mt-3 { margin-top: 1.5rem; } .mt-4 { margin-top: 2rem; }
.mb-1 { margin-bottom: .5rem; } .mb-2 { margin-bottom: 1rem; }
.flex { display: flex; } .items-center { align-items: center; } .gap-1 { gap: .5rem; } .gap-2 { gap: 1rem; }
.hidden { display: none !important; }

/* ── Responsive ──────────────────────────────────────── */
@media (max-width: 1024px) {
  .detail-layout { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .admin-layout { grid-template-columns: 1fr; }
  .admin-sidebar { display: none; }
  .stats-cards { grid-template-columns: repeat(2,1fr); }
}
@media (max-width: 768px) {
  .navbar { padding: 0 1rem; }
  .navbar-search { display: none; }
  .hero h1 { font-size: 2.2rem; }
  .hero-stats { gap: 1.5rem; }
  .app-detail-header { flex-direction: column; }
  .footer-grid { grid-template-columns: 1fr; }
  .apps-grid { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); }
}
