/* ============================================================
   GLOBAL RESET + BASE STYLES
   ============================================================ */

*,
*::before,
*::after {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: #202225;
  color: #f5f5f5;
}

a {
  color: #4aa8ff;
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

/* ============================================================
   HERO HEADER WITH BLURRED COLLAGE BACKGROUND
   ============================================================ */

.hero {
  position: relative;
  padding: 3rem 1rem 2.5rem;
  text-align: center;
  overflow: hidden;
  min-height: 260px;
  background: #1a1a1a;
}

/* Background collage grid */
.hero-bg {
  position: absolute;
  inset: 0;
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  grid-auto-rows: 100px;
  gap: 4px;
  filter: blur(16px) brightness(0.7);
  transform: scale(1.1);
}

/* Each tile */
.hero-bg-cell img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Dark overlay */
.hero-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    rgba(0,0,0,0.5),
    rgba(0,0,0,0.65)
  );
  z-index: 1;
}

/* Foreground content */
.hero-content {
  position: relative;
  z-index: 2;
}

.hero-content h1 {
  font-size: 2rem;
  margin-bottom: 0.4rem;
  color: #ffffff;
}

.hero-content .subtitle {
  font-size: 1rem;
  color: #dcdcdc;
}

/* Mobile-friendly */
@media (max-width: 600px) {
  .hero-bg {
    grid-template-columns: repeat(3, 1fr);
    grid-auto-rows: 80px;
  }
  .hero-content h1 {
    font-size: 1.6rem;
  }
}

/* ============================================================
   MAIN CONTENT
   ============================================================ */

.main-content {
  max-width: 1200px;
  margin: 1.5rem auto 2rem;
  padding: 0 1rem;
}

/* ============================================================
   FILTER & SORT BAR
   ============================================================ */

.toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 1.2rem;
  padding: 0.75rem 1rem;
  background: #2b2f35;
  border-radius: 8px;
  margin-bottom: 1.5rem;
  align-items: center;
}

.toolbar label {
  font-size: 0.9rem;
  color: #e0e0e0;
}

.toolbar select {
  padding: 0.25rem 0.4rem;
  border-radius: 4px;
  border: 1px solid #444;
  background: #1e2228;
  color: #f5f5f5;
}

/* ============================================================
   ITEMS GRID
   ============================================================ */

.items-grid {
  display: grid;
  justify-content: center;
  gap: 1.25rem;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
}

/* Card container */
.item-card {
  max-width: 320px;
  margin-left: auto;
  margin-right: auto;
  background: #2c2f33;
  border-radius: 10px;
  overflow: hidden;
  position: relative;
  box-shadow: 0 4px 10px rgba(0,0,0,0.4);
  display: flex;
  flex-direction: column;
}

.item-image-link img {
  width: 100%;
  height: 260px;
  object-fit: cover;
}

/* ============================================================
   PURCHASED OVERLAY
   ============================================================ */

.item-card.purchased img {
  opacity: 0.35;
  filter: grayscale(40%);
}

.item-card.purchased::after {
  content: "✓ Purchased";
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 1.7rem;
  font-weight: bold;
  color: #00ff88;
  background: rgba(0,0,0,0.55);
  padding: 12px 20px;
  border-radius: 8px;
}

/* ============================================================
   ITEM CONTENT
   ============================================================ */

.item-body {
  padding: 0.8rem 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.item-title {
  font-weight: 600;
  font-size: 1rem;
  color: #f5f5f5;
}

.item-size {
  font-weight: 400;
  font-size: 0.9rem;
  margin-left: 0.4rem;
  color: #c5ffc5;
}

.item-price {
  font-weight: 600;
  font-size: 1rem;
}

.item-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.item-category {
  font-size: 0.8rem;
  text-transform: uppercase;
  color: #bbbbbb;
}

/* ============================================================
   PURCHASE BUTTON & BADGES
   ============================================================ */

.badge {
  padding: 0.25rem 0.6rem;
  border-radius: 999px;
  font-size: 0.75rem;
}

.badge-purchased {
  background: #43b581;
  color: #0b1410;
}

.btn-purchased {
  border: none;
  background: #7289da;
  color: #ffffff;
  padding: 0.37rem 0.75rem;
  border-radius: 999px;
  font-size: 0.8rem;
  cursor: pointer;
}

.btn-purchased:hover {
  background: #5b6fb5;
}

/* ============================================================
   FOOTER
   ============================================================ */

.footer {
  text-align: center;
  padding: 1rem;
  color: #aaaaaa;
  font-size: 0.85rem;
  border-top: 1px solid #2b2f35;
}

/* ============================================================
   ADMIN PAGE
   ============================================================ */

.admin-body {
  background: #15171a;
  color: #f5f5f5;
}

.admin-header {
  padding: 1.5rem 1rem 0.5rem;
  text-align: center;
}

.admin-main {
  max-width: 1200px;
  margin: 0 auto 2rem;
  padding: 0 1rem 2rem;
}

.admin-message {
  margin-bottom: 1rem;
  padding: 0.5rem 0.75rem;
  background: #2d5935;
  border-radius: 6px;
}

.admin-form {
  overflow-x: auto;
}

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

.admin-table th,
.admin-table td {
  border: 1px solid #444;
  padding: 0.45rem 0.5rem;
}

.admin-table th {
  background: #20252b;
}

.admin-actions {
  margin-top: 0.75rem;
  text-align: right;
}

.admin-actions button {
  padding: 0.45rem 0.9rem;
  border-radius: 999px;
  background: #43b581;
  border: none;
  cursor: pointer;
  color: #0b1410;
}

.admin-actions button:hover {
  background: #36956a;
}



