/* ==========================================================================
   ANUBHAV KASHYAP — ADMIN CMS DASHBOARD STYLES
   Theme: Modern, Colorful, High-Contrast Admin Panel
   ========================================================================== */

:root {
  --admin-sidebar-bg: #0f172a;
  --admin-sidebar-text: #94a3b8;
  --admin-sidebar-active: #ffffff;
  --admin-sidebar-hover: #1e293b;
  --admin-main-bg: #f8fafc;
  --admin-card-bg: #ffffff;
  --admin-border: #e2e8f0;
  --admin-text: #0f172a;
  --admin-muted: #64748b;
  --admin-primary: #4f46e5;
  --admin-primary-hover: #4338ca;
  --admin-success: #10b981;
  --admin-warning: #f59e0b;
  --admin-danger: #ef4444;
  --admin-cyan: #06b6d4;
  --admin-purple: #8b5cf6;
}

body.admin-body {
  background-color: var(--admin-main-bg);
  color: var(--admin-text);
  font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, sans-serif;
  margin: 0;
  display: flex;
  min-height: 100vh;
}

/* Admin Sidebar */
.admin-sidebar {
  width: 270px;
  background: var(--admin-sidebar-bg);
  color: var(--admin-sidebar-text);
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  min-height: 100vh;
  border-right: 1px solid #1e293b;
  position: sticky;
  top: 0;
}

.admin-sidebar-brand {
  padding: 24px 20px;
  display: flex;
  align-items: center;
  gap: 12px;
  border-bottom: 1px solid #1e293b;
}

.admin-sidebar-brand img {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: 2px solid #4f46e5;
}

.admin-brand-info strong {
  color: #ffffff;
  display: block;
  font-size: 0.95rem;
  font-family: 'Space Grotesk', sans-serif;
}

.admin-brand-info span {
  font-size: 0.75rem;
  color: #38bdf8;
  font-family: 'JetBrains Mono', monospace;
}

.admin-sidebar-nav {
  padding: 20px 12px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex-grow: 1;
}

.admin-nav-section-title {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #64748b;
  padding: 12px 12px 6px;
  font-weight: 700;
}

.admin-nav-link {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  color: var(--admin-sidebar-text);
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 500;
  border-radius: 8px;
  transition: all 0.15s ease;
}

.admin-nav-link:hover {
  background: var(--admin-sidebar-hover);
  color: var(--admin-sidebar-active);
}

.admin-nav-link.active {
  background: linear-gradient(135deg, #4f46e5, #06b6d4);
  color: #ffffff;
  font-weight: 600;
  box-shadow: 0 4px 12px rgba(79, 70, 229, 0.3);
}

.admin-nav-link svg {
  flex-shrink: 0;
}

.admin-sidebar-footer {
  padding: 16px 20px;
  border-top: 1px solid #1e293b;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

/* Main Content Area */
.admin-main {
  flex-grow: 1;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
}

.admin-topbar {
  background: #ffffff;
  border-bottom: 1px solid var(--admin-border);
  padding: 16px 32px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  position: sticky;
  top: 0;
  z-index: 10;
}

.admin-topbar-title h1 {
  font-size: 1.35rem;
  margin: 0;
  font-family: 'Space Grotesk', sans-serif;
  color: var(--admin-text);
}

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

.admin-content {
  padding: 32px;
  flex-grow: 1;
}

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

.admin-stat-card {
  background: #ffffff;
  border: 1px solid var(--admin-border);
  border-radius: 12px;
  padding: 22px;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.04);
  position: relative;
  overflow: hidden;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.admin-stat-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 20px -5px rgba(15, 23, 42, 0.06);
}

.admin-stat-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
}

.admin-stat-card.card-blue::before { background: linear-gradient(90deg, #4f46e5, #06b6d4); }
.admin-stat-card.card-green::before { background: linear-gradient(90deg, #10b981, #059669); }
.admin-stat-card.card-purple::before { background: linear-gradient(90deg, #8b5cf6, #d946ef); }
.admin-stat-card.card-amber::before { background: linear-gradient(90deg, #f59e0b, #ef4444); }

.admin-stat-label {
  font-size: 0.8125rem;
  font-weight: 600;
  text-transform: uppercase;
  color: var(--admin-muted);
  letter-spacing: 0.04em;
  margin-bottom: 8px;
}

.admin-stat-val {
  font-size: 2rem;
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 700;
  color: var(--admin-text);
  line-height: 1;
}

/* Admin Cards & Tables */
.admin-card {
  background: #ffffff;
  border: 1px solid var(--admin-border);
  border-radius: 12px;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.04);
  margin-bottom: 28px;
  overflow: hidden;
}

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

.admin-card-title {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 1.15rem;
  margin: 0;
  color: var(--admin-text);
}

.admin-card-body {
  padding: 24px;
}

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

.admin-table th {
  background: #f8fafc;
  padding: 12px 18px;
  font-size: 0.8125rem;
  font-weight: 700;
  color: var(--admin-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  border-bottom: 1px solid var(--admin-border);
}

.admin-table td {
  padding: 16px 18px;
  font-size: 0.9rem;
  border-bottom: 1px solid var(--admin-border);
  vertical-align: middle;
}

.admin-table tr:hover td {
  background: #f8fafc;
}

/* Forms & Inputs */
.form-group {
  margin-bottom: 22px;
}

.form-label {
  display: block;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--admin-text);
  margin-bottom: 8px;
}

.form-help {
  font-size: 0.8rem;
  color: var(--admin-muted);
  margin-top: 5px;
}

.form-control {
  width: 100%;
  padding: 10px 14px;
  border: 1px solid var(--admin-border);
  border-radius: 8px;
  font-size: 0.95rem;
  font-family: inherit;
  background: #ffffff;
  color: var(--admin-text);
  box-sizing: border-box;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.form-control:focus {
  outline: none;
  border-color: var(--admin-primary);
  box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.12);
}

textarea.form-control {
  min-height: 120px;
  resize: vertical;
}

.form-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 20px;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 9px 18px;
  border-radius: 8px;
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  border: none;
  transition: all 0.15s ease;
}

.btn-primary {
  background: linear-gradient(135deg, #4f46e5, #4338ca);
  color: #ffffff;
}
.btn-primary:hover {
  background: linear-gradient(135deg, #4338ca, #3730a3);
  box-shadow: 0 4px 12px rgba(79, 70, 229, 0.25);
}

.btn-success {
  background: #10b981;
  color: #ffffff;
}
.btn-success:hover { background: #059669; }

.btn-danger {
  background: #ef4444;
  color: #ffffff;
}
.btn-danger:hover { background: #dc2626; }

.btn-secondary {
  background: #f1f5f9;
  color: #334155;
  border: 1px solid var(--admin-border);
}
.btn-secondary:hover { background: #e2e8f0; }

.btn-ai {
  background: linear-gradient(135deg, #8b5cf6 0%, #d946ef 50%, #06b6d4 100%);
  color: #ffffff;
  font-weight: 700;
  box-shadow: 0 4px 14px rgba(139, 92, 246, 0.35);
}
.btn-ai:hover {
  opacity: 0.95;
  transform: translateY(-1px);
}

/* Dual-Mode Blog Editor Toggle */
.editor-mode-toggle {
  display: flex;
  background: #f1f5f9;
  border-radius: 8px;
  padding: 4px;
  gap: 4px;
  margin-bottom: 12px;
  width: fit-content;
}

.mode-tab-btn {
  padding: 6px 14px;
  border-radius: 6px;
  font-size: 0.8125rem;
  font-weight: 600;
  border: none;
  background: transparent;
  color: var(--admin-muted);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.mode-tab-btn.active {
  background: #ffffff;
  color: var(--admin-primary);
  box-shadow: 0 2px 5px rgba(0,0,0,0.06);
}

/* Rich Toolbar */
.rich-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  background: #f8fafc;
  border: 1px solid var(--admin-border);
  border-bottom: none;
  border-radius: 8px 8px 0 0;
  padding: 8px;
}

.rich-btn {
  padding: 6px 10px;
  border: 1px solid var(--admin-border);
  background: #ffffff;
  border-radius: 6px;
  cursor: pointer;
  font-size: 0.8rem;
  font-weight: 600;
  color: #334155;
}
.rich-btn:hover {
  background: #e2e8f0;
}

.rich-content-editable {
  min-height: 380px;
  padding: 18px;
  border: 1px solid var(--admin-border);
  border-radius: 0 0 8px 8px;
  background: #ffffff;
  line-height: 1.7;
  outline: none;
}
.rich-content-editable:focus {
  border-color: var(--admin-primary);
}

.html-raw-editor {
  min-height: 380px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.875rem;
  background: #0f172a;
  color: #e2e8f0;
  border: 1px solid #1e293b;
  border-radius: 8px;
  padding: 16px;
  width: 100%;
  box-sizing: border-box;
}

/* Alerts */
.admin-alert {
  padding: 14px 18px;
  border-radius: 8px;
  margin-bottom: 24px;
  font-size: 0.9rem;
  display: flex;
  align-items: center;
  gap: 12px;
}
.admin-alert-success {
  background: #ecfdf5;
  color: #065f46;
  border: 1px solid #a7f3d0;
}
.admin-alert-danger {
  background: #fef2f2;
  color: #991b1b;
  border: 1px solid #fecaca;
}
