/* ============================================================
   Adinath Gold — admin.css
   ============================================================ */
:root {
  --gold: #E8B923;
  --gold-grad: linear-gradient(135deg, #F6D34A 0%, #E8B923 45%, #C9931B 100%);
  --bg: #f4f2ec;
  --dark: #14110c;
  --card: #fff;
  --ink: #221f18;
  --muted: #7d766a;
  --line: #e7e1d3;
  --danger: #c0392b;
  --radius: 14px;
}

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

/* explicit hidden states (display props below would otherwise override [hidden]) */
[hidden] { display: none !important; }

body {
  font-family: "Segoe UI", system-ui, -apple-system, Roboto, Arial, sans-serif;
  background: var(--bg);
  color: var(--ink);
  min-height: 100vh;
}

button { font-family: inherit; cursor: pointer; }
input, textarea, select {
  font-family: inherit; font-size: .95rem; color: var(--ink);
  padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px;
  width: 100%; background: #fff;
}
input:focus, textarea:focus { outline: 2px solid #E8B92355; border-color: var(--gold); }
label { font-weight: 600; font-size: .85rem; display: grid; gap: 5px; }
label small { font-weight: 500; color: var(--muted); }

/* ---------- buttons ---------- */
.btn {
  border: 1px solid transparent; border-radius: 10px;
  padding: 10px 16px; font-weight: 700; font-size: .9rem;
  transition: filter .15s, transform .05s;
}
.btn:active { transform: scale(.98); }
.btn.primary { background: var(--gold-grad); color: #231a02; }
.btn.ghost { background: #fff; border-color: var(--line); color: var(--ink); }
.btn.subtle { background: #f2ecdb; color: #6b5b1e; border-style: dashed; width: 100%; margin-top: 10px; }
.btn.danger { background: #fdecea; color: var(--danger); }
.btn.block { width: 100%; }
.btn:hover { filter: brightness(.97); }

/* ============ LOGIN ============ */
.login-wrap {
  min-height: 100vh; display: grid; place-items: center;
  background:
    radial-gradient(1000px 500px at 50% -10%, #3a2f10 0%, transparent 60%),
    linear-gradient(160deg, #14110c, #241c0b 55%, #14110c);
  padding: 20px;
}
.login-card {
  width: min(92vw, 380px);
  background: var(--card);
  border-radius: 18px;
  box-shadow: 0 24px 70px rgba(0, 0, 0, .5);
  padding: 30px 26px 24px;
  display: grid; gap: 14px;
  text-align: center;
}
.login-logo { width: 76px; height: 76px; margin: 0 auto; border-radius: 50%; }
.login-card h1 { font-size: 1.3rem; letter-spacing: .5px; }
.login-sub { color: var(--muted); font-size: .85rem; margin-top: -8px; }
.login-card label { text-align: left; }
.login-error { color: var(--danger); font-size: .85rem; font-weight: 600; min-height: 1.2em; }
.back-link { color: var(--muted); font-size: .85rem; text-decoration: none; }
.back-link:hover { color: var(--ink); }

/* ============ PORTAL ============ */
.admin-header {
  background: var(--dark);
  color: #fff;
  display: flex; justify-content: space-between; align-items: center;
  padding: 12px 18px;
  position: sticky; top: 0; z-index: 10;
}
.admin-brand { display: flex; align-items: center; gap: 12px; }
.admin-brand img { width: 42px; height: 42px; border-radius: 50%; }
.admin-brand strong { display: block; font-size: 1rem; letter-spacing: .5px; }
.admin-brand span { font-size: .75rem; color: var(--gold); }
.admin-actions { display: flex; gap: 8px; }
.admin-actions .btn { padding: 8px 12px; font-size: .8rem; }
.admin-actions .btn.ghost { background: transparent; color: #eee; border-color: #ffffff33; }

.admin-tabs {
  display: flex; gap: 4px; padding: 10px 14px 0;
  background: var(--dark);
  overflow-x: auto;
}
.admin-tab {
  border: none; background: #ffffff14; color: #cfc9bd;
  padding: 10px 16px; border-radius: 10px 10px 0 0;
  font-weight: 700; font-size: .85rem; white-space: nowrap;
}
.admin-tab.active { background: var(--bg); color: var(--ink); }

.admin-main { max-width: 860px; margin: 0 auto; padding: 18px 16px 60px; }
.pane { display: none; animation: fade .2s ease; }
.pane.active { display: grid; gap: 16px; }
@keyframes fade { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; } }

.card {
  background: var(--card); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 18px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, .05);
}
.card h2 { font-size: 1.02rem; margin-bottom: 12px; }
.card h2 small { color: var(--muted); font-weight: 500; font-size: .78rem; }
.card-row { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; gap: 10px; }
.card-row h2 { margin-bottom: 0; }
.grid2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px; margin-bottom: 12px; }
.muted-card p { font-size: .88rem; color: var(--muted); line-height: 1.6; }

.save-bar { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.save-hint { color: #1e7d3c; font-size: .85rem; font-weight: 600; opacity: 0; transition: opacity .3s; }
.save-hint.show { opacity: 1; }

.form-msg { min-height: 1.3em; font-size: .85rem; font-weight: 600; margin-bottom: 8px; }
.form-msg.ok { color: #1e7d3c; }
.form-msg.err { color: var(--danger); }

/* offers editor rows */
.offer-row { display: flex; gap: 8px; margin-bottom: 8px; }
.offer-row input { flex: 1; }
.offer-row .btn { padding: 8px 12px; }

/* category list */
.cat-list { display: grid; gap: 12px; }
.cat-item {
  border: 1px solid var(--line); border-radius: 12px;
  padding: 12px; background: #fbfaf6;
}
.cat-head { display: flex; gap: 8px; align-items: center; }
.cat-head input { font-weight: 700; }
.cat-head .btn { flex: none; }
.cat-head .btn.rename { background: #eef4ff; color: #2456b8; }
.cat-head .btn.del { background: #fdecea; color: var(--danger); }
.cat-head .btn.save { background: #e8f6ec; color: #1e7d3c; }
.img-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 10px; margin-top: 12px; }
.img-cell { position: relative; }
.img-cell img {
  width: 100%; aspect-ratio: 1/1; object-fit: cover;
  border-radius: 10px; border: 1px solid var(--line); background: #fff;
}
.img-cell .del {
  position: absolute; top: 4px; right: 4px;
  width: 24px; height: 24px; border-radius: 50%;
  border: none; background: rgba(0, 0, 0, .65); color: #fff;
  font-size: .85rem; line-height: 1;
}
.img-add {
  aspect-ratio: 1/1; border: 2px dashed #d8cba4; border-radius: 10px;
  background: #fffdf4; color: #8a6d1a; font-weight: 700; font-size: .8rem;
  display: grid; place-items: center; padding: 6px; text-align: center;
}
.img-add:hover { background: #fdf7e3; }
.img-cell .del:hover, .img-add:hover { cursor: pointer; }
.count-note { font-size: .78rem; color: var(--muted); margin-top: 8px; }

/* videos list */
.video-admin-list { display: grid; gap: 12px; }
.video-item {
  border: 1px solid var(--line); border-radius: 12px; padding: 12px; background: #fbfaf6;
  display: grid; gap: 10px;
}
.video-item .row { display: flex; gap: 8px; align-items: center; }
.video-item .row input { flex: 1; }
.video-item .thumb { width: 86px; height: 48px; object-fit: cover; border-radius: 8px; background: #222; flex: none; }

/* logging-in feedback on the login card */
.login-card .btn[disabled] { opacity: .7; cursor: wait; }

/* toast */
.admin-toast {
  position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%);
  background: #1b1b1b; color: #fff; padding: 10px 18px; border-radius: 999px;
  font-size: .85rem; font-weight: 600; opacity: 0; pointer-events: none;
  transition: opacity .25s; z-index: 99; box-shadow: 0 6px 20px rgba(0, 0, 0, .35);
}
.admin-toast.show { opacity: 1; }
.admin-toast.err { background: var(--danger); }

@media (max-width: 560px) {
  .admin-header { flex-wrap: wrap; gap: 8px; }
  .admin-main { padding: 14px 10px 60px; }
}

/* ---------- login page helper (admin.html) ---------- */
body.login-page { background: none; }
