/* Képfészek.hu — a prototípus dizájnja alapján */
:root {
  --bg: #FAF6EF;
  --ink: #241C14;
  --ink-soft: #3E2F1F;
  --muted: #6E6151;
  --faint: #8A7B66;
  --line: #E8DFD0;
  --panel: #F1E8D9;
  --panel-soft: #F5EDDE;
  --accent: #C4501B;
  --accent-dark: #9C3D10;
  --green: #2E7D4F;
  --danger: #B0483C;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; background: var(--bg); }
body { font-family: 'Instrument Sans', sans-serif; color: var(--ink); }
a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent-dark); text-decoration: underline; }
input::placeholder, textarea::placeholder { color: #B0A493; }
h1, h2, .brand-font { font-family: 'Bricolage Grotesque', sans-serif; }
code, pre { font-family: 'JetBrains Mono', monospace; }

@keyframes toastIn { from { opacity: 0; transform: translate(-50%, 12px); } to { opacity: 1; transform: translate(-50%, 0); } }
@keyframes fadeUp { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }

.shell { min-height: 100vh; display: flex; flex-direction: column; }
.fade-up { animation: fadeUp 0.4s ease both; }

/* Header */
header.site {
  display: flex; align-items: center; justify-content: space-between;
  padding: 18px 32px; border-bottom: 1px solid var(--line);
  background: var(--bg); position: sticky; top: 0; z-index: 10;
}
header.site .logo { height: 44px; display: block; }
header.site nav { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.nav-sep { width: 1px; height: 24px; background: var(--line); margin: 0 10px; }
.avatar {
  width: 32px; height: 32px; border-radius: 50%; background: var(--ink-soft);
  color: var(--bg); display: inline-flex; align-items: center; justify-content: center;
  font-weight: 600; font-size: 13px; text-decoration: none; flex-shrink: 0;
}
.avatar-lg { width: 64px; height: 64px; font-size: 22px; }

/* Felhasználói legördülő menü */
.user-menu { position: relative; }
.user-btn {
  display: inline-flex; align-items: center; gap: 9px;
  border: none; background: none; cursor: pointer;
  font-family: 'Instrument Sans', sans-serif; font-size: 14px; font-weight: 600;
  color: var(--ink); padding: 6px 10px; border-radius: 10px;
}
.user-btn:hover { background: var(--panel); }
.user-btn svg { color: var(--faint); transition: transform 0.15s ease; }
.user-menu.open .user-btn svg { transform: rotate(180deg); }
.dropdown {
  display: none; position: absolute; right: 0; top: calc(100% + 8px);
  min-width: 200px; background: #fff; border: 1px solid var(--line);
  border-radius: 14px; padding: 6px; z-index: 50;
  box-shadow: 0 12px 32px rgba(62,47,31,0.16);
  flex-direction: column;
}
.user-menu.open .dropdown { display: flex; }
.dropdown a, .dropdown form button {
  display: block; width: 100%; text-align: left; border: none; background: none;
  font-family: 'Instrument Sans', sans-serif; font-size: 14px; font-weight: 600;
  color: var(--ink); padding: 9px 12px; border-radius: 9px; cursor: pointer;
  text-decoration: none;
}
.dropdown a:hover, .dropdown form button:hover { background: var(--panel); color: var(--ink); text-decoration: none; }
.dropdown form button { color: var(--danger); }
.dropdown-sep { height: 1px; background: var(--line); margin: 5px 8px; }

/* Profil statisztikák */
.stat-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
@media (max-width: 640px) { .stat-grid { grid-template-columns: repeat(2, 1fr); } }
.stat-tile { background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 16px; }
.stat-tile .val { font-family: 'Bricolage Grotesque', sans-serif; font-weight: 800; font-size: 26px; letter-spacing: -0.5px; color: var(--ink); }
.stat-tile .lbl { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.07em; color: var(--faint); margin-top: 4px; }

main.site { flex: 1; width: 100%; max-width: 980px; margin: 0 auto; padding: 40px 32px 80px; }

footer.site {
  border-top: 1px solid var(--line); padding: 24px 32px;
  display: flex; justify-content: space-between; align-items: center; gap: 12px;
  font-size: 13px; color: var(--faint); flex-wrap: wrap;
}
footer.site .links { display: flex; gap: 20px; }

/* Gombok */
button { font-family: 'Instrument Sans', sans-serif; }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  font-family: 'Instrument Sans', sans-serif; font-size: 14px; font-weight: 600;
  padding: 10px 18px; border-radius: 10px; cursor: pointer; border: none;
  text-decoration: none;
}
.btn:hover { text-decoration: none; }
.btn-primary { background: var(--accent); color: var(--bg); }
.btn-primary:hover { background: var(--accent-dark); color: var(--bg); }
.btn-outline { border: 1.5px solid var(--ink); background: none; color: var(--ink); padding: 9px 18px; }
.btn-outline:hover { background: var(--ink); color: var(--bg); }
.btn-dark { background: var(--ink); color: var(--bg); font-size: 13px; padding: 9px 16px; border-radius: 9px; }
.btn-dark:hover { background: var(--accent); color: var(--bg); }
.btn-soft { border: 1.5px solid var(--line); background: none; color: var(--ink); font-size: 13px; padding: 9px 16px; border-radius: 9px; }
.btn-soft:hover { border-color: var(--accent); color: var(--accent); }
.btn-danger-link { border: none; background: none; color: var(--danger); font-size: 13px; font-weight: 600; cursor: pointer; padding: 7px; }
.btn-danger-link:hover { text-decoration: underline; }
.btn-nav {
  border: none; background: none; color: var(--muted); font-size: 14px; font-weight: 600;
  padding: 8px 14px; border-radius: 10px; cursor: pointer; text-decoration: none;
}
.btn-nav:hover { background: var(--panel); color: var(--ink); text-decoration: none; }
.btn-nav.active { background: var(--panel); color: var(--ink); }
.btn-ghost { border: none; background: none; color: var(--faint); font-size: 14px; cursor: pointer; padding: 6px; font-weight: 400; }
.btn-ghost:hover { color: var(--accent); }
.link-btn { border: none; background: none; color: var(--accent); font-size: 15px; font-weight: 600; cursor: pointer; padding: 8px 0; }
.link-btn:hover { text-decoration: underline; }

/* Szegmentált kapcsolók */
.opt-row { display: flex; align-items: center; justify-content: center; gap: 28px; margin-top: 24px; flex-wrap: wrap; }
.opt-group { display: flex; align-items: center; gap: 12px; }
.opt-group > span { font-size: 14px; font-weight: 600; color: var(--muted); }
.seg { display: flex; gap: 6px; background: var(--panel); padding: 4px; border-radius: 12px; }
.seg button, .seg label {
  border: none; background: none; color: var(--muted); font-size: 13px; font-weight: 600;
  padding: 8px 16px; border-radius: 9px; cursor: pointer; transition: background 0.15s ease;
  font-family: 'Instrument Sans', sans-serif;
}
.seg .active { background: var(--ink); color: var(--bg); }
.seg .active.danger { background: var(--danger); }
.seg input[type=radio] { display: none; }
.seg input[type=radio]:checked + label { background: var(--ink); color: var(--bg); }
.seg.seg-danger input[type=radio]:checked + label.danger { background: var(--danger); color: var(--bg); }
.seg-sm button, .seg-sm label { font-size: 12px; padding: 6px 12px; border-radius: 8px; }
.seg-sm { padding: 3px; border-radius: 10px; gap: 4px; }

/* Kártyák, badge-ek */
.card { background: #fff; border: 1px solid var(--line); border-radius: 14px; }
.badge {
  font-size: 11px; font-weight: 700; padding: 3px 9px; border-radius: 999px; flex-shrink: 0;
  display: inline-block;
}
.badge-pub { background: #E3F0E7; color: var(--green); }
.badge-priv { background: #F5E6D9; color: var(--accent); }
.badge-nsfw { background: var(--ink); color: #F5E6D9; }

/* Feltöltés */
.hero { text-align: center; margin: 24px 0 36px; }
.hero h1 { font-weight: 800; font-size: 46px; letter-spacing: -1.5px; margin: 0 0 12px; }
.hero p { font-size: 17px; color: var(--muted); margin: 0; text-wrap: pretty; }
.dropzone {
  max-width: 620px; margin: 0 auto; min-height: 260px; display: flex;
  flex-direction: column; align-items: center; justify-content: center;
  border: 2px dashed #D8CCB8; background: #FFFDF8; border-radius: 22px;
  cursor: pointer; padding: 40px; text-align: center;
  transition: background 0.15s ease, border-color 0.15s ease;
}
.dropzone.dragover { border-color: var(--accent); background: #F9EDE2; }
.dropzone .dz-icon {
  width: 64px; height: 64px; border-radius: 20px 20px 20px 6px; background: var(--accent);
  display: flex; align-items: center; justify-content: center; margin-bottom: 20px;
}
.dropzone .dz-title { font-family: 'Bricolage Grotesque', sans-serif; font-weight: 700; font-size: 22px; margin-bottom: 6px; }
.dropzone .dz-sub { font-size: 14px; color: var(--faint); }
.guest-note {
  margin: 36px auto 0; max-width: 620px; display: flex; gap: 14px; align-items: flex-start;
  background: var(--panel-soft); border: 1px solid var(--line); border-radius: 14px; padding: 18px 20px;
  font-size: 14px; line-height: 1.55; color: var(--muted);
}
.guest-note strong { color: var(--ink); }

/* Eredmény oldal */
.result-grid { display: grid; grid-template-columns: 340px 1fr; gap: 28px; align-items: start; }
@media (max-width: 760px) { .result-grid { grid-template-columns: 1fr; } }
.result-head { display: flex; align-items: center; gap: 10px; margin-bottom: 24px; }
.result-head .check {
  width: 28px; height: 28px; border-radius: 50%; background: var(--green);
  display: flex; align-items: center; justify-content: center;
}
.result-head h1 { font-weight: 800; font-size: 30px; letter-spacing: -1px; margin: 0; }
.img-card { border-radius: 16px; overflow: hidden; border: 1px solid var(--line); background: #fff; }
.img-card .img-box { width: 100%; height: 240px; background: var(--panel); }
.img-card .img-box img, .thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.img-card .meta { padding: 14px 16px; display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.fname { font-size: 13px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.embed-row { background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 14px 16px; }
.embed-label { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.08em; color: var(--faint); margin-bottom: 8px; }
.embed-line { display: flex; gap: 10px; align-items: center; }
.embed-line code {
  flex: 1; font-size: 12.5px; background: var(--bg); border-radius: 8px; padding: 10px 12px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--ink-soft);
}

.panel-toggle { margin-top: 14px; display: flex; gap: 8px; }
.panel-toggle .btn-soft { flex: 1; padding: 9px 0; border-radius: 10px; font-size: 13px; }
.owner-panel { margin-top: 10px; background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 16px; display: none; flex-direction: column; gap: 14px; }
.owner-panel.open { display: flex; }
.owner-panel .row { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.owner-panel .row > span { font-size: 13px; font-weight: 600; color: var(--muted); }
.btn-delete {
  border: 1.5px solid #E8C7C2; background: none; color: var(--danger); font-size: 13px; font-weight: 600;
  padding: 9px 0; border-radius: 10px; cursor: pointer; width: 100%;
}
.btn-delete:hover { background: var(--danger); color: #fff; border-color: var(--danger); }
.album-choice {
  display: flex; align-items: center; justify-content: space-between; gap: 10px; width: 100%;
  border: none; background: none; font-size: 13px; font-weight: 600; color: var(--ink);
  padding: 10px 12px; border-radius: 10px; cursor: pointer; text-align: left; transition: background 0.15s ease;
}
.album-choice:hover { background: var(--panel); }
.album-choice.in-album { background: var(--panel-soft); }
.album-choice .meta { font-size: 12px; color: var(--faint); font-weight: 500; }
.locked-note { margin-top: 14px; font-size: 13px; line-height: 1.5; color: var(--faint); background: var(--panel-soft); border-radius: 12px; padding: 12px 14px; }

/* Rácsok */
.page-head { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 24px; gap: 12px; flex-wrap: wrap; }
.page-head h1 { font-weight: 800; font-size: 32px; letter-spacing: -1px; margin: 0; }
.page-head .count { font-size: 14px; color: var(--faint); }
.grid3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
@media (max-width: 760px) { .grid3 { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 480px) { .grid3 { grid-template-columns: 1fr; } }
.tile {
  background: #fff; border: 1px solid var(--line); border-radius: 14px; overflow: hidden;
  cursor: pointer; transition: transform 0.15s ease, box-shadow 0.15s ease; display: block; color: inherit;
}
.tile:hover { transform: translateY(-3px); box-shadow: 0 8px 24px rgba(62,47,31,0.12); text-decoration: none; color: inherit; }
.tile .thumb { position: relative; background: var(--panel); height: 160px; overflow: hidden; }
.tile .thumb.nsfw img { filter: blur(14px); }
.nsfw-overlay { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; }
.nsfw-overlay span { font-size: 12px; font-weight: 700; padding: 5px 12px; border-radius: 999px; background: rgba(36,28,20,0.85); color: #F5E6D9; }
.tile .meta { padding: 12px 14px; display: flex; align-items: center; justify-content: space-between; gap: 8px; }

.album-tile { background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 20px; display: block; color: inherit; transition: transform 0.15s ease, box-shadow 0.15s ease; }
.album-tile:hover { transform: translateY(-3px); box-shadow: 0 8px 24px rgba(62,47,31,0.12); text-decoration: none; color: inherit; }
.album-tile .icon {
  width: 44px; height: 44px; border-radius: 14px 14px 14px 5px; background: var(--panel);
  display: flex; align-items: center; justify-content: center; margin-bottom: 14px;
}
.album-tile .name-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.album-tile .name { font-family: 'Bricolage Grotesque', sans-serif; font-weight: 700; font-size: 17px; margin-bottom: 4px; }
.album-tile .count { font-size: 13px; color: var(--faint); }

/* Űrlapok */
.input {
  border: 1.5px solid var(--line); border-radius: 10px; padding: 11px 14px;
  font-family: 'Instrument Sans', sans-serif; font-size: 14px; background: #fff; color: var(--ink);
  outline: none; width: 100%;
}
.input:focus { border-color: var(--accent); }
.inline-form { display: flex; gap: 10px; margin-bottom: 28px; max-width: 480px; }
.auth-card { max-width: 420px; margin: 30px auto; background: #fff; border: 1px solid var(--line); border-radius: 18px; padding: 32px; }
.auth-card h1 { font-weight: 800; font-size: 28px; letter-spacing: -1px; margin: 0 0 20px; }
.auth-card label { display: block; font-size: 13px; font-weight: 600; color: var(--muted); margin: 16px 0 6px; }
.auth-card .btn { width: 100%; margin-top: 22px; }
.auth-alt { text-align: center; font-size: 14px; color: var(--muted); margin-top: 18px; }
.form-error { background: #F9E5E1; border: 1px solid #E8C7C2; color: var(--danger); border-radius: 10px; padding: 12px 14px; font-size: 14px; margin-bottom: 6px; }

/* Doksi / jogi oldalak */
.doc { max-width: 720px; }
.doc h1 { font-weight: 800; font-size: 32px; letter-spacing: -1px; margin: 0 0 8px; }
.doc .doc-sub { font-size: 13px; color: var(--faint); margin: 0 0 32px; }
.doc .doc-lead { font-size: 15px; color: var(--muted); margin: 0 0 28px; line-height: 1.55; text-wrap: pretty; }
.doc-sections { display: flex; flex-direction: column; gap: 28px; font-size: 15px; line-height: 1.65; color: var(--ink-soft); }
.doc-sections h2 { font-weight: 700; font-size: 19px; margin: 0 0 8px; color: var(--ink); }
.doc-sections p { margin: 0 0 10px; text-wrap: pretty; }
.doc-sections p:last-child { margin-bottom: 0; }
.doc-sections strong { color: var(--ink); }
pre.term {
  background: var(--ink); color: var(--panel); border-radius: 14px; padding: 20px;
  font-size: 13px; line-height: 1.6; overflow-x: auto; margin: 0;
}
.http-badge { font-family: 'JetBrains Mono', monospace; font-size: 12px; font-weight: 700; color: #fff; padding: 4px 10px; border-radius: 7px; }
.http-post { background: var(--green); }
.http-get { background: #3E5C8A; }
.http-del { background: var(--danger); }
.endpoint-head { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.endpoint-head code { font-size: 15px; font-weight: 600; }
.param-table { background: #fff; border: 1px solid var(--line); border-radius: 14px; overflow: hidden; margin-bottom: 12px; }
.param-table table { width: 100%; border-collapse: collapse; font-size: 13px; }
.param-table th {
  padding: 10px 14px; font-weight: 700; background: var(--panel-soft); color: var(--faint);
  font-size: 12px; text-transform: uppercase; letter-spacing: 0.06em; text-align: left;
}
.param-table td { padding: 10px 14px; border-top: 1px solid var(--line); }
.param-table td.dim { color: var(--faint); }
code.chip { font-size: 12px; background: var(--panel); padding: 2px 7px; border-radius: 6px; }

/* API kulcsok */
.key-row { background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 14px 16px; display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.key-row code { flex: 1; font-size: 13px; color: var(--ink-soft); word-break: break-all; min-width: 180px; }
.key-row .date { font-size: 12px; color: var(--faint); }
.empty-note { font-size: 14px; color: var(--faint); padding: 8px 2px; }

/* Album részletek */
.share-box { background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 14px 16px; margin-bottom: 16px; }
.share-box .hint { font-size: 13px; color: var(--faint); margin-top: 8px; }
.private-note {
  display: flex; gap: 12px; align-items: center; background: var(--panel-soft);
  border: 1px solid var(--line); border-radius: 14px; padding: 14px 16px; margin-bottom: 16px;
  font-size: 14px; color: var(--muted);
}
.back-link { border: none; background: none; color: var(--faint); font-size: 14px; font-weight: 600; cursor: pointer; padding: 0 0 18px; display: inline-flex; align-items: center; gap: 6px; text-decoration: none; }
.back-link:hover { color: var(--accent); text-decoration: none; }

/* Moderáció */
.nav-badge {
  color: #C4501B;
  font-size: 11px; font-weight: 700; vertical-align: middle;
}
.mod-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 14px; }
@media (max-width: 900px) { .mod-grid { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 600px) { .mod-grid { grid-template-columns: repeat(2, 1fr); } }
.mod-card {
  background: #fff; border: 1px solid var(--line); border-radius: 12px;
  overflow: hidden; display: flex; flex-direction: column;
}
.mod-thumb2 { display: block; position: relative; height: 110px; background: var(--panel); cursor: zoom-in; }
.mod-thumb2 img { width: 100%; height: 100%; object-fit: cover; display: block; }
.mod-thumb2.nsfw img { filter: blur(10px); }
.mod-card-body { padding: 10px; display: flex; flex-direction: column; gap: 8px; }
.mod-card .fname { font-size: 12px; }
.mod-meta { font-size: 11px; color: var(--faint); display: flex; align-items: center; gap: 5px; flex-wrap: wrap; }
.mod-meta strong { color: var(--ink); }
.mod-meta code { font-size: 10.5px; background: var(--bg); padding: 1px 5px; border-radius: 5px; }
.lightbox {
  position: fixed; inset: 0; z-index: 200;
  background: rgba(36,28,20,0.88);
  display: flex; align-items: center; justify-content: center;
  padding: 32px; cursor: zoom-out;
}
.lightbox img {
  max-width: 100%; max-height: 100%;
  border-radius: 12px; box-shadow: 0 16px 48px rgba(0,0,0,0.4);
}
.seg-block { width: 100%; }
.seg-block label { flex: 1; text-align: center; padding: 5px 0; font-size: 11px; }
.mod-check {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  font-size: 12px; font-weight: 700; color: var(--muted);
  border: 1.5px solid var(--line); border-radius: 9px; padding: 7px 10px; cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease;
}
.mod-check:has(input:checked) { border-color: var(--green); color: var(--green); background: #E3F0E7; }
.mod-check input { accent-color: var(--green); margin: 0; }
.mod-bar {
  position: sticky; bottom: 16px; z-index: 5;
  display: flex; gap: 16px; align-items: center; justify-content: space-between;
  background: #fff; border: 1px solid var(--line); border-radius: 14px;
  padding: 12px 16px; margin-top: 20px; flex-wrap: wrap;
  box-shadow: 0 8px 24px rgba(62,47,31,0.15);
}
.mod-selall { display: flex; gap: 8px; align-items: center; font-size: 13px; font-weight: 600; cursor: pointer; }
.mod-selall input { accent-color: var(--ink); margin: 0; }
.mod-selcount { font-size: 13px; color: var(--faint); }
.pager { display: flex; gap: 12px; align-items: center; justify-content: center; margin-top: 24px; font-size: 14px; color: var(--muted); }
/* Összes kép (fejlesztő): ugyanaz a rács, csak nagyobb csempékkel */
.all-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
@media (max-width: 900px) { .all-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 560px) { .all-grid { grid-template-columns: 1fr; } }
.all-grid .mod-thumb2 { height: 220px; }
.all-grid .fname { font-size: 13px; }
.all-grid .mod-meta { font-size: 12px; }
.all-grid .mod-meta code { font-size: 11.5px; }

/* API kód-példák nyelvi fülekkel */
.lang-tabs { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 12px; }
.lang-tabs button {
  border: 1.5px solid var(--line); background: none; color: var(--muted);
  font-family: 'JetBrains Mono', monospace; font-size: 12px; font-weight: 500;
  padding: 6px 12px; border-radius: 999px; cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}
.lang-tabs button:hover { border-color: var(--accent); color: var(--accent); }
.lang-tabs button.active { background: var(--ink); border-color: var(--ink); color: var(--bg); }
.lang-panel { display: none; position: relative; }
.lang-panel.active { display: block; }
.lang-panel pre { margin: 0; }
.lang-copy { position: absolute; top: 10px; right: 10px; padding: 6px 12px; font-size: 12px; }

/* Toast */
.toast {
  position: fixed; bottom: 28px; left: 50%; transform: translateX(-50%);
  background: var(--ink); color: var(--bg); font-size: 14px; font-weight: 600;
  padding: 12px 22px; border-radius: 12px; animation: toastIn 0.25s ease both;
  z-index: 100; box-shadow: 0 8px 24px rgba(0,0,0,0.2);
}
.toast.hide { display: none; }
