/* =========================================================
   imgsakti.com — Main Stylesheet
   ========================================================= */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --white:   #ffffff;
  --bg:      #f4f6fb;
  --surface: #f9fafb;
  --border:  #e5e8ef;
  --borderl: #f0f2f7;
  --accent:  #2563eb;
  --acl:     #eff4ff;
  --acll:    #dbeafe;
  --achov:   #1d4ed8;
  --green:   #16a34a;
  --greenl:  #f0fdf4;
  --red:     #dc2626;
  --redl:    #fff5f5;
  --yellow:  #d97706;
  --yellowl: #fffbeb;
  --text:    #111827;
  --text2:   #374151;
  --muted:   #6b7280;
  --muted2:  #9ca3af;
  --sh:      0 1px 3px rgba(0,0,0,.08);
  --shm:     0 4px 12px rgba(0,0,0,.08);
  --shl:     0 8px 28px rgba(0,0,0,.10);
  --r:       10px;
  --rsm:     6px;
  --rlg:     14px;
}

html { font-size: 14px; }
body { font-family: 'Plus Jakarta Sans', sans-serif; color: var(--text); background: var(--bg); line-height: 1.55; -webkit-font-smoothing: antialiased; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
img { max-width: 100%; display: block; }
button { font-family: inherit; cursor: pointer; }
input, textarea, select { font-family: inherit; }

/* ── Scrollbar ───────────────────────────────────────────── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }

/* ── Utilities ───────────────────────────────────────────── */
.text-muted   { color: var(--muted); }
.text-accent  { color: var(--accent); }
.text-green   { color: var(--green); }
.text-red     { color: var(--red); }
.text-yellow  { color: var(--yellow); }
.mono         { font-family: 'JetBrains Mono', monospace; }
.mt-8  { margin-top: 8px; }
.mt-12 { margin-top: 12px; }
.mt-16 { margin-top: 16px; }
.mt-20 { margin-top: 20px; }
.mb-12 { margin-bottom: 12px; }
.mb-16 { margin-bottom: 16px; }
.flex  { display: flex; }
.flex-center { display: flex; align-items: center; }
.flex-between { display: flex; align-items: center; justify-content: space-between; }
.gap-8  { gap: 8px; }
.gap-12 { gap: 12px; }

/* ── Badge ───────────────────────────────────────────────── */
.badge { display: inline-flex; align-items: center; padding: 2px 8px; border-radius: 20px; font-size: 11px; font-weight: 600; white-space: nowrap; }
.badge-blue   { background: var(--acl);    color: var(--accent); }
.badge-green  { background: var(--greenl); color: var(--green);  }
.badge-red    { background: var(--redl);   color: var(--red);    }
.badge-yellow { background: var(--yellowl);color: var(--yellow); }
.badge-gray   { background: var(--bg);     color: var(--muted);  border: 1px solid var(--border); }

/* ── Button ──────────────────────────────────────────────── */
.btn { display: inline-flex; align-items: center; gap: 5px; padding: 7px 15px; border-radius: var(--rsm); border: 1px solid transparent; font-size: 13px; font-weight: 600; transition: background .12s, box-shadow .12s; white-space: nowrap; }
.btn-primary { background: var(--accent); color: #fff; border-color: var(--accent); }
.btn-primary:hover { background: var(--achov); border-color: var(--achov); text-decoration: none; }
.btn-white   { background: var(--white); color: var(--text2); border-color: var(--border); }
.btn-white:hover { background: var(--bg); text-decoration: none; }
.btn-green   { background: var(--greenl); color: var(--green); border-color: #bbf7d0; }
.btn-green:hover { background: #dcfce7; text-decoration: none; }
.btn-red     { background: var(--redl);   color: var(--red);   border-color: #fecaca; }
.btn-red:hover { background: #fee2e2; text-decoration: none; }
.btn-sm  { padding: 5px 11px; font-size: 12px; }
.btn-xs  { padding: 3px 8px;  font-size: 11px; border-radius: 4px; }
.btn-full { width: 100%; justify-content: center; padding: 10px; }
.btn-copy { padding: 4px 10px; font-size: 11px; border-radius: 4px; background: var(--white); border: 1px solid var(--border); color: var(--muted); transition: all .12s; }
.btn-copy.copied { background: var(--greenl); border-color: #bbf7d0; color: var(--green); }
.btn-copy:hover { background: var(--bg); }

/* ── Card ────────────────────────────────────────────────── */
.card { background: var(--white); border: 1px solid var(--border); border-radius: var(--rlg); box-shadow: var(--sh); }
.card-p { padding: 20px; }
.card-title { font-size: 14px; font-weight: 700; margin-bottom: 14px; color: var(--text2); }

/* ── Form ────────────────────────────────────────────────── */
.form-row { margin-bottom: 14px; }
.form-row label { display: block; font-size: 11px; font-weight: 700; color: var(--text2); margin-bottom: 5px; text-transform: uppercase; letter-spacing: .04em; }
.form-input { width: 100%; padding: 9px 11px; border: 1.5px solid var(--border); border-radius: var(--rsm); font-size: 13px; color: var(--text); background: var(--white); outline: none; transition: border-color .12s, box-shadow .12s; }
.form-input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--acll); }
.form-textarea { width: 100%; padding: 9px 11px; border: 1.5px solid var(--border); border-radius: var(--rsm); font-size: 13px; color: var(--text); background: var(--white); outline: none; resize: vertical; min-height: 70px; transition: border-color .12s, box-shadow .12s; }
.form-textarea:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--acll); }
.form-grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }

/* ── Captcha ─────────────────────────────────────────────── */
.captcha-wrap { display: flex; align-items: center; gap: 10px; background: var(--surface); border: 1.5px solid var(--border); border-radius: var(--rsm); padding: 8px 12px; }
.captcha-expr { font-family: 'JetBrains Mono', monospace; font-size: 18px; font-weight: 700; color: var(--text); background: var(--white); padding: 4px 12px; border-radius: 5px; border: 1.5px solid var(--border); flex-shrink: 0; letter-spacing: 2px; }
.captcha-eq   { font-size: 20px; color: var(--muted2); }
.captcha-ans  { width: 60px; text-align: center; padding: 6px; border: 1.5px solid var(--accent); border-radius: var(--rsm); font-family: 'JetBrains Mono', monospace; font-size: 16px; font-weight: 700; color: var(--accent); outline: none; }
.captcha-hint { font-size: 11px; color: var(--muted); flex: 1; }

/* ── Alert ───────────────────────────────────────────────── */
.alert { padding: 12px 15px; border-radius: var(--rsm); font-size: 12.5px; margin-bottom: 14px; }
.alert-info   { background: var(--acl);    border: 1px solid var(--acll); color: #1e40af; }
.alert-success{ background: var(--greenl); border: 1px solid #bbf7d0;     color: var(--green); }
.alert-error  { background: var(--redl);   border: 1px solid #fecaca;     color: var(--red); }
.alert-warn   { background: var(--yellowl);border: 1px solid #fde68a;     color: var(--yellow); }

/* ── Flash message ───────────────────────────────────────── */
.flash { position: fixed; top: 16px; right: 16px; z-index: 9999; padding: 12px 40px 12px 15px; border-radius: var(--r); font-size: 13px; font-weight: 600; box-shadow: var(--shm); max-width: 340px; }
.flash-success { background: var(--green); color: #fff; }
.flash-error   { background: var(--red);   color: #fff; }
.flash-close   { position: absolute; right: 12px; top: 50%; transform: translateY(-50%); background: none; border: none; color: inherit; font-size: 18px; opacity: .7; cursor: pointer; }

/* ── Table ───────────────────────────────────────────────── */
.table-wrap { border-radius: var(--r); border: 1px solid var(--border); overflow: hidden; box-shadow: var(--sh); }
table { width: 100%; border-collapse: collapse; background: var(--white); }
thead th { background: var(--surface); padding: 9px 13px; text-align: left; font-size: 11px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; border-bottom: 1px solid var(--border); white-space: nowrap; }
tbody td { padding: 9px 13px; border-bottom: 1px solid var(--borderl); font-size: 12.5px; vertical-align: middle; }
tbody tr:last-child td { border-bottom: none; }
tbody tr:hover { background: var(--surface); }
.tr-pending { background: #fffbeb !important; }
.tr-pending:hover { background: #fef9c3 !important; }
.tr-banned  { background: #fff5f5 !important; opacity: .7; }
.tbl-actions { display: flex; gap: 5px; }
.tbl-thumb { width: 40px; height: 34px; border-radius: 5px; background: var(--bg); border: 1px solid var(--border); overflow: hidden; flex-shrink: 0; object-fit: cover; display: flex; align-items: center; justify-content: center; font-size: 16px; }
.tbl-thumb img { width: 100%; height: 100%; object-fit: cover; }

/* ── Stats Row ───────────────────────────────────────────── */
.stat-row { display: grid; gap: 12px; }
.stat-row-3 { grid-template-columns: repeat(3, 1fr); }
.stat-row-4 { grid-template-columns: repeat(4, 1fr); }
.stat-card { background: var(--white); border: 1px solid var(--border); border-radius: var(--r); padding: 16px 18px; box-shadow: var(--sh); }
.stat-num  { font-size: 28px; font-weight: 800; line-height: 1; margin-bottom: 4px; }
.stat-lbl  { font-size: 11px; color: var(--muted); font-weight: 500; }

/* ── Page header (inside dash-main) ─────────────────────── */
.page-header { display: flex; align-items: flex-start; justify-content: space-between; margin-bottom: 20px; }
.page-title  { font-size: 20px; font-weight: 800; }
.page-sub    { font-size: 12px; color: var(--muted); margin-top: 2px; }
.section-label { font-size: 11px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; margin-bottom: 10px; }

/* ── Image Grid ──────────────────────────────────────────── */
.img-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
@media (max-width: 1100px) { .img-grid { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 768px)  { .img-grid { grid-template-columns: repeat(2, 1fr); } }
.img-card { background: var(--white); border: 1px solid var(--border); border-radius: var(--r); overflow: hidden; box-shadow: var(--sh); transition: box-shadow .15s; }
.img-card:hover { box-shadow: var(--shm); }
.img-thumb { aspect-ratio: 4/3; position: relative; overflow: hidden; background: var(--bg); display: flex; align-items: center; justify-content: center; }
.img-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.img-thumb-overlay { position: absolute; inset: 0; background: rgba(0,0,0,.52); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; opacity: 0; transition: opacity .15s; }
.img-card:hover .img-thumb-overlay { opacity: 1; }
.img-info { padding: 9px 11px; }
.img-filename { font-family: 'JetBrains Mono', monospace; font-size: 10.5px; color: var(--accent); margin-bottom: 2px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.img-note { font-size: 11.5px; color: var(--muted); margin-bottom: 4px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.img-meta { font-size: 10.5px; color: var(--muted2); display: flex; justify-content: space-between; }
.overlay-btn { padding: 5px 10px; border-radius: 5px; border: none; cursor: pointer; font-size: 11px; font-weight: 600; font-family: 'Plus Jakarta Sans', sans-serif; display: flex; align-items: center; gap: 4px; text-decoration: none; }
.overlay-copy    { background: var(--white); color: var(--text2); }
.overlay-preview { background: var(--accent); color: #fff; }

/* ── Upload Zone ─────────────────────────────────────────── */
.upload-zone { border: 2px dashed #c7d7ff; border-radius: var(--rlg); background: #f8faff; padding: 40px 24px; text-align: center; cursor: pointer; transition: border-color .15s, background .15s; }
.upload-zone.dragover { border-color: var(--accent); background: var(--acl); }
.upload-zone-icon { font-size: 40px; margin-bottom: 10px; }
.upload-zone-title { font-size: 15px; font-weight: 700; margin-bottom: 4px; }
.upload-zone-hint  { font-size: 12px; color: var(--muted); margin-bottom: 14px; }
.format-pills { display: flex; gap: 6px; justify-content: center; flex-wrap: wrap; margin-bottom: 14px; }
.pill { padding: 2px 9px; border-radius: 20px; font-size: 10.5px; font-weight: 600; background: var(--bg); color: var(--muted2); border: 1px solid var(--border); font-family: 'JetBrains Mono', monospace; }
.pill-accent { background: var(--acl); color: var(--accent); border-color: var(--acll); }
.pill-sep { font-size: 12px; color: var(--muted2); line-height: 22px; }

/* ── URL result boxes ────────────────────────────────────── */
.url-result-card { background: var(--white); border: 1px solid #bbf7d0; border-radius: var(--rlg); padding: 20px; box-shadow: var(--shm); }
.url-result-row  { display: flex; align-items: center; gap: 8px; background: var(--bg); border: 1px solid var(--border); border-radius: var(--rsm); padding: 7px 10px; margin-bottom: 6px; }
.url-result-type { font-size: 9.5px; font-weight: 700; color: var(--muted2); text-transform: uppercase; letter-spacing: .04em; min-width: 30px; flex-shrink: 0; }
.url-result-val  { flex: 1; font-family: 'JetBrains Mono', monospace; font-size: 10.5px; color: var(--accent); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.url-result-val.html-val { color: var(--yellow); }
.url-result-val.md-val   { color: var(--green); }

/* ── Pagination ──────────────────────────────────────────── */
.pagination { display: flex; gap: 4px; justify-content: center; margin-top: 20px; }
.page-btn { padding: 6px 11px; border-radius: var(--rsm); border: 1px solid var(--border); background: var(--white); font-size: 12.5px; font-weight: 500; color: var(--muted); cursor: pointer; }
.page-btn.active { background: var(--accent); border-color: var(--accent); color: #fff; }
.page-btn:hover:not(.active) { background: var(--bg); }

/* ── Filter tabs ─────────────────────────────────────────── */
.filter-tabs { display: flex; gap: 6px; margin-bottom: 14px; flex-wrap: wrap; }
.filter-tab  { padding: 5px 13px; border-radius: 20px; font-size: 12px; font-weight: 600; cursor: pointer; border: 1.5px solid var(--border); background: var(--white); color: var(--muted); transition: all .12s; }
.filter-tab.active { background: var(--acl); border-color: var(--acll); color: var(--accent); }
.filter-tab:hover:not(.active) { background: var(--bg); }

/* =========================================================
   AUTH LAYOUT
   ========================================================= */
.auth-body { background: #eef2ff; min-height: 100vh; display: flex; flex-direction: column; }
.auth-outer { flex: 1; display: flex; align-items: center; justify-content: center; padding: 32px 16px; }
.auth-box { background: var(--white); border: 1px solid var(--border); border-radius: var(--rlg); padding: 30px 28px; width: 100%; max-width: 380px; box-shadow: var(--shl); }
.auth-logo  { font-weight: 800; font-size: 22px; color: var(--accent); text-align: center; margin-bottom: 3px; letter-spacing: -.3px; }
.auth-title { font-size: 20px; font-weight: 800; text-align: center; margin-bottom: 3px; }
.auth-sub   { color: var(--muted); font-size: 12px; text-align: center; margin-bottom: 22px; }
.auth-foot  { text-align: center; margin-top: 16px; font-size: 12px; color: var(--muted); }
.auth-nav   { background: var(--white); border-bottom: 1px solid var(--border); padding: 14px 24px; display: flex; align-items: center; justify-content: space-between; box-shadow: var(--sh); }
.auth-nav-logo { font-weight: 800; font-size: 18px; color: var(--accent); letter-spacing: -.3px; }
.auth-nav-links { display: flex; gap: 8px; }

/* =========================================================
   HOME / PUBLIC
   ========================================================= */
.home-body { background: var(--white); min-height: 100vh; }
.home-nav { border-bottom: 1px solid var(--border); padding: 14px 40px; display: flex; align-items: center; justify-content: space-between; box-shadow: var(--sh); }
.home-nav-logo { font-weight: 800; font-size: 20px; color: var(--accent); letter-spacing: -.3px; }
.home-nav-logo span { color: var(--muted); font-weight: 500; font-size: 13px; margin-left: 5px; }
.home-hero { display: flex; flex-direction: column; align-items: center; padding: 56px 24px 36px; text-align: center; background: linear-gradient(180deg, #f0f4ff 0%, #fff 100%); }
.home-hero h1 { font-size: 40px; font-weight: 800; line-height: 1.12; margin-bottom: 12px; letter-spacing: -.5px; }
.home-hero h1 .accent { color: var(--accent); }
.home-hero .sub { color: var(--muted); font-size: 15px; max-width: 400px; margin-bottom: 32px; }
.home-upload-box { width: 100%; max-width: 460px; background: var(--white); border: 2px dashed #c7d7ff; border-radius: var(--rlg); padding: 36px 24px; text-align: center; position: relative; }
.home-lock-overlay { position: absolute; inset: 0; border-radius: 13px; background: rgba(255,255,255,.9); backdrop-filter: blur(3px); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; }
.home-features { display: grid; grid-template-columns: repeat(3,1fr); gap: 14px; padding: 20px 40px 40px; max-width: 600px; margin: 0 auto; width: 100%; }
.feat-item { text-align: center; padding: 16px 10px; border-radius: var(--r); border: 1px solid var(--border); background: var(--surface); }
.feat-icon { font-size: 24px; margin-bottom: 6px; }
.feat-title { font-size: 12.5px; font-weight: 700; color: var(--text2); margin-bottom: 3px; }
.feat-desc  { font-size: 11.5px; color: var(--muted); }

/* =========================================================
   DASHBOARD LAYOUT
   ========================================================= */
.dash-body { background: var(--bg); min-height: 100vh; }
.dash-layout { display: flex; min-height: 100vh; }
.dash-sidebar { width: 210px; flex-shrink: 0; background: var(--white); border-right: 1px solid var(--border); display: flex; flex-direction: column; padding: 18px 10px; position: sticky; top: 0; height: 100vh; overflow-y: auto; }
.admin-body .dash-sidebar { background: #1e293b; border-right-color: #334155; }
.sb-logo { font-weight: 800; font-size: 17px; letter-spacing: -.3px; padding: 2px 8px; margin-bottom: 20px; }
.sb-logo a { color: var(--accent); text-decoration: none; }
.admin-body .sb-logo a { color: #60a5fa; }
.sb-nav  { display: flex; flex-direction: column; gap: 2px; flex: 1; }
.sb-item { display: flex; align-items: center; gap: 8px; padding: 8px 9px; border-radius: var(--rsm); font-size: 13px; font-weight: 500; color: var(--muted); transition: all .12s; text-decoration: none !important; position: relative; }
.sb-item:hover { background: var(--bg); color: var(--text2); }
.sb-item.active { background: var(--acl); color: var(--accent); font-weight: 700; }
.admin-body .sb-item { color: #94a3b8; }
.admin-body .sb-item:hover  { background: #334155; color: #e2e8f0; }
.admin-body .sb-item.active { background: #1d4ed8; color: #fff; }
.sb-icon  { font-size: 14px; width: 18px; text-align: center; flex-shrink: 0; }
.sb-label { flex: 1; }
.sb-badge { background: var(--red); color: #fff; font-size: 9.5px; padding: 1px 6px; border-radius: 10px; font-weight: 700; margin-left: auto; }
.sb-user  { display: flex; align-items: center; gap: 8px; padding: 10px 8px; border-top: 1px solid var(--borderl); margin-top: 8px; }
.admin-body .sb-user { border-top-color: #334155; }
.sb-ava   { width: 32px; height: 32px; border-radius: 50%; background: var(--acl); display: flex; align-items: center; justify-content: center; font-size: 14px; font-weight: 800; color: var(--accent); flex-shrink: 0; }
.admin-body .sb-ava { background: #1d4ed8; color: #fff; }
.sb-info  { flex: 1; overflow: hidden; }
.sb-uname { display: block; font-size: 12px; font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.admin-body .sb-uname { color: #e2e8f0; }
.sb-logout { font-size: 18px; color: var(--muted); text-decoration: none; flex-shrink: 0; padding: 2px; transition: color .12s; }
.sb-logout:hover { color: var(--red); }

.dash-main { flex: 1; padding: 24px 28px; max-width: 1000px; overflow-x: hidden; }

/* =========================================================
   ADMINUSER PAGE (one-time setup)
   ========================================================= */
.setup-body { background: #f0f4ff; min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 24px; }
.setup-box  { background: var(--white); border-radius: var(--rlg); padding: 32px; max-width: 420px; width: 100%; box-shadow: var(--shl); border: 1px solid var(--border); }
.setup-icon { font-size: 36px; text-align: center; margin-bottom: 10px; }
.setup-title{ font-size: 22px; font-weight: 800; text-align: center; margin-bottom: 4px; }
.setup-sub  { color: var(--muted); font-size: 12.5px; text-align: center; margin-bottom: 24px; }

@media (max-width: 768px) {
  .dash-sidebar { width: 56px; }
  .sb-label, .sb-info, .sb-uname, .sb-logout, .sb-badge { display: none; }
  .sb-item { justify-content: center; }
  .dash-main { padding: 16px; }
  .img-grid { grid-template-columns: repeat(2, 1fr); }
  .stat-row-3, .stat-row-4 { grid-template-columns: repeat(2, 1fr); }
  .home-nav { padding: 12px 20px; }
  .home-hero h1 { font-size: 28px; }
  .home-features { grid-template-columns: 1fr; padding: 16px; }
}
