/* ════════════════════════════════════════════════════════
   Roman Agency — Admin Panel CSS
   Dark premium theme matching the landing page
   ════════════════════════════════════════════════════════ */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');

/* ── Reset & Base ───────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg:        #0a0a0f;
  --bg-2:      #111118;
  --bg-3:      #1a1a24;
  --border:    rgba(255,255,255,0.08);
  --border-2:  rgba(255,255,255,0.14);
  --gold:      #f2ca50;
  --gold-dim:  rgba(242,202,80,0.12);
  --green:     #50df38;
  --text:      #e2e4f3;
  --text-dim:  #8b8fa8;
  --text-faint:#4d506a;
  --red:       #ff4d6a;
  --red-dim:   rgba(255,77,106,0.12);
  --sidebar-w: 220px;
  --radius:    10px;
  --shadow:    0 4px 24px rgba(0,0,0,0.5);
}

html, body { height: 100%; }

body {
  font-family: 'Inter', system-ui, sans-serif;
  font-size: 14px;
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
  display: flex;
  min-height: 100vh;
}

/* ── Login Page ─────────────────────────────────────── */
body.login-page {
  display: flex;
  align-items: center;
  justify-content: center;
  background: radial-gradient(ellipse at 30% 20%, rgba(242,202,80,0.05) 0%, transparent 60%),
              var(--bg);
}

.login-wrap {
  width: 100%;
  max-width: 400px;
  padding: 24px;
}

.login-card {
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 40px;
  box-shadow: var(--shadow);
}

.login-brand {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 36px;
}

.login-brand__logo-img {
  width: 168px;
  max-width: 100%;
  height: auto;
  object-fit: contain;
  flex-shrink: 0;
}

.login-brand__name {
  font-weight: 700;
  font-size: 13px;
  letter-spacing: 0.08em;
  color: var(--text);
}

.login-brand__sub {
  font-size: 11px;
  color: var(--text-dim);
  margin-top: 2px;
}

.login-form { display: flex; flex-direction: column; gap: 18px; }

.login-error {
  background: var(--red-dim);
  border: 1px solid var(--red);
  color: var(--red);
  padding: 10px 14px;
  border-radius: 8px;
  font-size: 13px;
}

.login-note {
  text-align: center;
  font-size: 11px;
  color: var(--text-faint);
  margin-top: 28px;
}

/* ── Sidebar ────────────────────────────────────────── */
.sidebar {
  width: var(--sidebar-w);
  min-height: 100vh;
  background: var(--bg-2);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  position: sticky;
  top: 0;
  height: 100vh;
}

.sidebar__brand {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px 18px;
  border-bottom: 1px solid var(--border);
}

.sidebar__logo {
  width: 32px;
  height: 32px;
  background: var(--gold);
  color: #0a0a0f;
  border-radius: 7px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 15px;
  flex-shrink: 0;
}

.sidebar__logo-img {
  width: 138px;
  max-width: 100%;
  height: auto;
  object-fit: contain;
  flex-shrink: 0;
}

.sidebar__brand-name {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.1em;
  color: var(--text);
  line-height: 1.3;
}

.sidebar__brand-name span { color: var(--gold); }

.sidebar__nav {
  flex: 1;
  padding: 12px 10px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 9px 12px;
  background: none;
  border: none;
  border-radius: 8px;
  color: var(--text-dim);
  cursor: pointer;
  font-size: 13px;
  font-family: inherit;
  font-weight: 500;
  transition: background 0.15s, color 0.15s;
  text-align: left;
}

.nav-item svg { width: 16px; height: 16px; flex-shrink: 0; }

.nav-item:hover { background: var(--bg-3); color: var(--text); }

.nav-item.is-active {
  background: var(--gold-dim);
  color: var(--gold);
}

.sidebar__footer {
  padding: 14px 18px;
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  font-size: 12px;
  color: var(--text-dim);
}

/* ── Main Content ───────────────────────────────────── */
.main {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  height: 100vh;
  overflow-y: auto;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 28px;
  border-bottom: 1px solid var(--border);
  background: var(--bg-2);
  position: sticky;
  top: 0;
  z-index: 10;
}

.topbar__title {
  font-size: 17px;
  font-weight: 600;
  color: var(--text);
}

.status-badge {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 12px;
  color: var(--text-dim);
}

.status-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 6px var(--green);
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.4; }
}

/* ── Tab Panels ─────────────────────────────────────── */
.tab-panel {
  display: none;
  padding: 24px 28px;
  flex: 1;
}

.tab-panel.is-active { display: block; }

/* ── Toolbar ────────────────────────────────────────── */
.panel-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
  gap: 12px;
}

.toolbar-left { display: flex; align-items: center; gap: 10px; }

.count-badge {
  font-size: 13px;
  color: var(--text-dim);
  background: var(--bg-3);
  padding: 5px 12px;
  border-radius: 20px;
  border: 1px solid var(--border);
}

/* ── Media Grid ─────────────────────────────────────── */
.media-grid {
  display: flex;
  flex-direction: row;
  gap: 20px;
  overflow-x: auto;
  padding-bottom: 14px;
}

.media-grid::-webkit-scrollbar { height: 6px; }
.media-grid::-webkit-scrollbar-track { background: var(--bg-3); border-radius: 3px; }
.media-grid::-webkit-scrollbar-thumb { background: var(--border-2); border-radius: 3px; }
.media-grid::-webkit-scrollbar-thumb:hover { background: var(--text-faint); }

/* ── Media Section Tabs (horizontal) ───────────────── */
.media-section-tabs {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 4px;
}

.media-section-tab {
  border: 1px solid var(--border);
  background: var(--bg-3);
  color: var(--text-dim);
  border-radius: 999px;
  padding: 6px 14px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
  font-family: inherit;
  white-space: nowrap;
}

.media-section-tab:hover {
  border-color: var(--border-2);
  color: var(--text);
}

.media-section-tab.is-active {
  background: var(--gold-dim);
  border-color: rgba(242,202,80,0.35);
  color: var(--gold);
}

.media-group {
  flex-shrink: 0;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px;
}

.media-group__header {
  margin-bottom: 10px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border);
}

.media-group__title {
  font-size: 13px;
  font-weight: 700;
  color: var(--gold);
  text-transform: capitalize;
}

.media-group__meta {
  font-size: 11px;
  color: var(--text-faint);
}

.media-group__grid {
  display: flex;
  flex-direction: row;
  gap: 14px;
}

.media-card {
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  transition: border-color 0.2s;
  width: 200px;
  flex-shrink: 0;
}

.media-card:hover { border-color: var(--border-2); }

.media-card__thumb {
  width: 100%;
  height: 112px;
  object-fit: cover;
  background: var(--bg-3);
  display: block;
}

.media-card__thumb--video {
  width: 100%;
  height: 112px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-3);
  color: var(--text-dim);
  font-size: 12px;
}

.media-card__body { padding: 10px 12px; }

.media-card__section-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  margin-bottom: 4px;
}

.media-card__section {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: 4px;
}

.media-card__name {
  font-size: 12px;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-bottom: 2px;
}

.media-card__meta {
  font-size: 11px;
  color: var(--text-faint);
}

.media-card__actions {
  display: flex;
  gap: 6px;
  padding: 8px 12px;
  border-top: 1px solid var(--border);
}

.media-card__actions .btn { flex: 1; justify-content: center; }

.media-card__visibility {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.media-card__visibility.is-visible {
  color: var(--green);
  background: rgba(80,223,56,0.12);
}

.media-card__visibility.is-hidden {
  color: var(--red);
  background: rgba(255,77,106,0.12);
}

.publish-history-item {
  padding: 10px 0;
  border-bottom: 1px solid rgba(255,255,255,0.08);
}

.publish-history-item__top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.publish-history-item__meta {
  font-size: 12px;
  color: var(--text-dim);
  margin-top: 4px;
}

/* ── Publish History Dropdown ──────────────────────── */
.publish-history-dropdown {
  position: relative;
}

.publish-history-panel {
  position: absolute;
  top: 100%;
  right: 0;
  margin-top: 6px;
  width: 320px;
  max-height: 280px;
  overflow-y: auto;
  background: var(--bg-2);
  border: 1px solid var(--border-2);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 14px;
  z-index: 50;
}

.publish-history-panel[hidden] { display: none; }

.publish-history-panel__title {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--gold);
  margin-bottom: 10px;
}

.visibility-toggle {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 4px 8px;
  background: none;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 11px;
  color: var(--text-dim);
  cursor: pointer;
  transition: all 0.15s;
}

.visibility-toggle.is-visible { color: var(--green); border-color: rgba(80,223,56,0.3); }

/* ── FAQ List ───────────────────────────────────────── */
.faq-list { display: flex; flex-direction: column; gap: 10px; max-width: 800px; }

.faq-card {
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 18px;
  display: flex;
  gap: 14px;
  align-items: flex-start;
  transition: border-color 0.15s;
}

.faq-card:hover { border-color: var(--border-2); }

.faq-card__drag {
  color: var(--text-faint);
  cursor: grab;
  margin-top: 2px;
  flex-shrink: 0;
}

.faq-card__body { flex: 1; min-width: 0; }

.faq-card__q {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 5px;
}

.faq-card__a {
  font-size: 13px;
  color: var(--text-dim);
  line-height: 1.6;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.faq-card__meta {
  margin-top: 8px;
  font-size: 12px;
  color: var(--text-faint);
}

.faq-card__actions {
  display: flex;
  gap: 6px;
  flex-shrink: 0;
  margin-top: 2px;
}

/* FAQ multi-lang modal sections */

.faq-lang-switcher {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}

.faq-lang-switcher__tab {
  border: 1px solid var(--border);
  background: var(--bg-3);
  color: var(--text-dim);
  border-radius: 999px;
  padding: 8px 14px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
}

.faq-lang-switcher__tab:hover {
  border-color: var(--border-2);
  color: var(--text);
}

.faq-lang-switcher__tab.is-active {
  background: var(--gold-dim);
  border-color: rgba(242,202,80,0.35);
  color: var(--gold);
}

.faq-lang-section {
  padding: 14px 0 0;
}

.faq-lang-section__label {
  font-size: 13px;
  font-weight: 700;
  color: var(--gold);
  margin-bottom: 10px;
}

/* Settings hints & number-only */
.form-hint {
  display: block;
  font-size: 11px;
  color: var(--text-faint);
  margin-top: 4px;
}

.input-with-preview {
  display: flex;
  gap: 8px;
  align-items: center;
}

.input-with-preview .input {
  flex: 1;
}

/* ── Settings Grid ──────────────────────────────────── */
.settings-actions-top {
  display: flex;
  justify-content: flex-end;
  margin-bottom: 16px;
}

.settings-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
  max-width: 800px;
}

.settings-group {
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
}

.settings-group__title {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: 16px;
}

.settings-group .form-group + .form-group { margin-top: 14px; }

.input-inline {
  display: flex;
  align-items: center;
  gap: 10px;
}

.input-inline .input {
  flex: 1;
}

.input-suffix {
  font-size: 12px;
  color: var(--text-dim);
  white-space: nowrap;
}

/* ── Subscribers Table ──────────────────────────────── */
.table-wrap { overflow-x: auto; border-radius: var(--radius); border: 1px solid var(--border); }

.table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.table th {
  background: var(--bg-3);
  padding: 10px 14px;
  text-align: left;
  font-weight: 600;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-dim);
  border-bottom: 1px solid var(--border);
}

.table td {
  padding: 10px 14px;
  border-bottom: 1px solid var(--border);
  color: var(--text);
}

.table tbody tr:last-child td { border-bottom: none; }
.table tbody tr:hover td { background: var(--bg-3); }

/* ── Form Elements ──────────────────────────────────── */
.form-group { display: flex; flex-direction: column; gap: 6px; }

.form-group label {
  font-size: 12px;
  font-weight: 500;
  color: var(--text-dim);
}

.input, .select, .textarea {
  background: var(--bg-3);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 9px 12px;
  font-size: 13px;
  font-family: inherit;
  color: var(--text);
  outline: none;
  transition: border-color 0.15s;
  width: 100%;
}

.input:focus, .select:focus, .textarea:focus {
  border-color: var(--gold);
}

.input::placeholder, .textarea::placeholder { color: var(--text-faint); }

.textarea { resize: vertical; min-height: 80px; }

.select {
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%238b8fa8' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 32px;
}

.form-error {
  background: var(--red-dim);
  border: 1px solid var(--red);
  color: var(--red);
  padding: 8px 12px;
  border-radius: 8px;
  font-size: 12px;
}

/* ── Buttons ────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  border-radius: 8px;
  font-size: 13px;
  font-family: inherit;
  font-weight: 500;
  cursor: pointer;
  border: 1px solid transparent;
  transition: all 0.15s;
  text-decoration: none;
  white-space: nowrap;
}

.btn:disabled { opacity: 0.5; cursor: not-allowed; }

.btn--primary {
  background: var(--gold);
  color: #0a0a0f;
}

.btn--primary:hover:not(:disabled) {
  background: #f7d96e;
}

.btn--ghost {
  background: none;
  border-color: var(--border);
  color: var(--text-dim);
}

.btn--ghost:hover:not(:disabled) {
  background: var(--bg-3);
  color: var(--text);
}

.btn--danger {
  background: none;
  border-color: transparent;
  color: var(--red);
}

.btn--danger:hover:not(:disabled) {
  background: var(--red-dim);
}

.btn--sm { padding: 5px 10px; font-size: 12px; }
.btn--full { width: 100%; justify-content: center; }

/* ── Modal ──────────────────────────────────────────── */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.7);
  backdrop-filter: blur(4px);
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.modal-overlay[hidden] { display: none; }

.modal {
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: 14px;
  width: 100%;
  max-width: 520px;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  max-height: 90vh;
}

.modal__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 22px;
  border-bottom: 1px solid var(--border);
}

.modal__header h2 { font-size: 16px; font-weight: 600; }

.modal__close {
  background: none;
  border: none;
  color: var(--text-dim);
  cursor: pointer;
  font-size: 16px;
  padding: 4px;
  line-height: 1;
  transition: color 0.15s;
}

.modal__close:hover { color: var(--text); }

.modal__body {
  padding: 22px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.modal__footer {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  padding: 16px 22px;
  border-top: 1px solid var(--border);
}

/* ── Drop Zone ──────────────────────────────────────── */
.drop-zone {
  border: 2px dashed var(--border-2);
  border-radius: 10px;
  padding: 32px;
  text-align: center;
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s;
}

.drop-zone:hover, .drop-zone.is-drag-over {
  border-color: var(--gold);
  background: var(--gold-dim);
}

.drop-zone svg { color: var(--text-dim); margin-bottom: 10px; }

.drop-zone p { font-size: 13px; color: var(--text-dim); }

.link { color: var(--gold); cursor: pointer; text-decoration: underline; }

.drop-preview {
  margin-top: 12px;
  font-size: 12px;
  color: var(--text-dim);
  background: var(--bg-3);
  padding: 8px 12px;
  border-radius: 8px;
  text-align: left;
}

/* ── Toast ──────────────────────────────────────────── */
.toast-stack {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 200;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.toast {
  background: var(--bg-3);
  border: 1px solid var(--border-2);
  border-radius: 10px;
  padding: 12px 18px;
  font-size: 13px;
  min-width: 220px;
  max-width: 380px;
  box-shadow: var(--shadow);
  animation: slideIn 0.25s ease;
}

.toast--success { border-color: rgba(80,223,56,0.4); color: var(--green); }
.toast--error { border-color: rgba(255,77,106,0.4); color: var(--red); }

@keyframes slideIn {
  from { opacity: 0; transform: translateX(30px); }
  to { opacity: 1; transform: translateX(0); }
}

/* ── Spinner ────────────────────────────────────────── */
.spinner {
  width: 14px;
  height: 14px;
  border: 2px solid rgba(0,0,0,0.2);
  border-top-color: #0a0a0f;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  display: inline-block;
}

@keyframes spin { to { transform: rotate(360deg); } }

/* ── Misc ───────────────────────────────────────────── */
.loading { padding: 40px; text-align: center; color: var(--text-dim); }

.empty-state {
  grid-column: 1 / -1;
  padding: 60px;
  text-align: center;
  color: var(--text-dim);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
}
