/**
 * Botlify Blog Admin Studio Stylesheet
 * Dark glassmorphic workspace matching Botlify control panel.
 */

:root {
  --adm-bg: #0a0d16;
  --adm-sidebar: #0e1220;
  --adm-card: #121729;
  --adm-card-hover: #171d33;
  --adm-border: rgba(255, 255, 255, 0.08);
  --adm-border-focus: #fbbf24;
  --adm-primary: #fbbf24;
  --adm-primary-hover: #f59e0b;
  --adm-text-main: #f3f4f6;
  --adm-text-sub: #9ca3af;
  --adm-text-muted: #6b7280;
  --adm-danger: #ef4444;
  --adm-success: #10b981;
  --adm-cyan: #38bdf8;
  --adm-radius: 10px;
  --adm-font-sans: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --adm-font-mono: 'JetBrains Mono', Consolas, Monaco, monospace;
}

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

body.adm-body {
  background: var(--adm-bg);
  color: var(--adm-text-main);
  font-family: var(--adm-font-sans);
  line-height: 1.5;
  display: flex;
  min-height: 100vh;
}

/* Sidebar */
.adm-sidebar {
  width: 260px;
  background: var(--adm-sidebar);
  border-right: 1px solid var(--adm-border);
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
  z-index: 100;
}

.adm-brand {
  padding: 24px;
  border-bottom: 1px solid var(--adm-border);
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  color: #fff;
  font-weight: 700;
  font-size: 1.15rem;
}

.adm-brand img {
  width: 32px;
  height: 32px;
  border-radius: 8px;
}

.adm-nav {
  padding: 20px 14px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex: 1;
  overflow-y: auto;
}

.adm-nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  border-radius: var(--adm-radius);
  color: var(--adm-text-sub);
  text-decoration: none;
  font-size: 0.92rem;
  font-weight: 500;
  transition: all 0.2s;
}

.adm-nav-item:hover, .adm-nav-item.active {
  background: rgba(251, 191, 36, 0.12);
  color: var(--adm-primary);
}

.adm-nav-item svg {
  flex-shrink: 0;
}

.adm-user-row {
  padding: 18px 20px;
  border-top: 1px solid var(--adm-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.adm-username {
  font-size: 0.88rem;
  font-weight: 600;
  color: #fff;
}

.adm-logout-btn {
  color: var(--adm-text-muted);
  text-decoration: none;
  font-size: 0.82rem;
  transition: color 0.2s;
}
.adm-logout-btn:hover { color: var(--adm-danger); }

/* Main Wrapper */
.adm-main-wrap {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
}

.adm-topbar {
  height: 64px;
  border-bottom: 1px solid var(--adm-border);
  padding: 0 32px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(14, 18, 32, 0.7);
  backdrop-filter: blur(10px);
}

.adm-topbar-title {
  font-size: 1.25rem;
  font-weight: 700;
  color: #fff;
}

.adm-topbar-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.adm-content-area {
  padding: 32px;
  flex: 1;
}

/* Stats Cards */
.adm-stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 20px;
  margin-bottom: 32px;
}

.adm-stat-card {
  background: var(--adm-card);
  border: 1px solid var(--adm-border);
  border-radius: var(--adm-radius);
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.adm-stat-label {
  font-size: 0.82rem;
  color: var(--adm-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  font-weight: 600;
}

.adm-stat-val {
  font-size: 1.85rem;
  font-weight: 800;
  color: #fff;
}

/* Data Table */
.adm-card {
  background: var(--adm-card);
  border: 1px solid var(--adm-border);
  border-radius: var(--adm-radius);
  overflow: hidden;
}

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

.adm-card-title {
  font-size: 1.05rem;
  font-weight: 700;
  color: #fff;
}

.adm-table-wrap {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.adm-table {
  width: 100%;
  min-width: 600px;
  border-collapse: collapse;
  text-align: left;
  font-size: 0.92rem;
}

.adm-table th {
  background: rgba(255, 255, 255, 0.02);
  padding: 12px 20px;
  border-bottom: 1px solid var(--adm-border);
  color: var(--adm-text-sub);
  font-weight: 600;
}

.adm-table td {
  padding: 14px 20px;
  border-bottom: 1px solid var(--adm-border);
  color: var(--adm-text-main);
  vertical-align: middle;
}

.adm-table tr:hover td {
  background: rgba(255, 255, 255, 0.02);
}

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

/* Badges */
.adm-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 8px;
  border-radius: 4px;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
}
.adm-badge-success { background: rgba(16, 185, 129, 0.15); color: #34d399; }
.adm-badge-warning { background: rgba(251, 191, 36, 0.15); color: #fbbf24; }
.adm-badge-muted { background: rgba(107, 114, 128, 0.2); color: #9ca3af; }

/* Buttons */
.adm-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  border-radius: 6px;
  font-size: 0.88rem;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  border: 1px solid transparent;
  transition: all 0.2s;
}

.adm-btn-primary {
  background: var(--adm-primary);
  color: #000;
}
.adm-btn-primary:hover {
  background: var(--adm-primary-hover);
  color: #000;
}

.adm-btn-outline {
  border-color: var(--adm-border);
  color: var(--adm-text-sub);
  background: transparent;
}
.adm-btn-outline:hover {
  border-color: var(--adm-primary);
  color: var(--adm-primary);
}

.adm-btn-danger {
  background: rgba(239, 68, 68, 0.12);
  color: var(--adm-danger);
  border-color: rgba(239, 68, 68, 0.25);
}
.adm-btn-danger:hover {
  background: var(--adm-danger);
  color: #fff;
}

.adm-btn-sm {
  padding: 4px 10px;
  font-size: 0.8rem;
}

/* Forms */
.adm-form-group {
  margin-bottom: 20px;
}

.adm-label {
  display: block;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--adm-text-main);
  margin-bottom: 8px;
}

.adm-input, .adm-select, .adm-textarea {
  width: 100%;
  padding: 10px 14px;
  background: #0f1322;
  border: 1px solid var(--adm-border);
  border-radius: 6px;
  color: #fff;
  font-size: 0.95rem;
  font-family: inherit;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.adm-input:focus, .adm-select:focus, .adm-textarea:focus {
  border-color: var(--adm-primary);
  box-shadow: 0 0 0 3px rgba(251, 191, 36, 0.15);
}

.adm-textarea {
  min-height: 120px;
  line-height: 1.6;
}

/* Post Editor Dual Pane Layout */
.adm-editor-layout {
  display: grid;
  grid-template-columns: 1fr 340px;
  gap: 28px;
}

.adm-editor-main {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.adm-editor-sidebar {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.adm-markdown-pane-wrap {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  border: 1px solid var(--adm-border);
  border-radius: var(--adm-radius);
  overflow: hidden;
  background: #0d111d;
  height: 580px;
}

.adm-markdown-pane-wrap.single-pane {
  grid-template-columns: 1fr;
}

.adm-markdown-textarea {
  width: 100%;
  height: 100%;
  background: transparent;
  border: none;
  color: #e2e8f0;
  font-family: var(--adm-font-mono);
  font-size: 0.9rem;
  line-height: 1.6;
  padding: 18px;
  resize: none;
  outline: none;
}

.adm-preview-pane {
  padding: 18px;
  overflow-y: auto;
  border-left: 1px solid var(--adm-border);
  background: #090c14;
  color: #cbd5e1;
}

/* Alerts */
.adm-alert {
  padding: 12px 18px;
  border-radius: 6px;
  margin-bottom: 24px;
  font-size: 0.9rem;
}
.adm-alert-success { background: rgba(16, 185, 129, 0.15); border: 1px solid #10b981; color: #34d399; }
.adm-alert-danger { background: rgba(239, 68, 68, 0.15); border: 1px solid #ef4444; color: #f87171; }

@media (max-width: 992px) {
  body.adm-body { flex-direction: column; }
  .adm-sidebar { width: 100%; height: auto; position: static; }
  .adm-editor-layout { grid-template-columns: 1fr; }
  .adm-markdown-pane-wrap { grid-template-columns: 1fr; height: 400px; }
  .adm-preview-pane { display: none; }
}

@media (max-width: 640px) {
  .adm-content-area { padding: 16px; }
  .adm-topbar { padding: 0 16px; }
  .adm-stats-grid { grid-template-columns: repeat(2, 1fr); gap: 12px; }
  .adm-stat-card { padding: 14px; }
  .adm-stat-val { font-size: 1.5rem; }
}
