/* ================================================================
   style.css — Digital PDF Store
   Minimal Modern Design | Mobile Responsive
   ================================================================ */

/* ── Google Font Import ─────────────────────────────────────── */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap');

/* ── CSS Variables ──────────────────────────────────────────── */
:root {
  --clr-bg:       #f8f9fc;
  --clr-surface:  #ffffff;
  --clr-primary:  #4f46e5;   /* indigo */
  --clr-primary-h:#3730a3;
  --clr-accent:   #10b981;   /* emerald */
  --clr-text:     #1e1b4b;
  --clr-muted:    #6b7280;
  --clr-border:   #e5e7eb;
  --clr-danger:   #ef4444;

  --radius:       12px;
  --shadow-sm:    0 1px 3px rgba(0,0,0,.08), 0 1px 2px rgba(0,0,0,.04);
  --shadow-md:    0 4px 16px rgba(79,70,229,.12);
  --shadow-lg:    0 10px 40px rgba(79,70,229,.18);
  --transition:   all .22s ease;

  --font:         'Inter', system-ui, sans-serif;
}

/* ── Reset ──────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: var(--font);
  background: var(--clr-bg);
  color: var(--clr-text);
  line-height: 1.6;
  font-size: 16px;
}
a { text-decoration: none; color: inherit; }
img { max-width: 100%; display: block; }
ul { list-style: none; }

/* ── Typography ─────────────────────────────────────────────── */
h1, h2, h3, h4 { font-weight: 700; line-height: 1.3; }
h1 { font-size: clamp(1.8rem, 4vw, 2.8rem); }
h2 { font-size: clamp(1.4rem, 3vw, 2rem); }
h3 { font-size: 1.15rem; }
p  { color: var(--clr-muted); }

/* ── Buttons ────────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: .45rem;
  padding: .65rem 1.4rem;
  border-radius: 8px;
  font-size: .9rem;
  font-weight: 600;
  cursor: pointer;
  border: 2px solid transparent;
  transition: var(--transition);
}
.btn-primary {
  background: var(--clr-primary);
  color: #fff;
}
.btn-primary:hover {
  background: var(--clr-primary-h);
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
}
.btn-outline {
  background: transparent;
  border-color: var(--clr-primary);
  color: var(--clr-primary);
}
.btn-outline:hover {
  background: var(--clr-primary);
  color: #fff;
}
.btn-success {
  background: var(--clr-accent);
  color: #fff;
  font-size: 1rem;
  padding: .8rem 2rem;
}
.btn-success:hover {
  background: #059669;
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(16,185,129,.35);
}
.btn-danger {
  background: var(--clr-danger);
  color: #fff;
}
.btn-danger:hover { background: #dc2626; }

/* ── Navbar ─────────────────────────────────────────────────── */
.navbar {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(255,255,255,.88);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--clr-border);
}
.nav-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1.5rem;
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.nav-logo {
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--clr-primary);
  letter-spacing: -.5px;
}
.nav-logo span { color: var(--clr-text); }
.nav-links { display: flex; gap: 1.8rem; align-items: center; }
.nav-links a { font-size: .92rem; font-weight: 500; color: var(--clr-muted); transition: color .18s; }
.nav-links a:hover { color: var(--clr-primary); }

/* ── Hero Section ───────────────────────────────────────────── */
.hero {
  background: linear-gradient(135deg, #312e81 0%, #4f46e5 55%, #818cf8 100%);
  color: #fff;
  text-align: center;
  padding: 5rem 1.5rem 4rem;
}
.hero h1 { color: #fff; margin-bottom: 1rem; }
.hero p  { color: rgba(255,255,255,.82); font-size: 1.1rem; max-width: 560px; margin: 0 auto 2rem; }
.hero-badge {
  display: inline-block;
  background: rgba(255,255,255,.18);
  border: 1px solid rgba(255,255,255,.3);
  color: #fff;
  font-size: .78rem;
  font-weight: 600;
  letter-spacing: 1px;
  text-transform: uppercase;
  padding: .3rem .9rem;
  border-radius: 20px;
  margin-bottom: 1.2rem;
}

/* ── Section ────────────────────────────────────────────────── */
.section { padding: 4rem 1.5rem; max-width: 1200px; margin: 0 auto; }
.section-title {
  font-size: 1.5rem;
  margin-bottom: .4rem;
}
.section-sub {
  color: var(--clr-muted);
  margin-bottom: 2.5rem;
  font-size: .95rem;
}

/* ── PDF Card Grid ──────────────────────────────────────────── */
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(270px, 1fr));
  gap: 1.6rem;
}
.pdf-card {
  background: var(--clr-surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
  transition: var(--transition);
  display: flex;
  flex-direction: column;
  cursor: pointer;
}
.pdf-card:hover {
  transform: translateY(-5px);
  box-shadow: var(--shadow-lg);
}
.pdf-card-cover {
  position: relative;
  aspect-ratio: 3/4;
  background: linear-gradient(135deg, #e0e7ff 0%, #c7d2fe 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}
.pdf-card-cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.pdf-cover-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: .6rem;
  color: var(--clr-primary);
}
.pdf-cover-placeholder svg { opacity: .6; }
.pdf-cover-placeholder span { font-weight: 700; font-size: .85rem; color: var(--clr-primary); opacity: .7; }
.pdf-card-badge {
  position: absolute;
  top: .75rem;
  right: .75rem;
  background: var(--clr-primary);
  color: #fff;
  font-size: .72rem;
  font-weight: 700;
  padding: .25rem .65rem;
  border-radius: 20px;
}
.pdf-card-body {
  padding: 1.2rem;
  flex: 1;
  display: flex;
  flex-direction: column;
}
.pdf-card-title {
  font-size: 1rem;
  font-weight: 700;
  margin-bottom: .4rem;
  color: var(--clr-text);
  line-height: 1.4;
}
.pdf-card-desc {
  font-size: .85rem;
  color: var(--clr-muted);
  flex: 1;
  margin-bottom: 1rem;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.pdf-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.pdf-price {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--clr-primary);
}
.pdf-price small {
  font-size: .7rem;
  font-weight: 500;
  color: var(--clr-muted);
  margin-left: 2px;
}

/* ── Loading Spinner ────────────────────────────────────────── */
.spinner-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 4rem;
  width: 100%;
  grid-column: 1/-1;
}
.spinner {
  width: 40px; height: 40px;
  border: 3px solid var(--clr-border);
  border-top-color: var(--clr-primary);
  border-radius: 50%;
  animation: spin .7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ── Empty state ────────────────────────────────────────────── */
.empty-state {
  text-align: center;
  padding: 4rem 1.5rem;
  grid-column: 1/-1;
}
.empty-state svg { opacity: .3; margin: 0 auto 1rem; }
.empty-state p { color: var(--clr-muted); }

/* ── Footer ─────────────────────────────────────────────────── */
.footer {
  background: var(--clr-text);
  color: rgba(255,255,255,.65);
  text-align: center;
  padding: 2rem 1.5rem;
  font-size: .85rem;
  margin-top: 4rem;
}
.footer a { color: rgba(255,255,255,.85); transition: color .18s; }
.footer a:hover { color: #fff; }

/* ── Product Detail Page ────────────────────────────────────── */
.product-hero {
  background: linear-gradient(135deg, #312e81, #4f46e5);
  padding: 3rem 1.5rem;
  color: #fff;
}
.product-hero-inner {
  max-width: 980px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: 2.5rem;
  align-items: start;
}
.product-cover-lg {
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-lg);
  aspect-ratio: 3/4;
  background: rgba(255,255,255,.15);
  display: flex;
  align-items: center;
  justify-content: center;
}
.product-cover-lg img { width: 100%; height: 100%; object-fit: cover; }
.product-meta h1 { color: #fff; margin-bottom: 1rem; }
.product-meta p  { color: rgba(255,255,255,.8); margin-bottom: 1.5rem; }
.product-price-big {
  font-size: 2.2rem;
  font-weight: 700;
  color: #fff;
  margin-bottom: 1.5rem;
}
.product-price-big small { font-size: .95rem; opacity: .7; }
.product-tags { display: flex; flex-wrap: wrap; gap: .5rem; margin-bottom: 1.5rem; }
.tag {
  background: rgba(255,255,255,.18);
  border: 1px solid rgba(255,255,255,.3);
  color: #fff;
  font-size: .75rem;
  padding: .25rem .65rem;
  border-radius: 20px;
}

.product-body { max-width: 980px; margin: 0 auto; padding: 2.5rem 1.5rem; }
.product-section { margin-bottom: 2.5rem; }
.product-section h2 { font-size: 1.2rem; margin-bottom: 1rem; color: var(--clr-text); border-bottom: 2px solid var(--clr-border); padding-bottom: .5rem; }
.product-section p, .product-section ul, .product-section li { color: var(--clr-muted); }
.product-section li { padding: .3rem 0; padding-left: 1.2rem; position: relative; }
.product-section li::before { content: '✓'; position: absolute; left: 0; color: var(--clr-accent); font-weight: 700; }

.preview-box {
  background: #f1f5f9;
  border: 1px solid var(--clr-border);
  border-radius: var(--radius);
  padding: 2rem;
  text-align: center;
  color: var(--clr-muted);
}
.preview-box svg { margin: 0 auto 1rem; opacity: .4; }

/* Buy box */
.buy-box {
  background: var(--clr-surface);
  border: 1px solid var(--clr-border);
  border-radius: var(--radius);
  padding: 1.8rem;
  box-shadow: var(--shadow-md);
  text-align: center;
}
.buy-box h3 { margin-bottom: .5rem; }
.buy-box p  { font-size: .88rem; margin-bottom: 1.5rem; }

/* ── Admin Styles ───────────────────────────────────────────── */
.admin-layout {
  display: flex;
  min-height: 100vh;
}
.admin-sidebar {
  width: 240px;
  background: var(--clr-text);
  color: rgba(255,255,255,.9);
  display: flex;
  flex-direction: column;
  padding: 0;
  flex-shrink: 0;
}
.admin-sidebar-logo {
  padding: 1.5rem 1.5rem 1rem;
  font-size: 1.1rem;
  font-weight: 700;
  color: #fff;
  border-bottom: 1px solid rgba(255,255,255,.1);
  margin-bottom: .5rem;
}
.admin-sidebar-logo span { color: #818cf8; }
.sidebar-nav a {
  display: flex;
  align-items: center;
  gap: .75rem;
  padding: .75rem 1.5rem;
  font-size: .9rem;
  color: rgba(255,255,255,.65);
  transition: var(--transition);
  border-left: 3px solid transparent;
}
.sidebar-nav a:hover, .sidebar-nav a.active {
  background: rgba(255,255,255,.07);
  color: #fff;
  border-left-color: var(--clr-primary);
}
.admin-main {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: auto;
}
.admin-topbar {
  background: var(--clr-surface);
  border-bottom: 1px solid var(--clr-border);
  padding: 1rem 2rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.admin-topbar h2 { font-size: 1.1rem; }
.admin-content { padding: 2rem; flex: 1; }

/* Admin cards / stats */
.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 1.2rem;
  margin-bottom: 2rem;
}
.stat-card {
  background: var(--clr-surface);
  border-radius: var(--radius);
  padding: 1.4rem;
  box-shadow: var(--shadow-sm);
  border-left: 4px solid var(--clr-primary);
}
.stat-card h4 { font-size: .8rem; text-transform: uppercase; letter-spacing: .8px; color: var(--clr-muted); margin-bottom: .4rem; }
.stat-card .stat-val { font-size: 2rem; font-weight: 700; color: var(--clr-text); }

/* Table */
.table-wrap { background: var(--clr-surface); border-radius: var(--radius); box-shadow: var(--shadow-sm); overflow: hidden; }
table { width: 100%; border-collapse: collapse; }
thead { background: var(--clr-bg); }
th, td { padding: .9rem 1.2rem; text-align: left; font-size: .88rem; border-bottom: 1px solid var(--clr-border); }
th { font-weight: 600; color: var(--clr-muted); text-transform: uppercase; letter-spacing: .5px; font-size: .75rem; }
tbody tr:hover { background: #f9fafb; }
tbody tr:last-child td { border-bottom: none; }

/* Form */
.form-card {
  background: var(--clr-surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  padding: 2rem;
  max-width: 800px;
}
.form-row { margin-bottom: 1.3rem; }
.form-row label { display: block; font-size: .88rem; font-weight: 600; margin-bottom: .45rem; color: var(--clr-text); }
.form-row input[type="text"],
.form-row input[type="number"],
.form-row input[type="email"],
.form-row textarea,
.form-row select {
  width: 100%;
  padding: .7rem 1rem;
  border: 1.5px solid var(--clr-border);
  border-radius: 8px;
  font-family: var(--font);
  font-size: .9rem;
  color: var(--clr-text);
  background: var(--clr-surface);
  transition: border-color .18s;
  outline: none;
}
.form-row input:focus, .form-row textarea:focus, .form-row select:focus {
  border-color: var(--clr-primary);
  box-shadow: 0 0 0 3px rgba(79,70,229,.12);
}
.form-row textarea { resize: vertical; min-height: 90px; }
.form-row input[type="file"] { padding: .5rem; }
.form-hint { font-size: .78rem; color: var(--clr-muted); margin-top: .3rem; }
.form-grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 1.2rem; }

/* Alert banners */
.alert { padding: 1rem 1.3rem; border-radius: 8px; font-size: .9rem; margin-bottom: 1.2rem; }
.alert-success { background: #ecfdf5; border: 1px solid #a7f3d0; color: #065f46; }
.alert-error   { background: #fef2f2; border: 1px solid #fecaca; color: #991b1b; }
.alert-info    { background: #eff6ff; border: 1px solid #bfdbfe; color: #1e40af; }

/* ── Download Page ──────────────────────────────────────────── */
.download-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #f0f4ff, #e0e7ff);
  padding: 2rem;
}
.download-card {
  background: var(--clr-surface);
  border-radius: 16px;
  box-shadow: var(--shadow-lg);
  padding: 3rem 2.5rem;
  text-align: center;
  max-width: 480px;
  width: 100%;
}
.download-icon {
  width: 80px; height: 80px;
  background: linear-gradient(135deg, #4f46e5, #7c3aed);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 1.5rem;
}
.download-card h1 { font-size: 1.6rem; margin-bottom: .75rem; }
.download-card p  { margin-bottom: 1.5rem; }

/* ── Responsive ─────────────────────────────────────────────── */
@media (max-width: 768px) {
  .product-hero-inner { grid-template-columns: 1fr; }
  .product-cover-lg { max-width: 180px; margin: 0 auto; }
  .form-grid-2 { grid-template-columns: 1fr; }
  .admin-layout { flex-direction: column; }
  .admin-sidebar { width: 100%; flex-direction: row; overflow-x: auto; }
  .sidebar-nav { display: flex; flex-direction: row; }
  .sidebar-nav a { padding: .75rem 1rem; border-left: none; border-bottom: 3px solid transparent; white-space: nowrap; }
  .nav-links { display: none; }
}
