/* ============================================================
   admin.css — admin felület stílus
   Külön a public site-tól: nem örökli a témákat,
   funkciónális backend dashboard érzés.
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');

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

:root {
  --c-bg: #0e0f12;
  --c-surface: #16181d;
  --c-surface-2: #1d2026;
  --c-border: #262a32;
  --c-border-soft: #20232a;
  --c-text: #e8eaed;
  --c-text-muted: #9aa0a8;
  --c-text-faint: #6b6f78;
  --c-accent: #fcb900;
  --c-accent-hover: #ffce4d;
  --c-success: #22c55e;
  --c-error: #ef4444;
  --c-info: #3b82f6;

  --radius: 6px;
  --radius-sm: 4px;
  --header-h: 60px;
  --sidebar-w: 220px;

  --t-fast: 140ms;
  --t-med: 240ms;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

html,
body {
  height: 100%;
  background: var(--c-bg);
  color: var(--c-text);
  font-family: 'Inter', system-ui, sans-serif;
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

a {
  color: inherit;
}

button {
  background: none;
  border: none;
  cursor: pointer;
  font: inherit;
  color: inherit;
}

img {
  display: block;
  max-width: 100%;
}

/* ============================================================
   LOGIN OLDAL
   ============================================================ */
.login-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
}

.login-card {
  width: 100%;
  max-width: 380px;
  background: var(--c-surface);
  border: 1px solid var(--c-border);
  border-radius: var(--radius);
  padding: 2rem 1.75rem 1.75rem;
}

.login-card__brand {
  display: flex;
  align-items: center;
  gap: 0.625rem;
  margin-bottom: 1.5rem;
}

.login-card__brand img {
  width: 28px;
  height: 28px;
}

.login-card__brand span {
  font-weight: 600;
  font-size: 0.875rem;
  letter-spacing: 0.04em;
}

.login-card__title {
  font-size: 1.125rem;
  font-weight: 600;
  margin-bottom: 0.375rem;
}

.login-card__subtitle {
  font-size: 0.8125rem;
  color: var(--c-text-muted);
  margin-bottom: 1.5rem;
}

.login-card__error {
  background: rgba(239, 68, 68, 0.08);
  border: 1px solid rgba(239, 68, 68, 0.3);
  color: var(--c-error);
  padding: 0.5rem 0.75rem;
  border-radius: var(--radius-sm);
  font-size: 0.8125rem;
  margin-bottom: 0.875rem;
}

.login-card__error[hidden] {
  display: none;
}

.login-card__hint {
  margin-top: 1rem;
  font-size: 0.75rem;
  color: var(--c-text-faint);
  line-height: 1.5;
}

.login-card__hint code {
  font-family: ui-monospace, monospace;
  background: rgba(255, 255, 255, 0.05);
  padding: 0.1em 0.35em;
  border-radius: 3px;
  font-size: 0.8em;
}

/* ============================================================
   FORM ELEMS
   ============================================================ */
.field {
  display: flex;
  flex-direction: column;
  gap: 0.375rem;
  margin-bottom: 0.875rem;
}

.field--row {
  flex-direction: row;
  align-items: center;
  gap: 0.625rem;
}

.field__label {
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--c-text-muted);
  letter-spacing: 0.02em;
}

.field__hint {
  font-size: 0.6875rem;
  color: var(--c-text-faint);
  line-height: 1.4;
}

.field__inputs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.5rem;
}

input[type='text'],
input[type='password'],
input[type='email'],
input[type='url'],
input[type='number'],
textarea,
select {
  width: 100%;
  background: var(--c-bg);
  border: 1px solid var(--c-border);
  border-radius: var(--radius-sm);
  padding: 0.5rem 0.625rem;
  color: var(--c-text);
  font-family: inherit;
  font-size: 0.875rem;
  transition: border-color var(--t-fast) var(--ease);
}

input:focus,
textarea:focus,
select:focus {
  outline: none;
  border-color: var(--c-accent);
}

textarea {
  resize: vertical;
  min-height: 70px;
  line-height: 1.5;
}

select {
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%239aa0a8' stroke-width='2'><polyline points='6 9 12 15 18 9'/></svg>");
  background-repeat: no-repeat;
  background-position: right 0.5rem center;
  padding-right: 1.75rem;
}

.checkbox {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  cursor: pointer;
  user-select: none;
  font-size: 0.8125rem;
  color: var(--c-text);
}

.checkbox input {
  width: 16px;
  height: 16px;
  accent-color: var(--c-accent);
  cursor: pointer;
}

/* ============================================================
   BUTTONS
   ============================================================ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  padding: 0.5rem 0.875rem;
  border-radius: var(--radius-sm);
  font-size: 0.8125rem;
  font-weight: 500;
  letter-spacing: 0.01em;
  transition: background var(--t-fast) var(--ease), color var(--t-fast) var(--ease),
    border-color var(--t-fast) var(--ease), opacity var(--t-fast) var(--ease);
  border: 1px solid transparent;
  white-space: nowrap;
}

.btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.btn--primary {
  background: var(--c-accent);
  color: #000;
}

.btn--primary:hover:not(:disabled) {
  background: var(--c-accent-hover);
}

.btn--secondary {
  background: var(--c-surface-2);
  border-color: var(--c-border);
  color: var(--c-text);
}

.btn--secondary:hover:not(:disabled) {
  border-color: var(--c-text-muted);
}

.btn--ghost {
  color: var(--c-text-muted);
}

.btn--ghost:hover:not(:disabled) {
  color: var(--c-text);
  background: var(--c-surface-2);
}

.btn--danger {
  background: var(--c-error);
  color: #fff;
}

.btn--danger:hover:not(:disabled) {
  background: #dc2626;
}

.btn--icon {
  width: 32px;
  height: 32px;
  padding: 0;
  border-radius: var(--radius-sm);
  color: var(--c-text-muted);
}

.btn--icon:hover:not(:disabled) {
  background: var(--c-surface-2);
  color: var(--c-text);
}

.btn--icon svg {
  width: 14px;
  height: 14px;
}

.btn--full {
  width: 100%;
}

.btn-group {
  display: inline-flex;
  gap: 0.5rem;
}

/* ============================================================
   APP LAYOUT
   ============================================================ */
.app {
  display: grid;
  grid-template-columns: var(--sidebar-w) 1fr;
  grid-template-rows: var(--header-h) 1fr;
  min-height: 100vh;
}

.app-header {
  grid-column: 1 / -1;
  grid-row: 1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 1.25rem;
  background: var(--c-surface);
  border-bottom: 1px solid var(--c-border);
  position: sticky;
  top: 0;
  z-index: 10;
}

.app-header__brand {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 600;
  font-size: 0.875rem;
}

.app-header__brand img {
  width: 22px;
  height: 22px;
}

.app-header__actions {
  display: flex;
  align-items: center;
  gap: 0.625rem;
}

.app-header__dirty {
  font-size: 0.6875rem;
  letter-spacing: 0.02em;
  color: var(--c-accent);
  background: rgba(252, 185, 0, 0.1);
  padding: 0.25rem 0.5rem;
  border-radius: 3px;
  font-weight: 500;
}

.app-header__dirty[hidden] {
  display: none;
}

.app-sidebar {
  grid-row: 2;
  background: var(--c-surface);
  border-right: 1px solid var(--c-border);
  padding: 1rem 0.625rem;
  display: flex;
  flex-direction: column;
  gap: 0.125rem;
}

.tab-link {
  display: flex;
  align-items: center;
  gap: 0.625rem;
  padding: 0.5rem 0.75rem;
  border-radius: var(--radius-sm);
  font-size: 0.8125rem;
  color: var(--c-text-muted);
  cursor: pointer;
  text-align: left;
  width: 100%;
  transition: background var(--t-fast) var(--ease), color var(--t-fast) var(--ease);
}

.tab-link:hover {
  background: var(--c-surface-2);
  color: var(--c-text);
}

.tab-link.is-active {
  background: var(--c-surface-2);
  color: var(--c-accent);
  font-weight: 500;
}

.tab-link svg {
  width: 14px;
  height: 14px;
  flex-shrink: 0;
}

.app-main {
  grid-row: 2;
  overflow-y: auto;
  padding: 1.5rem 1.75rem 4rem;
}

/* ============================================================
   SECTIONS / TABS
   ============================================================ */
.tab-panel {
  display: none;
}

.tab-panel.is-active {
  display: block;
}

.tab-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.25rem;
}

.tab-header h1 {
  font-size: 1.25rem;
  font-weight: 600;
  letter-spacing: -0.01em;
}

.tab-header__sub {
  font-size: 0.8125rem;
  color: var(--c-text-muted);
  margin-top: 0.25rem;
}

.section {
  margin-bottom: 1.5rem;
}

.section h2 {
  font-size: 0.875rem;
  font-weight: 600;
  margin-bottom: 0.75rem;
  color: var(--c-text);
}

.card {
  background: var(--c-surface);
  border: 1px solid var(--c-border);
  border-radius: var(--radius);
  padding: 1rem 1.125rem;
  margin-bottom: 0.75rem;
}

.card--video {
  display: grid;
  grid-template-columns: 96px 1fr auto;
  gap: 0.875rem;
  align-items: center;
}

.card--video__thumb {
  width: 96px;
  height: 54px;
  border-radius: var(--radius-sm);
  background: var(--c-bg);
  object-fit: cover;
  border: 1px solid var(--c-border);
  cursor: grab;
}

.card--video__thumb.is-empty {
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--c-text-faint);
  font-size: 1.25rem;
}

.card--video__main h3 {
  font-size: 0.875rem;
  font-weight: 600;
  margin-bottom: 0.125rem;
}

.card--video__main .meta {
  font-size: 0.75rem;
  color: var(--c-text-muted);
  display: flex;
  gap: 0.625rem;
  flex-wrap: wrap;
}

.card--video__main .meta span:not(:last-child)::after {
  content: '·';
  margin-left: 0.625rem;
  color: var(--c-text-faint);
}

.card--video__actions {
  display: flex;
  gap: 0.25rem;
}

.card--video.is-dragging {
  opacity: 0.4;
}

.card--video.is-drop-target {
  border-top: 2px solid var(--c-accent);
}

.empty-state {
  text-align: center;
  padding: 3rem 1.5rem;
  color: var(--c-text-muted);
  background: var(--c-surface);
  border: 1px dashed var(--c-border);
  border-radius: var(--radius);
}

.empty-state h3 {
  margin-bottom: 0.375rem;
  color: var(--c-text);
  font-size: 0.875rem;
  font-weight: 600;
}

/* ============================================================
   MODAL (form / confirm)
   ============================================================ */
.admin-modal {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  background: rgba(0, 0, 0, 0);
  pointer-events: none;
  opacity: 0;
  transition: background var(--t-med) var(--ease), opacity var(--t-fast) var(--ease);
}

.admin-modal.is-open {
  background: rgba(0, 0, 0, 0.65);
  pointer-events: auto;
  opacity: 1;
  backdrop-filter: blur(4px);
}

.admin-modal__inner {
  background: var(--c-surface);
  border: 1px solid var(--c-border);
  border-radius: var(--radius);
  padding: 1.25rem 1.25rem 1rem;
  max-width: 460px;
  width: 100%;
  transform: scale(0.96);
  opacity: 0;
  transition: transform var(--t-med) var(--ease), opacity var(--t-med) var(--ease);
  max-height: 90vh;
  overflow-y: auto;
}

.admin-modal.is-open .admin-modal__inner {
  transform: scale(1);
  opacity: 1;
}

.admin-modal__inner--wide {
  max-width: 640px;
}

.admin-modal__title {
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
}

.admin-modal__body {
  font-size: 0.8125rem;
  color: var(--c-text-muted);
  margin-bottom: 1rem;
  line-height: 1.55;
}

.admin-modal__actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.5rem;
  margin-top: 1rem;
}

.admin-modal__form .field:last-of-type {
  margin-bottom: 0;
}

/* ============================================================
   TOAST
   ============================================================ */
.admin-toast-stack {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  z-index: 2000;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  pointer-events: none;
}

.admin-toast {
  background: var(--c-surface);
  border: 1px solid var(--c-border);
  border-radius: var(--radius);
  padding: 0.625rem 0.875rem;
  font-size: 0.8125rem;
  color: var(--c-text);
  min-width: 220px;
  max-width: 360px;
  opacity: 0;
  transform: translateX(0.5rem);
  transition: opacity var(--t-fast) var(--ease), transform var(--t-fast) var(--ease);
  pointer-events: auto;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.4);
}

.admin-toast.is-visible {
  opacity: 1;
  transform: translateX(0);
}

.admin-toast--success {
  border-left: 3px solid var(--c-success);
}

.admin-toast--error {
  border-left: 3px solid var(--c-error);
}

.admin-toast--info {
  border-left: 3px solid var(--c-info);
}

/* ============================================================
   THEME / MEDIA SPECIFICS
   ============================================================ */
.theme-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.75rem;
  margin-bottom: 1.5rem;
}

.theme-card {
  background: var(--c-surface);
  border: 1px solid var(--c-border);
  border-radius: var(--radius);
  padding: 1rem;
  cursor: pointer;
  transition: border-color var(--t-fast) var(--ease);
}

.theme-card:hover {
  border-color: var(--c-text-muted);
}

.theme-card.is-active {
  border-color: var(--c-accent);
  background: rgba(252, 185, 0, 0.04);
}

.theme-card__preview {
  height: 80px;
  border-radius: var(--radius-sm);
  margin-bottom: 0.625rem;
  border: 1px solid var(--c-border);
  background: #050505;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #f5f3ee;
  font-family: 'Cormorant Garamond', serif;
  font-size: 0.875rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.theme-card[data-theme="42bit"] .theme-card__preview {
  background: #000;
  color: #f4f4f4;
  font-family: 'Inter', sans-serif;
  font-weight: 600;
  letter-spacing: 0.16em;
  position: relative;
}

.theme-card[data-theme="42bit"] .theme-card__preview::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 50%;
  width: 30%;
  height: 2px;
  background: var(--c-accent);
  transform: translateX(-50%);
}

.theme-card__name {
  font-size: 0.875rem;
  font-weight: 600;
  margin-bottom: 0.125rem;
}

.theme-card__desc {
  font-size: 0.75rem;
  color: var(--c-text-muted);
}

.color-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 0.625rem;
  align-items: center;
  padding: 0.5rem 0;
  border-bottom: 1px solid var(--c-border-soft);
}

.color-row:last-child {
  border-bottom: none;
}

.color-row__label {
  font-size: 0.8125rem;
}

.color-row__label small {
  display: block;
  font-size: 0.6875rem;
  color: var(--c-text-faint);
}

.color-row__input {
  display: flex;
  align-items: center;
  gap: 0.375rem;
}

.color-row__input input[type='color'] {
  width: 32px;
  height: 28px;
  padding: 0;
  border: 1px solid var(--c-border);
  border-radius: var(--radius-sm);
  background: var(--c-bg);
  cursor: pointer;
}

.color-row__input input[type='text'] {
  width: 90px;
  font-family: ui-monospace, monospace;
  font-size: 0.75rem;
  text-transform: uppercase;
}

.media-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 0.625rem;
}

.media-item {
  background: var(--c-surface);
  border: 1px solid var(--c-border);
  border-radius: var(--radius);
  padding: 0.625rem;
  font-size: 0.75rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.media-item__path {
  font-family: ui-monospace, monospace;
  font-size: 0.6875rem;
  color: var(--c-text-muted);
  word-break: break-all;
  background: var(--c-bg);
  padding: 0.25rem 0.4rem;
  border-radius: 3px;
}

.media-item__type {
  font-size: 0.6875rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--c-text-faint);
}

.media-item__actions {
  display: flex;
  gap: 0.25rem;
  margin-top: auto;
}

/* ============================================================
   FONT ROWS (tab-theme)
   ============================================================ */
.font-row {
  display: grid;
  grid-template-columns: 160px 1fr;
  gap: 0.75rem;
  align-items: start;
  padding: 0.75rem 0;
  border-bottom: 1px solid var(--c-border-soft);
}

.font-row:last-child {
  border-bottom: none;
}

.font-row__label {
  font-size: 0.8125rem;
  padding-top: 0.375rem;
}

.font-row__label small {
  display: block;
  font-size: 0.6875rem;
  color: var(--c-text-faint);
  margin-top: 0.2rem;
}

.font-row__control {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.font-row__preview {
  font-size: 1.125rem;
  color: var(--c-text-muted);
  padding: 0.5rem 0.625rem;
  background: var(--c-bg);
  border: 1px solid var(--c-border);
  border-radius: var(--radius-sm);
  letter-spacing: 0.06em;
  min-height: 2.5rem;
}

/* ============================================================
   SOCIAL LINK ROWS (tab-pages)
   ============================================================ */
.social-item {
  display: grid;
  grid-template-columns: 140px 1fr auto auto;
  gap: 0.5rem;
  align-items: center;
  padding: 0.5rem 0;
  border-bottom: 1px solid var(--c-border-soft);
}

.social-item:last-child {
  border-bottom: none;
}

/* ============================================================
   EXPORT TAB
   ============================================================ */
.export-card {
  background: var(--c-surface);
  border: 1px solid var(--c-border);
  border-radius: var(--radius);
  padding: 1.25rem;
  margin-bottom: 0.875rem;
}

.export-card h3 {
  font-size: 0.9375rem;
  font-weight: 600;
  margin-bottom: 0.375rem;
}

.export-card p {
  color: var(--c-text-muted);
  font-size: 0.8125rem;
  margin-bottom: 1rem;
  line-height: 1.55;
}

.export-card__path {
  background: var(--c-bg);
  border: 1px solid var(--c-border);
  border-radius: var(--radius-sm);
  padding: 0.5rem 0.625rem;
  font-family: ui-monospace, monospace;
  font-size: 0.75rem;
  color: var(--c-accent);
  margin-bottom: 0.875rem;
}

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 720px) {
  :root {
    --sidebar-w: 60px;
  }

  .tab-link span {
    display: none;
  }

  .tab-link {
    justify-content: center;
    padding: 0.5rem;
  }

  .app-main {
    padding: 1rem;
  }

  .card--video {
    grid-template-columns: 64px 1fr;
    grid-template-rows: auto auto;
  }

  .card--video__thumb {
    width: 64px;
    height: 36px;
  }

  .card--video__actions {
    grid-column: 1 / -1;
    justify-content: flex-end;
  }

  .theme-grid {
    grid-template-columns: 1fr;
  }
}

/* Scrollbar look */
::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}
::-webkit-scrollbar-track {
  background: var(--c-bg);
}
::-webkit-scrollbar-thumb {
  background: var(--c-surface-2);
  border-radius: 5px;
}
::-webkit-scrollbar-thumb:hover {
  background: var(--c-border);
}
