/* ── Ozone CMS Admin Design System & Blogger-Style Editor ──────── */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&family=Outfit:wght@500;600;700&family=Source+Serif+4:ital,opsz,wght@0,8..60,400;0,8..60,600;1,8..60,400&display=swap');

:root {
  --admin-bg: #09090b;
  --admin-surface: #121215;
  --admin-surface-card: #18181c;
  --admin-surface-hover: #222227;
  --admin-border: #27272a;
  --admin-border-subtle: #1f1f23;
  --admin-border-focus: #38bdf8;
  
  --admin-text: #f4f4f5;
  --admin-text-muted: #a1a1aa;
  --admin-text-dim: #71717a;
  
  --brand-accent: #38bdf8;
  --brand-accent-hover: #7dd3fc;
  --brand-accent-dark: #0284c7;
  --brand-accent-glow: rgba(56, 189, 248, 0.18);
  
  --status-published: #10b981;
  --status-published-bg: rgba(16, 185, 129, 0.12);
  --status-draft: #f59e0b;
  --status-draft-bg: rgba(245, 158, 11, 0.12);
  --status-scheduled: #38bdf8;
  --status-scheduled-bg: rgba(56, 189, 248, 0.12);
  --danger: #ef4444;
  --danger-bg: rgba(239, 68, 68, 0.12);

  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-display: 'Outfit', var(--font-sans);
  --font-serif: 'Source Serif 4', Georgia, serif;
  --font-mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;

  --sidebar-w: 260px;
  --sidebar-w-collapsed: 72px;
  --topbar-h: 64px;
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 14px;
  --radius-full: 9999px;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.2);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.35);
  --shadow-lg: 0 12px 32px rgba(0, 0, 0, 0.5);
  --transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

/* Light editor sheet canvas tokens */
.editor-sheet-light {
  --sheet-bg: #ffffff;
  --sheet-text: #18181b;
  --sheet-meta: #52525b;
  --sheet-border: #e4e4e7;
  --sheet-code-bg: #f4f4f5;
  --sheet-quote-bg: #fafafa;
}

/* Dark editor sheet canvas tokens */
.editor-sheet-dark {
  --sheet-bg: #141417;
  --sheet-text: #f4f4f5;
  --sheet-meta: #a1a1aa;
  --sheet-border: #27272a;
  --sheet-code-bg: #09090b;
  --sheet-quote-bg: #18181c;
}

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

html, body {
  min-height: 100%;
  background: var(--admin-bg);
  color: var(--admin-text);
  font-family: var(--font-sans);
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

a {
  color: inherit;
  text-decoration: none;
}

button, input, select, textarea {
  font: inherit;
  color: inherit;
}

/* ── Layout Shell ─────────────────────────────────────────── */
.admin-app {
  display: flex;
  min-height: 100vh;
  position: relative;
  background: var(--admin-bg);
}

/* ── Sidebar ──────────────────────────────────────────────── */
.admin-sidebar {
  width: var(--sidebar-w);
  background: var(--admin-surface);
  border-right: 1px solid var(--admin-border);
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  transition: width 0.25s cubic-bezier(0.16, 1, 0.3, 1), transform 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  position: sticky;
  top: 0;
  height: 100vh;
  z-index: 50;
  overflow-y: auto;
  overflow-x: hidden;
}

.admin-sidebar.collapsed {
  width: var(--sidebar-w-collapsed);
}

.admin-sidebar__header {
  height: var(--topbar-h);
  padding: 0 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--admin-border-subtle);
  flex-shrink: 0;
}

.admin-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  overflow: hidden;
  white-space: nowrap;
}

.admin-brand__logo {
  width: 34px;
  height: 34px;
  border-radius: var(--radius-md);
  background: linear-gradient(135deg, #0284c7 0%, #38bdf8 100%);
  display: grid;
  place-items: center;
  color: #fff;
  font-weight: 700;
  font-family: var(--font-display);
  font-size: 16px;
  box-shadow: 0 0 16px var(--brand-accent-glow);
  flex-shrink: 0;
}

.admin-brand__info {
  display: flex;
  flex-direction: column;
  transition: opacity 0.2s ease;
}

.admin-sidebar.collapsed .admin-brand__info {
  display: none;
}

.admin-brand__title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 15px;
  letter-spacing: -0.02em;
  color: #fff;
  line-height: 1.2;
}

.admin-brand__subtitle {
  font-size: 11px;
  color: var(--brand-accent);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 600;
}

.admin-sidebar__toggle {
  background: transparent;
  border: 1px solid var(--admin-border);
  color: var(--admin-text-muted);
  width: 28px;
  height: 28px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  display: grid;
  place-items: center;
  transition: var(--transition);
  flex-shrink: 0;
}

.admin-sidebar__toggle:hover {
  background: var(--admin-surface-hover);
  color: #fff;
  border-color: var(--brand-accent);
}

.admin-sidebar.collapsed .admin-sidebar__toggle svg {
  transform: rotate(180deg);
}

.admin-sidebar__nav {
  padding: 18px 12px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex: 1;
}

.admin-nav-group-title {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--admin-text-dim);
  padding: 12px 10px 6px;
  white-space: nowrap;
}

.admin-sidebar.collapsed .admin-nav-group-title {
  text-align: center;
  padding: 12px 0 6px;
  font-size: 9px;
}

.admin-nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: var(--radius-md);
  color: var(--admin-text-muted);
  font-weight: 500;
  transition: var(--transition);
  white-space: nowrap;
  position: relative;
}

.admin-nav-item svg {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  transition: transform 0.2s ease;
}

.admin-nav-item:hover {
  background: var(--admin-surface-hover);
  color: #fff;
}

.admin-nav-item.active {
  background: rgba(56, 189, 248, 0.12);
  color: var(--brand-accent);
  font-weight: 600;
}

.admin-nav-item.active::before {
  content: '';
  position: absolute;
  left: 0;
  top: 6px;
  bottom: 6px;
  width: 3px;
  border-radius: 0 4px 4px 0;
  background: var(--brand-accent);
}

.admin-sidebar.collapsed .admin-nav-item {
  justify-content: center;
  padding: 12px 0;
}

.admin-sidebar.collapsed .admin-nav-item span {
  display: none;
}

.admin-nav-item__badge {
  margin-left: auto;
  font-size: 11px;
  font-weight: 600;
  padding: 2px 7px;
  border-radius: var(--radius-full);
  background: var(--admin-surface-card);
  color: var(--admin-text-muted);
  border: 1px solid var(--admin-border);
}

.admin-sidebar.collapsed .admin-nav-item__badge {
  display: none;
}

/* Sidebar Footer (User info & Logout) */
.admin-sidebar__footer {
  padding: 14px 12px;
  border-top: 1px solid var(--admin-border-subtle);
  display: flex;
  align-items: center;
  gap: 10px;
  background: rgba(0, 0, 0, 0.15);
}

.admin-user-card {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 1;
  overflow: hidden;
}

.admin-user-avatar {
  width: 34px;
  height: 34px;
  border-radius: var(--radius-full);
  background: linear-gradient(135deg, #3b82f6 0%, #1d4ed8 100%);
  display: grid;
  place-items: center;
  color: #fff;
  font-weight: 600;
  font-size: 13px;
  flex-shrink: 0;
  border: 2px solid var(--admin-border);
}

.admin-user-meta {
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.admin-sidebar.collapsed .admin-user-meta {
  display: none;
}

.admin-user-name {
  font-weight: 600;
  font-size: 13px;
  color: #fff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.admin-user-role {
  font-size: 11px;
  color: var(--brand-accent);
  text-transform: capitalize;
}

.admin-logout-btn {
  background: transparent;
  border: none;
  color: var(--admin-text-dim);
  cursor: pointer;
  padding: 6px;
  border-radius: var(--radius-sm);
  display: grid;
  place-items: center;
  transition: var(--transition);
}

.admin-logout-btn:hover {
  background: var(--danger-bg);
  color: var(--danger);
}

/* Mobile Sidebar Backdrop */
.admin-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.65);
  backdrop-filter: blur(4px);
  z-index: 45;
}

/* ── Main Content Area ────────────────────────────────────── */
.admin-main {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
  overflow-y: auto;
}

/* ── Top Bar ──────────────────────────────────────────────── */
.admin-topbar {
  height: var(--topbar-h);
  background: var(--admin-surface);
  border-bottom: 1px solid var(--admin-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  position: sticky;
  top: 0;
  z-index: 30;
}

.admin-topbar__left {
  display: flex;
  align-items: center;
  gap: 16px;
}

.admin-mobile-toggle {
  display: none;
  background: transparent;
  border: 1px solid var(--admin-border);
  color: var(--admin-text);
  width: 36px;
  height: 36px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  place-items: center;
}

.admin-breadcrumb {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--admin-text-muted);
}

.admin-breadcrumb a:hover {
  color: #fff;
}

.admin-breadcrumb span.separator {
  color: var(--admin-text-dim);
}

.admin-breadcrumb span.current {
  color: #fff;
  font-weight: 600;
}

.admin-topbar__right {
  display: flex;
  align-items: center;
  gap: 12px;
}

/* ── Content View Wrapper ─────────────────────────────────── */
.admin-content {
  padding: 28px 32px 64px;
  flex: 1;
  max-width: 1400px;
  width: 100%;
  margin: 0 auto;
}

.admin-page-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 28px;
  flex-wrap: wrap;
}

.admin-page-header__title {
  font-family: var(--font-display);
  font-size: 26px;
  font-weight: 700;
  color: #fff;
  letter-spacing: -0.02em;
  line-height: 1.2;
}

.admin-page-header__desc {
  font-size: 14px;
  color: var(--admin-text-muted);
  margin-top: 4px;
}

/* ── Buttons ──────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 9px 18px;
  border-radius: var(--radius-md);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  border: 1px solid transparent;
  white-space: nowrap;
}

.btn svg {
  width: 16px;
  height: 16px;
}

.btn-primary {
  background: var(--brand-accent);
  color: #09090b;
  border-color: var(--brand-accent);
}

.btn-primary:hover {
  background: var(--brand-accent-hover);
  border-color: var(--brand-accent-hover);
  box-shadow: 0 0 16px var(--brand-accent-glow);
}

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

.btn-secondary:hover {
  background: var(--admin-surface-hover);
  border-color: var(--admin-border-focus);
  color: #fff;
}

.btn-ghost {
  background: transparent;
  color: var(--admin-text-muted);
  border-color: transparent;
}

.btn-ghost:hover {
  background: var(--admin-surface-hover);
  color: #fff;
}

.btn-danger {
  background: var(--danger-bg);
  color: var(--danger);
  border-color: rgba(239, 68, 68, 0.3);
}

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

.btn-sm {
  padding: 6px 12px;
  font-size: 12px;
  border-radius: var(--radius-sm);
}

.btn-icon {
  width: 34px;
  height: 34px;
  padding: 0;
  border-radius: var(--radius-sm);
}

/* ── Stat Metric Cards ────────────────────────────────────── */
.admin-stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 18px;
  margin-bottom: 32px;
}

.admin-stat-card {
  background: var(--admin-surface-card);
  border: 1px solid var(--admin-border);
  border-radius: var(--radius-lg);
  padding: 20px;
  display: flex;
  flex-direction: column;
  position: relative;
  overflow: hidden;
  transition: var(--transition);
}

.admin-stat-card:hover {
  border-color: var(--admin-border-focus);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.admin-stat-card__top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.admin-stat-card__label {
  font-size: 13px;
  font-weight: 500;
  color: var(--admin-text-muted);
}

.admin-stat-card__icon {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-md);
  display: grid;
  place-items: center;
  background: rgba(255, 255, 255, 0.04);
  color: var(--brand-accent);
}

.admin-stat-card__icon.success {
  color: var(--status-published);
  background: var(--status-published-bg);
}

.admin-stat-card__icon.warning {
  color: var(--status-draft);
  background: var(--status-draft-bg);
}

.admin-stat-card__icon.info {
  color: var(--brand-accent);
  background: var(--brand-accent-glow);
}

.admin-stat-card__value {
  font-family: var(--font-display);
  font-size: 32px;
  font-weight: 700;
  color: #fff;
  line-height: 1;
}

.admin-stat-card__trend {
  font-size: 12px;
  color: var(--admin-text-dim);
  margin-top: 8px;
  display: flex;
  align-items: center;
  gap: 4px;
}

/* ── Data Tables & Panels ─────────────────────────────────── */
.admin-card {
  background: var(--admin-surface-card);
  border: 1px solid var(--admin-border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  margin-bottom: 28px;
}

.admin-card__header {
  padding: 18px 24px;
  border-bottom: 1px solid var(--admin-border-subtle);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.admin-card__title {
  font-family: var(--font-display);
  font-size: 17px;
  font-weight: 600;
  color: #fff;
}

.admin-card__body {
  padding: 24px;
}

/* Filter Bar */
.admin-filter-bar {
  display: flex;
  gap: 12px;
  align-items: center;
  flex-wrap: wrap;
  padding: 16px 24px;
  background: rgba(0, 0, 0, 0.2);
  border-bottom: 1px solid var(--admin-border-subtle);
}

.admin-search-box {
  position: relative;
  flex: 1;
  min-width: 240px;
}

.admin-search-box svg {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  width: 16px;
  height: 16px;
  color: var(--admin-text-dim);
}

.admin-input, .admin-select, .admin-textarea {
  width: 100%;
  background: var(--admin-surface);
  border: 1px solid var(--admin-border);
  border-radius: var(--radius-md);
  padding: 9px 14px;
  color: #fff;
  transition: var(--transition);
}

.admin-search-box .admin-input {
  padding-left: 38px;
}

.admin-input:focus, .admin-select:focus, .admin-textarea:focus {
  outline: none;
  border-color: var(--brand-accent);
  box-shadow: 0 0 0 3px var(--brand-accent-glow);
}

.admin-select {
  padding-right: 32px;
  cursor: pointer;
}

/* Modern Data Table */
.admin-table-container {
  overflow-x: auto;
  width: 100%;
}

.admin-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
}

.admin-table th {
  padding: 14px 20px;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--admin-text-dim);
  font-weight: 600;
  border-bottom: 1px solid var(--admin-border);
  background: rgba(0, 0, 0, 0.15);
  white-space: nowrap;
}

.admin-table td {
  padding: 16px 20px;
  border-bottom: 1px solid var(--admin-border-subtle);
  color: var(--admin-text);
  font-size: 13px;
  vertical-align: middle;
}

.admin-table tbody tr {
  transition: background 0.15s ease;
}

.admin-table tbody tr:hover {
  background: var(--admin-surface-hover);
}

.admin-table tbody tr:last-child td {
  border-bottom: none;
}

.admin-table__title {
  font-weight: 600;
  color: #fff;
  display: block;
  font-size: 14px;
}

.admin-table__meta {
  font-size: 12px;
  color: var(--admin-text-dim);
  margin-top: 3px;
}

/* Status Pill Badges */
.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 10px;
  border-radius: var(--radius-full);
  font-size: 11px;
  font-weight: 600;
  text-transform: capitalize;
  white-space: nowrap;
}

.status-badge::before {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 50%;
}

.status-badge.published {
  background: var(--status-published-bg);
  color: var(--status-published);
  border: 1px solid rgba(16, 185, 129, 0.25);
}
.status-badge.published::before { background: var(--status-published); }

.status-badge.draft {
  background: var(--status-draft-bg);
  color: var(--status-draft);
  border: 1px solid rgba(245, 158, 11, 0.25);
}
.status-badge.draft::before { background: var(--status-draft); }

.status-badge.scheduled {
  background: var(--status-scheduled-bg);
  color: var(--status-scheduled);
  border: 1px solid rgba(56, 189, 248, 0.25);
}
.status-badge.scheduled::before { background: var(--status-scheduled); }

/* Table Action Buttons */
.table-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.table-action-btn {
  padding: 6px 10px;
  border-radius: var(--radius-sm);
  background: transparent;
  border: 1px solid var(--admin-border);
  color: var(--admin-text-muted);
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  transition: var(--transition);
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.table-action-btn:hover {
  background: var(--admin-surface-hover);
  color: #fff;
  border-color: var(--brand-accent);
}

.table-action-btn.delete:hover {
  background: var(--danger-bg);
  color: var(--danger);
  border-color: var(--danger);
}

/* Pagination */
.admin-pagination {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 24px;
  border-top: 1px solid var(--admin-border-subtle);
  font-size: 13px;
  color: var(--admin-text-muted);
  flex-wrap: wrap;
  gap: 12px;
}

.admin-pagination__pages {
  display: flex;
  align-items: center;
  gap: 4px;
}

.admin-pagination__link {
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  border-radius: var(--radius-sm);
  border: 1px solid var(--admin-border);
  color: var(--admin-text-muted);
  transition: var(--transition);
}

.admin-pagination__link:hover {
  background: var(--admin-surface-hover);
  color: #fff;
}

.admin-pagination__link.active {
  background: var(--brand-accent);
  color: #09090b;
  border-color: var(--brand-accent);
  font-weight: 700;
}

/* ═══════════════════════════════════════════════════════════════
   BLOGGER-STYLE POST EDITOR (NEW)
   Directly modeled on the Google Blogger editor user experience
   ═══════════════════════════════════════════════════════════════ */

.blogger-editor-wrap {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  background: #0d0e12;
}

/* 1. Blogger Top App Bar */
.blogger-topbar {
  height: 64px;
  background: #14151a;
  border-bottom: 1px solid #23242b;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 20px;
  position: sticky;
  top: 0;
  z-index: 40;
  gap: 16px;
}

.blogger-topbar__left {
  display: flex;
  align-items: center;
  gap: 14px;
  flex: 1;
  min-width: 0;
}

.blogger-back-btn {
  width: 38px;
  height: 38px;
  border-radius: var(--radius-full);
  display: grid;
  place-items: center;
  color: var(--admin-text-muted);
  background: transparent;
  border: none;
  cursor: pointer;
  transition: var(--transition);
  flex-shrink: 0;
}

.blogger-back-btn:hover {
  background: #23242b;
  color: #fff;
}

.blogger-brand-badge {
  width: 34px;
  height: 34px;
  background: #f97316; /* Blogger orange or Ozone blue */
  background: linear-gradient(135deg, #f97316 0%, #ea580c 100%);
  border-radius: 9px;
  display: grid;
  place-items: center;
  color: #fff;
  font-weight: 800;
  font-family: var(--font-display);
  font-size: 17px;
  box-shadow: 0 0 12px rgba(249, 115, 22, 0.3);
  flex-shrink: 0;
}

/* Prominent Title Input */
.blogger-title-input {
  flex: 1;
  background: transparent;
  border: none;
  border-bottom: 1.5px solid transparent;
  color: #fff;
  font-family: var(--font-display);
  font-size: 1.35rem;
  font-weight: 600;
  padding: 6px 10px;
  transition: border-color 0.2s ease;
  outline: none;
  min-width: 140px;
}

.blogger-title-input:hover {
  border-bottom-color: #383944;
}

.blogger-title-input:focus {
  border-bottom-color: var(--brand-accent);
}

.blogger-title-input::placeholder {
  color: #555765;
  font-weight: 400;
}

.blogger-topbar__right {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
}

/* Autosave & Word Count Pill */
.blogger-status-indicator {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: var(--admin-text-dim);
  padding: 4px 10px;
  border-radius: var(--radius-full);
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid #23242b;
}

.blogger-status-indicator .status-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--status-published);
}

.blogger-status-indicator .status-dot.saving {
  background: var(--status-draft);
  animation: pulse 1s infinite alternate;
}

@keyframes pulse {
  from { opacity: 0.4; }
  to { opacity: 1; }
}

/* Publish Button Group */
.blogger-publish-group {
  display: flex;
  align-items: center;
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: 0 0 16px rgba(249, 115, 22, 0.25);
}

.blogger-publish-btn {
  background: linear-gradient(135deg, #f97316 0%, #ea580c 100%);
  color: #fff;
  border: none;
  padding: 8px 18px;
  font-weight: 600;
  font-size: 13px;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  cursor: pointer;
  transition: opacity 0.2s ease;
}

.blogger-publish-btn:hover {
  opacity: 0.92;
}

/* Settings Toggle Button */
.blogger-settings-toggle {
  background: transparent;
  border: 1px solid #2a2b34;
  color: var(--admin-text-muted);
  width: 38px;
  height: 38px;
  border-radius: var(--radius-md);
  display: grid;
  place-items: center;
  cursor: pointer;
  transition: var(--transition);
}

.blogger-settings-toggle:hover,
.blogger-settings-toggle.active {
  background: #23242b;
  color: #fff;
  border-color: var(--brand-accent);
}

/* 2. Formatting Toolbar Directly Below Title */
.blogger-toolbar {
  background: #181920;
  border-bottom: 1px solid #272833;
  padding: 6px 18px;
  display: flex;
  align-items: center;
  gap: 4px;
  position: sticky;
  top: 64px;
  z-index: 35;
  overflow-x: auto;
  scrollbar-width: thin;
}

.blogger-tool-group {
  display: flex;
  align-items: center;
  gap: 2px;
}

.blogger-tool-divider {
  width: 1px;
  height: 22px;
  background: #2b2c3a;
  margin: 0 6px;
  flex-shrink: 0;
}

.blogger-tool-btn {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-sm);
  background: transparent;
  border: none;
  color: #a0a2b2;
  display: grid;
  place-items: center;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
  position: relative;
  flex-shrink: 0;
}

.blogger-tool-btn:hover {
  background: #252632;
  color: #fff;
}

.blogger-tool-btn.active {
  background: #2d2f3d;
  color: var(--brand-accent);
}

.blogger-tool-btn svg {
  width: 16px;
  height: 16px;
}

.blogger-select-tool {
  background: #21222d;
  border: 1px solid #2e303f;
  color: #e2e4ef;
  padding: 4px 10px;
  border-radius: var(--radius-sm);
  font-size: 12px;
  cursor: pointer;
  outline: none;
}

/* 3. Editor Workspace Split (Canvas + Settings) */
.blogger-workspace {
  display: flex;
  flex: 1;
  position: relative;
  overflow: hidden;
}

/* Distraction-Free Central Writing Canvas */
.blogger-canvas-container {
  flex: 1;
  padding: 40px 24px 80px;
  display: flex;
  flex-direction: column;
  align-items: center;
  overflow-y: auto;
  background: #0f1015;
}

.blogger-paper {
  width: 100%;
  max-width: 860px;
  min-height: calc(100vh - 240px);
  background: #ffffff;
  color: #18181b;
  border-radius: 8px;
  box-shadow: 0 8px 36px rgba(0, 0, 0, 0.45);
  padding: 56px 64px;
  display: flex;
  flex-direction: column;
  transition: background 0.2s ease, color 0.2s ease;
}

.blogger-paper.theme-dark {
  background: #15161c;
  color: #f4f4f5;
  border: 1px solid #262734;
}

/* Content Editable Area */
.blogger-content-area {
  flex: 1;
  outline: none;
  font-family: var(--font-serif);
  font-size: 1.18rem;
  line-height: 1.75;
  color: inherit;
  min-height: 480px;
}

.blogger-content-area[placeholder]:empty:before {
  content: attr(placeholder);
  color: #9ca3af;
  cursor: text;
}

/* Typography styles inside writing area */
.blogger-content-area h1,
.blogger-content-area h2,
.blogger-content-area h3,
.blogger-content-area h4 {
  font-family: var(--font-display);
  font-weight: 700;
  line-height: 1.25;
  margin: 1.5em 0 0.5em;
}

.blogger-content-area h1 { font-size: 2.1rem; }
.blogger-content-area h2 { font-size: 1.65rem; border-bottom: 1px solid rgba(0, 0, 0, 0.08); padding-bottom: 6px; }
.blogger-paper.theme-dark .blogger-content-area h2 { border-bottom-color: rgba(255, 255, 255, 0.08); }
.blogger-content-area h3 { font-size: 1.35rem; }

.blogger-content-area p {
  margin-bottom: 1.25em;
}

.blogger-content-area blockquote {
  border-left: 4px solid var(--brand-accent);
  padding: 10px 20px;
  margin: 1.5em 0;
  background: rgba(56, 189, 248, 0.06);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  font-style: italic;
}

.blogger-content-area ul,
.blogger-content-area ol {
  padding-left: 28px;
  margin-bottom: 1.25em;
}

.blogger-content-area li {
  margin-bottom: 0.35em;
}

.blogger-content-area pre {
  background: #1e1e24;
  color: #f1f1f1;
  padding: 18px;
  border-radius: var(--radius-md);
  overflow-x: auto;
  font-family: var(--font-mono);
  font-size: 0.92rem;
  margin: 1.5em 0;
}

.blogger-content-area code {
  font-family: var(--font-mono);
  font-size: 0.9em;
  background: rgba(0, 0, 0, 0.06);
  padding: 2px 6px;
  border-radius: 4px;
}

.blogger-paper.theme-dark .blogger-content-area code {
  background: rgba(255, 255, 255, 0.1);
}

.blogger-content-area img {
  max-width: 100%;
  height: auto;
  border-radius: var(--radius-md);
  margin: 1.5em auto;
  display: block;
}

.blogger-content-area hr {
  border: 0;
  height: 1px;
  background: rgba(0, 0, 0, 0.12);
  margin: 2.5em 0;
}

.blogger-paper.theme-dark .blogger-content-area hr {
  background: rgba(255, 255, 255, 0.12);
}

.blogger-content-area a {
  color: #0284c7;
  text-decoration: underline;
}

.blogger-paper.theme-dark .blogger-content-area a {
  color: var(--brand-accent);
}

/* Raw HTML Editor View (Toggled) */
.blogger-html-area {
  display: none;
  width: 100%;
  flex: 1;
  min-height: 480px;
  background: #111216;
  color: #e4e4e7;
  font-family: var(--font-mono);
  font-size: 13px;
  line-height: 1.6;
  padding: 20px;
  border: 1px solid #272833;
  border-radius: var(--radius-md);
  resize: vertical;
  outline: none;
}

/* 4. Blogger Right-Hand Post Settings Drawer */
.blogger-settings-drawer {
  width: 340px;
  background: #14151a;
  border-left: 1px solid #23242b;
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  overflow-y: auto;
  transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1), margin-right 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  z-index: 30;
}

.blogger-settings-drawer.closed {
  margin-right: -340px;
}

.blogger-settings-header {
  padding: 16px 20px;
  border-bottom: 1px solid #23242b;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.blogger-settings-header h3 {
  font-family: var(--font-display);
  font-size: 15px;
  font-weight: 600;
  color: #fff;
}

/* Accordion Section Cards */
.blogger-accordion-item {
  border-bottom: 1px solid #23242b;
}

.blogger-accordion-trigger {
  width: 100%;
  padding: 14px 20px;
  background: transparent;
  border: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: #d1d3df;
  font-weight: 600;
  font-size: 13px;
  cursor: pointer;
  transition: background 0.15s ease;
}

.blogger-accordion-trigger:hover {
  background: #1b1c23;
  color: #fff;
}

.blogger-accordion-trigger svg {
  width: 16px;
  height: 16px;
  color: var(--admin-text-dim);
  transition: transform 0.2s ease;
}

.blogger-accordion-item.open .blogger-accordion-trigger svg {
  transform: rotate(180deg);
}

.blogger-accordion-content {
  display: none;
  padding: 0 20px 20px;
}

.blogger-accordion-item.open .blogger-accordion-content {
  display: block;
}

/* Form Controls Inside Drawer */
.drawer-field {
  margin-bottom: 14px;
}

.drawer-field:last-child {
  margin-bottom: 0;
}

.drawer-label {
  display: block;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--admin-text-dim);
  margin-bottom: 6px;
}

.drawer-hint {
  font-size: 11px;
  color: var(--admin-text-dim);
  margin-top: 4px;
}

/* Tag Chips */
.tag-chips-wrap {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
}

.tag-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: #20222a;
  color: #d1d5db;
  border: 1px solid #2d2f3b;
  border-radius: var(--radius-full);
  padding: 2px 10px;
  font-size: 12px;
}

.tag-chip button {
  background: transparent;
  border: none;
  color: #9ca3af;
  cursor: pointer;
  display: flex;
  align-items: center;
}

.tag-chip button:hover {
  color: var(--danger);
}

/* Image Upload Dropzone */
.image-upload-dropzone {
  border: 2px dashed #2d2f3c;
  border-radius: var(--radius-md);
  padding: 20px;
  text-align: center;
  background: rgba(0, 0, 0, 0.2);
  cursor: pointer;
  transition: var(--transition);
}

.image-upload-dropzone:hover,
.image-upload-dropzone.dragover {
  border-color: var(--brand-accent);
  background: var(--brand-accent-glow);
}

.image-upload-dropzone svg {
  width: 28px;
  height: 28px;
  color: var(--admin-text-dim);
  margin-bottom: 8px;
}

.cover-preview-box {
  position: relative;
  border-radius: var(--radius-md);
  overflow: hidden;
  margin-top: 10px;
  aspect-ratio: 16 / 9;
  border: 1px solid #2d2f3c;
  background: #000;
}

.cover-preview-box img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.cover-remove-btn {
  position: absolute;
  top: 8px;
  right: 8px;
  background: rgba(0, 0, 0, 0.7);
  border: none;
  color: #fff;
  width: 26px;
  height: 26px;
  border-radius: var(--radius-full);
  display: grid;
  place-items: center;
  cursor: pointer;
}

.cover-remove-btn:hover {
  background: var(--danger);
}

/* Custom Checkbox Toggle */
.custom-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
  padding: 8px 0;
}

.custom-toggle span {
  font-size: 13px;
  color: #d1d5db;
}

.custom-toggle input {
  width: 18px;
  height: 18px;
  accent-color: var(--brand-accent);
}

/* ── Modals & Dialogs ─────────────────────────────────────── */
.admin-modal {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 100;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(6px);
  place-items: center;
  padding: 20px;
}

.admin-modal.open {
  display: grid;
}

.admin-modal__dialog {
  width: 100%;
  max-width: 520px;
  background: var(--admin-surface-card);
  border: 1px solid var(--admin-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
  animation: modalIn 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.admin-modal__dialog.wide {
  max-width: 900px;
}

@keyframes modalIn {
  from { opacity: 0; transform: scale(0.96) translateY(8px); }
  to { opacity: 1; transform: scale(1) translateY(0); }
}

.admin-modal__header {
  padding: 18px 24px;
  border-bottom: 1px solid var(--admin-border-subtle);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.admin-modal__header h3 {
  font-family: var(--font-display);
  font-size: 17px;
  font-weight: 600;
  color: #fff;
}

.admin-modal__close {
  background: transparent;
  border: none;
  color: var(--admin-text-dim);
  cursor: pointer;
}

.admin-modal__close:hover {
  color: #fff;
}

.admin-modal__body {
  padding: 24px;
}

.admin-modal__footer {
  padding: 16px 24px;
  border-top: 1px solid var(--admin-border-subtle);
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  background: rgba(0, 0, 0, 0.15);
}

/* ── Toast Notifications ──────────────────────────────────── */
.admin-toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 150;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.admin-toast {
  background: #1b1c23;
  color: #fff;
  border: 1px solid #2d2f3c;
  border-radius: var(--radius-md);
  padding: 12px 18px;
  box-shadow: var(--shadow-lg);
  font-size: 13px;
  display: flex;
  align-items: center;
  gap: 10px;
  animation: toastIn 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes toastIn {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}

.admin-toast.success {
  border-color: rgba(16, 185, 129, 0.4);
}

.admin-toast.error {
  border-color: rgba(239, 68, 68, 0.4);
}

/* ── Responsive Rules ─────────────────────────────────────── */
@media (max-width: 1024px) {
  .admin-sidebar {
    position: fixed;
    transform: translateX(-100%);
    width: var(--sidebar-w) !important;
  }
  .admin-sidebar.open {
    transform: translateX(0);
  }
  .admin-backdrop.open {
    display: block;
  }
  .admin-mobile-toggle {
    display: grid;
  }
  .blogger-settings-drawer {
    position: fixed;
    right: 0;
    top: 64px;
    bottom: 0;
    height: calc(100vh - 64px);
    box-shadow: -8px 0 32px rgba(0, 0, 0, 0.6);
  }
}

@media (max-width: 768px) {
  .admin-content {
    padding: 20px 16px 48px;
  }
  .blogger-paper {
    padding: 32px 24px;
  }
  .blogger-topbar {
    padding: 0 12px;
    gap: 8px;
  }
  .blogger-title-input {
    font-size: 1.1rem;
  }
  .blogger-status-indicator {
    display: none;
  }
}

/* ── Admin Alert Components ──────────────────────────────── */
.admin-alert {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 20px;
  border-radius: var(--radius-md);
  margin-bottom: 24px;
  font-size: 13px;
  animation: alertIn 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes alertIn {
  from { opacity: 0; transform: translateY(-6px); }
  to { opacity: 1; transform: translateY(0); }
}

.admin-alert--success {
  background: rgba(16, 185, 129, 0.12);
  border: 1px solid rgba(16, 185, 129, 0.3);
  color: #6ee7b7;
}

.admin-alert--error {
  background: rgba(239, 68, 68, 0.12);
  border: 1px solid rgba(239, 68, 68, 0.3);
  color: #fca5a5;
}

.admin-alert--info {
  background: rgba(56, 189, 248, 0.12);
  border: 1px solid rgba(56, 189, 248, 0.3);
  color: #7dd3fc;
}

/* ── Light Theme Overrides ────────────────────────────────── */
[data-theme="light"] {
  --admin-bg: #f4f4f5;
  --admin-surface: #ffffff;
  --admin-surface-card: #ffffff;
  --admin-surface-hover: #f0f0f3;
  --admin-border: #e4e4e7;
  --admin-border-subtle: #ebebef;
  --admin-border-focus: #0284c7;

  --admin-text: #18181b;
  --admin-text-muted: #52525b;
  --admin-text-dim: #a1a1aa;

  --brand-accent: #0284c7;
  --brand-accent-hover: #0369a1;
  --brand-accent-dark: #0c4a6e;
  --brand-accent-glow: rgba(2, 132, 199, 0.14);

  --status-published: #059669;
  --status-published-bg: rgba(5, 150, 105, 0.1);
  --status-draft: #d97706;
  --status-draft-bg: rgba(217, 119, 6, 0.1);
  --status-scheduled: #0284c7;
  --status-scheduled-bg: rgba(2, 132, 199, 0.1);
  --danger: #dc2626;
  --danger-bg: rgba(220, 38, 38, 0.08);

  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.06);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.08);
  --shadow-lg: 0 12px 32px rgba(0, 0, 0, 0.12);
}

[data-theme="light"] .admin-body {
  background: var(--admin-bg);
  color: var(--admin-text);
}

[data-theme="light"] .admin-sidebar {
  background: var(--admin-surface);
  border-right-color: var(--admin-border);
}

[data-theme="light"] .admin-brand__title {
  color: var(--admin-text);
}

[data-theme="light"] .admin-brand__logo {
  box-shadow: 0 0 12px var(--brand-accent-glow);
}

[data-theme="light"] .admin-nav-item {
  color: var(--admin-text-muted);
}

[data-theme="light"] .admin-nav-item:hover {
  background: var(--admin-surface-hover);
  color: var(--admin-text);
}

[data-theme="light"] .admin-nav-item.active {
  background: rgba(2, 132, 199, 0.08);
  color: var(--brand-accent);
}

[data-theme="light"] .admin-topbar {
  background: var(--admin-surface);
  border-bottom-color: var(--admin-border);
}

[data-theme="light"] .admin-card {
  background: var(--admin-surface-card);
  border-color: var(--admin-border);
  box-shadow: var(--shadow-sm);
}

[data-theme="light"] .admin-card__header {
  border-bottom-color: var(--admin-border);
}

[data-theme="light"] .admin-table th {
  background: #fafafa;
  color: var(--admin-text-muted);
  border-bottom-color: var(--admin-border);
}

[data-theme="light"] .admin-table td {
  border-bottom-color: var(--admin-border);
}

[data-theme="light"] .admin-table tbody tr:hover {
  background: #f9fafb;
}

[data-theme="light"] .admin-input,
[data-theme="light"] .admin-select,
[data-theme="light"] .admin-textarea {
  background: #fafafa;
  border-color: var(--admin-border);
  color: var(--admin-text);
}

[data-theme="light"] .admin-input:focus,
[data-theme="light"] .admin-select:focus,
[data-theme="light"] .admin-textarea:focus {
  background: #fff;
  border-color: var(--brand-accent);
  box-shadow: 0 0 0 3px var(--brand-accent-glow);
}

[data-theme="light"] .admin-input::placeholder,
[data-theme="light"] .admin-textarea::placeholder {
  color: #a1a1aa;
}

[data-theme="light"] .admin-backdrop.open {
  background: rgba(0, 0, 0, 0.25);
}

[data-theme="light"] .admin-user-card {
  background: var(--admin-surface-hover);
}

[data-theme="light"] .admin-user-avatar {
  background: rgba(2, 132, 199, 0.12);
  color: var(--brand-accent);
}

[data-theme="light"] .admin-alert--success {
  background: rgba(5, 150, 105, 0.08);
  border-color: rgba(5, 150, 105, 0.25);
  color: #065f46;
}

[data-theme="light"] .admin-alert--error {
  background: rgba(220, 38, 38, 0.06);
  border-color: rgba(220, 38, 38, 0.25);
  color: #991b1b;
}

[data-theme="light"] .admin-alert--info {
  background: rgba(2, 132, 199, 0.06);
  border-color: rgba(2, 132, 199, 0.25);
  color: #0c4a6e;
}

[data-theme="light"] .btn-secondary {
  background: #f4f4f5;
  border-color: var(--admin-border);
  color: var(--admin-text);
}

[data-theme="light"] .btn-secondary:hover {
  background: #e4e4e7;
}

[data-theme="light"] .admin-page-header__title {
  color: var(--admin-text);
}

[data-theme="light"] .admin-page-header__desc {
  color: var(--admin-text-muted);
}

[data-theme="light"] .status-badge.published {
  background: var(--status-published-bg);
  color: var(--status-published);
}

[data-theme="light"] .status-badge.draft {
  background: var(--status-draft-bg);
  color: var(--status-draft);
}

[data-theme="light"] .status-badge.scheduled {
  background: var(--status-scheduled-bg);
  color: var(--status-scheduled);
}

[data-theme="light"] .admin-sidebar__footer {
  border-top-color: var(--admin-border);
}

[data-theme="light"] .admin-breadcrumb a {
  color: var(--admin-text-muted);
}

[data-theme="light"] .admin-breadcrumb .current {
  color: var(--admin-text);
}

[data-theme="light"] .admin-toast {
  background: var(--admin-surface-card);
  border-color: var(--admin-border);
  color: var(--admin-text);
  box-shadow: var(--shadow-lg);
}

/* ── Appearance Selector Component ────────────────────────── */
.appearance-selector {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.appearance-option {
  flex: 1;
  min-width: 100px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding: 20px 16px;
  border-radius: var(--radius-md);
  border: 2px solid var(--admin-border);
  background: transparent;
  color: var(--admin-text-muted);
  cursor: pointer;
  transition: var(--transition);
  font-family: var(--font-sans);
  font-size: 13px;
  font-weight: 500;
}

.appearance-option:hover {
  border-color: var(--admin-border-focus);
  background: var(--admin-surface-hover);
  color: var(--admin-text);
}

.appearance-option.active {
  border-color: var(--brand-accent);
  background: var(--brand-accent-glow);
  color: var(--brand-accent);
  box-shadow: 0 0 0 3px var(--brand-accent-glow);
}

.appearance-option svg {
  width: 28px;
  height: 28px;
  stroke-width: 1.5;
}

.appearance-option .appearance-label {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
}

.appearance-option .appearance-label span:last-child {
  font-size: 11px;
  color: var(--admin-text-dim);
  font-weight: 400;
}

.appearance-option.active .appearance-label span:last-child {
  color: var(--brand-accent);
  opacity: 0.75;
}

