/* We Buy Any Monk — Main Stylesheet */
@import url('https://fonts.googleapis.com/css2?family=Courier+Prime:ital,wght@0,400;0,700;1,400&family=Special+Elite&display=swap');

:root {
  --bg-page:      #fdf3e3;
  --bg-sidebar:   #c9a87c;
  --bg-card:      #9a7c5a;
  --bg-card-inner:#d4b48c;
  --bg-card-light:#e8d0b0;
  --border:       #7a5c3a;
  --text-dark:    #1a0e00;
  --text-mid:     #3d2800;
  --accent-green: #00c82a;
  --accent-red:   #c82a00;
  --white:        #ffffff;
  --radius:       12px;
  --radius-sm:    8px;
  --shadow:       0 3px 10px rgba(0,0,0,0.25);
  --font-main:    'Courier Prime', 'Courier New', monospace;
  --font-display: 'Special Elite', cursive;
}

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

html { font-size: 16px; }

body {
  font-family: var(--font-main);
  background: var(--bg-page);
  color: var(--text-dark);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* ── LAYOUT ───────────────────────────────────────────────── */
.layout {
  display: flex;
  flex: 1;
  min-height: 100vh;
}

.sidebar {
  width: 240px;
  flex-shrink: 0;
  background: var(--bg-sidebar);
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 12px;
  border-right: 3px solid var(--border);
}

.main-content {
  flex: 1;
  background: var(--bg-page);
  padding: 24px;
  overflow-y: auto;
}

/* ── SIDEBAR ELEMENTS ─────────────────────────────────────── */
.sidebar-btn {
  display: block;
  width: 100%;
  background: var(--bg-card);
  color: var(--text-dark);
  border: none;
  border-radius: var(--radius);
  padding: 12px 16px;
  font-family: var(--font-display);
  font-size: 1.15rem;
  cursor: pointer;
  text-align: center;
  text-decoration: none;
  transition: background 0.15s, transform 0.1s;
  box-shadow: var(--shadow);
}
.sidebar-btn:hover {
  background: #b89060;
  transform: translateY(-1px);
}
.sidebar-btn.active {
  background: #7a5c3a;
  color: #fff;
}

.sidebar-user-card {
  background: var(--bg-card);
  border-radius: var(--radius);
  padding: 14px;
  text-align: center;
  box-shadow: var(--shadow);
}
.sidebar-user-card .username {
  font-family: var(--font-display);
  font-size: 1.1rem;
  margin-bottom: 4px;
}
.sidebar-user-card .points {
  font-size: 0.9rem;
  color: var(--text-mid);
}
.sidebar-user-card .points span {
  font-weight: 700;
  font-size: 1.1rem;
}

.sidebar-monk-preview {
  background: var(--bg-card);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
}
.sidebar-monk-preview img {
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  display: block;
  background: #6a4;
}

.sidebar-whatsapp {
  background: var(--bg-card);
  border-radius: var(--radius);
  padding: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow);
}
.whatsapp-icon {
  width: 48px;
  height: 48px;
  background: var(--accent-green);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 1.6rem;
}

/* ── NAV TICKER ───────────────────────────────────────────── */
.sale-ticker {
  background: var(--bg-card);
  color: var(--text-dark);
  padding: 8px 0;
  overflow: hidden;
  border-radius: var(--radius-sm);
  margin-bottom: 16px;
  border: 2px solid var(--border);
}
.sale-ticker-inner {
  display: inline-block;
  white-space: nowrap;
  animation: ticker 18s linear infinite;
  font-family: var(--font-display);
  font-size: 0.95rem;
  padding-left: 100%;
}
@keyframes ticker {
  from { transform: translateX(0); }
  to   { transform: translateX(-100%); }
}

/* ── CARDS ────────────────────────────────────────────────── */
.card {
  background: var(--bg-card);
  border-radius: var(--radius);
  padding: 16px;
  box-shadow: var(--shadow);
}

.monk-card {
  background: var(--bg-card);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  cursor: pointer;
  transition: transform 0.15s, box-shadow 0.15s;
  display: flex;
  flex-direction: column;
}
.monk-card:hover { transform: translateY(-3px); box-shadow: 0 6px 20px rgba(0,0,0,0.3); }
.monk-card-img {
  background: #fff;
  aspect-ratio: 3/4;
  overflow: hidden;
}
.monk-card-img img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}
.monk-card-info {
  padding: 10px 12px;
  font-family: var(--font-display);
}
.monk-card-name { font-size: 0.95rem; margin-bottom: 4px; }
.monk-card-cost { font-size: 0.85rem; color: var(--text-mid); }

/* ── MONK GRID ────────────────────────────────────────────── */
.monk-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
  gap: 16px;
}

/* ── COLLECTION ACCORDION ─────────────────────────────────── */
.collection-header {
  background: var(--bg-card);
  border-radius: var(--radius-sm);
  padding: 12px 18px;
  font-family: var(--font-display);
  font-size: 1.05rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 2px;
  user-select: none;
  border: 2px solid var(--border);
}
.collection-header .arrow { transition: transform 0.2s; }
.collection-header.open .arrow { transform: rotate(180deg); }
.collection-body {
  overflow: hidden;
  max-height: 0;
  transition: max-height 0.35s ease;
}
.collection-body.open { max-height: 2000px; padding: 12px 0; }

/* ── CHAT ─────────────────────────────────────────────────── */
.chat-post {
  background: var(--bg-card);
  border-radius: var(--radius);
  margin-bottom: 12px;
  overflow: hidden;
  border: 2px solid var(--border);
}
.chat-post-header {
  background: var(--bg-card);
  padding: 8px 14px;
  font-family: var(--font-display);
  font-size: 1rem;
  border-bottom: 2px solid var(--border);
  display: flex;
  align-items: center;
  gap: 6px;
}
.chat-post-body {
  background: var(--bg-card-inner);
  padding: 14px;
  font-size: 0.95rem;
  line-height: 1.5;
  border-radius: 0 0 var(--radius) var(--radius);
}
.chat-post-body img {
  max-width: 200px;
  border-radius: var(--radius-sm);
  margin-top: 8px;
  display: block;
}
.replies-toggle {
  padding: 6px 14px 10px;
  font-size: 0.9rem;
  cursor: pointer;
  color: var(--text-mid);
  display: flex;
  align-items: center;
  gap: 6px;
  background: var(--bg-card-inner);
}
.replies-toggle:hover { color: var(--text-dark); }

.badge-verified { font-size: 1rem; }
.badge-admin { font-size: 1rem; }

.chat-input-area {
  background: var(--bg-card);
  border-radius: var(--radius);
  border: 2px solid var(--border);
  overflow: hidden;
  margin-top: 20px;
}
.chat-input-header {
  background: var(--bg-card);
  padding: 10px 14px;
  font-family: var(--font-display);
  font-size: 1rem;
  border-bottom: 2px solid var(--border);
}
.chat-input-body {
  background: var(--bg-card-inner);
  padding: 12px;
}
.chat-input-body textarea {
  width: 100%;
  min-height: 120px;
  background: var(--bg-card-light);
  border: 2px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px;
  font-family: var(--font-main);
  font-size: 0.95rem;
  resize: vertical;
  color: var(--text-dark);
}
.chat-input-body textarea:focus { outline: none; border-color: #5a3c1a; }

/* ── FORM ELEMENTS ────────────────────────────────────────── */
.form-group { margin-bottom: 16px; }
.form-group label {
  display: block;
  font-family: var(--font-display);
  font-size: 0.95rem;
  margin-bottom: 6px;
}
.form-group input,
.form-group textarea,
.form-group select {
  width: 100%;
  padding: 10px 14px;
  background: var(--bg-card-light);
  border: 2px solid var(--border);
  border-radius: var(--radius-sm);
  font-family: var(--font-main);
  font-size: 1rem;
  color: var(--text-dark);
}
.form-group input:focus,
.form-group textarea:focus { outline: none; border-color: #5a3c1a; }

.drop-zone {
  border: 3px dashed var(--border);
  border-radius: var(--radius);
  padding: 32px;
  text-align: center;
  background: var(--bg-card-light);
  cursor: pointer;
  transition: background 0.15s;
  font-family: var(--font-display);
  font-size: 0.95rem;
  color: var(--text-mid);
}
.drop-zone:hover, .drop-zone.dragover { background: #dfc090; }
.drop-zone img { max-height: 200px; margin: 0 auto; display: block; }

.btn {
  display: inline-block;
  padding: 10px 22px;
  background: var(--bg-card);
  border: 2px solid var(--border);
  border-radius: var(--radius-sm);
  font-family: var(--font-display);
  font-size: 1rem;
  cursor: pointer;
  text-decoration: none;
  color: var(--text-dark);
  transition: background 0.15s, transform 0.1s;
}
.btn:hover { background: #b89060; transform: translateY(-1px); }
.btn-primary { background: var(--border); color: #fff; }
.btn-primary:hover { background: #5a3c1a; }
.btn-danger { background: var(--accent-red); color: #fff; border-color: #a02000; }
.btn-sm { padding: 6px 14px; font-size: 0.88rem; }

/* ── AUTH PAGES ───────────────────────────────────────────── */
.auth-container {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-sidebar);
  padding: 24px;
}
.auth-box {
  background: var(--bg-card);
  border-radius: var(--radius);
  padding: 36px 40px;
  width: 100%;
  max-width: 420px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.3);
  border: 2px solid var(--border);
}
.auth-box h1 {
  font-family: var(--font-display);
  font-size: 2rem;
  text-align: center;
  margin-bottom: 8px;
}
.auth-box .subtitle {
  text-align: center;
  font-size: 0.9rem;
  color: var(--text-mid);
  margin-bottom: 28px;
}
.auth-box .error-msg {
  background: #c82a0022;
  border: 1px solid var(--accent-red);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  font-size: 0.9rem;
  color: var(--accent-red);
  margin-bottom: 14px;
  display: none;
}

/* ── PAGE TITLE ───────────────────────────────────────────── */
.page-title {
  font-family: var(--font-display);
  font-size: 2rem;
  margin-bottom: 20px;
  color: var(--text-dark);
}

/* ── MODAL ────────────────────────────────────────────────── */
.modal-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.6);
  display: flex; align-items: center; justify-content: center;
  z-index: 100;
  opacity: 0; pointer-events: none;
  transition: opacity 0.2s;
}
.modal-overlay.open { opacity: 1; pointer-events: all; }
.modal {
  background: var(--bg-card);
  border-radius: var(--radius);
  padding: 28px;
  width: min(90vw, 480px);
  box-shadow: 0 12px 40px rgba(0,0,0,0.4);
  border: 2px solid var(--border);
  transform: scale(0.95);
  transition: transform 0.2s;
}
.modal-overlay.open .modal { transform: scale(1); }
.modal h2 { font-family: var(--font-display); font-size: 1.4rem; margin-bottom: 16px; }

/* ── FOOTER ───────────────────────────────────────────────── */
footer {
  background: var(--bg-sidebar);
  text-align: center;
  padding: 16px;
  font-family: var(--font-main);
  font-size: 0.9rem;
  border-top: 2px solid var(--border);
}
footer a { color: var(--text-dark); text-decoration: none; margin: 0 12px; }
footer a:hover { text-decoration: underline; }

/* ── NOTICES PANEL ────────────────────────────────────────── */
.notice-item {
  background: var(--bg-card-inner);
  border-left: 4px solid var(--border);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  padding: 10px 14px;
  margin-bottom: 8px;
}
.notice-item h4 { font-family: var(--font-display); font-size: 1rem; }
.notice-item p  { font-size: 0.88rem; color: var(--text-mid); margin-top: 3px; }

/* ── AD BANNER ────────────────────────────────────────────── */
.ad-banner {
  background: var(--bg-card);
  border: 2px dashed var(--border);
  border-radius: var(--radius);
  padding: 18px;
  text-align: center;
  font-family: var(--font-display);
  font-size: 0.95rem;
  color: var(--text-mid);
  margin-bottom: 16px;
}
.ad-banner .watch-btn {
  display: inline-block;
  margin-top: 10px;
  padding: 8px 20px;
  background: var(--border);
  color: #fff;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-family: var(--font-display);
  border: none;
  font-size: 0.95rem;
}
.ad-banner .watch-btn:hover { background: #5a3c1a; }

/* ── POINTS TOAST ─────────────────────────────────────────── */
.points-toast {
  position: fixed;
  bottom: 24px; right: 24px;
  background: var(--border);
  color: #fff;
  padding: 12px 22px;
  border-radius: var(--radius);
  font-family: var(--font-display);
  font-size: 1rem;
  box-shadow: var(--shadow);
  transform: translateY(80px);
  opacity: 0;
  transition: all 0.3s;
  z-index: 200;
}
.points-toast.show { transform: translateY(0); opacity: 1; }

/* ── LEADERBOARD ──────────────────────────────────────────── */
.leaderboard-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  background: var(--bg-card-inner);
  border-radius: var(--radius-sm);
  margin-bottom: 6px;
}
.leaderboard-rank { font-family: var(--font-display); font-size: 1.3rem; width: 30px; }
.leaderboard-name { flex: 1; font-family: var(--font-display); }
.leaderboard-pts  { font-weight: 700; }

/* ── RESPONSIVE ────────────────────────────────────────────── */
@media (max-width: 768px) {
  .sidebar { width: 180px; }
  .monk-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 540px) {
  .layout { flex-direction: column; }
  .sidebar { width: 100%; flex-direction: row; flex-wrap: wrap; padding: 8px; gap: 6px; }
  .sidebar-btn { width: auto; flex: 1; min-width: 80px; font-size: 0.9rem; }
  .sidebar-monk-preview, .sidebar-whatsapp { display: none; }
}
