/* Modern Admin Dashboard Styles for Edission India */
@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@300;400;500;600;700;800&display=swap');

:root {
  --admin-primary: #ff5722;
  --admin-primary-dark: #e64a19;
  --admin-primary-light: #ff8a65;
  --admin-secondary: #1e293b;
  --admin-dark: #0f172a;
  --admin-sidebar-bg: #111827;
  --admin-sidebar-hover: #1f2937;
  --admin-bg: #f8fafc;
  --admin-card-bg: #ffffff;
  --admin-border: #e2e8f0;
  --admin-text-main: #1e293b;
  --admin-text-muted: #64748b;
  --admin-success: #10b981;
  --admin-warning: #f59e0b;
  --admin-danger: #ef4444;
  --admin-info: #3b82f6;
  --sidebar-width: 260px;
}

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

/* Layout */
.admin-wrapper {
  display: flex;
  min-height: 100vh;
}

/* Sidebar */
.admin-sidebar {
  width: var(--sidebar-width);
  background: var(--admin-sidebar-bg);
  color: #fff;
  flex-shrink: 0;
  position: fixed;
  top: 0;
  bottom: 0;
  left: 0;
  z-index: 1040;
  display: flex;
  flex-direction: column;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 4px 0 24px rgba(0, 0, 0, 0.12);
  overflow-y: auto;
}

.admin-sidebar-brand {
  padding: 24px 20px;
  display: flex;
  align-items: center;
  gap: 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(0, 0, 0, 0.2);
}

.admin-sidebar-brand img {
  max-height: 38px;
  filter: brightness(0) invert(1);
}

.admin-sidebar-brand h5 {
  margin: 0;
  font-size: 1.15rem;
  font-weight: 700;
  letter-spacing: -0.3px;
  color: #fff;
}

.admin-sidebar-brand span {
  color: var(--admin-primary);
  font-weight: 800;
}

.sidebar-menu {
  list-style: none;
  padding: 16px 12px;
  margin: 0;
  flex-grow: 1;
}

.sidebar-heading {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: #94a3b8;
  padding: 14px 12px 6px;
  font-weight: 700;
}

.sidebar-menu li a {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 10px 14px;
  color: #cbd5e1;
  text-decoration: none;
  font-size: 0.92rem;
  font-weight: 500;
  border-radius: 8px;
  transition: all 0.2s ease;
  margin-bottom: 4px;
}

.sidebar-menu li a i {
  font-size: 1.1rem;
  width: 22px;
  text-align: center;
  color: #94a3b8;
  transition: color 0.2s;
}

.sidebar-menu li a:hover {
  background: var(--admin-sidebar-hover);
  color: #fff;
  transform: translateX(3px);
}

.sidebar-menu li a:hover i {
  color: var(--admin-primary);
}

.sidebar-menu li a.active {
  background: linear-gradient(135deg, var(--admin-primary), var(--admin-primary-dark));
  color: #fff;
  font-weight: 600;
  box-shadow: 0 4px 12px rgba(255, 87, 34, 0.35);
}

.sidebar-menu li a.active i {
  color: #fff;
}

/* Main Content */
.admin-main {
  margin-left: var(--sidebar-width);
  flex-grow: 1;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  transition: margin-left 0.3s ease;
}

/* Navbar */
.admin-navbar {
  height: 70px;
  background: #fff;
  border-bottom: 1px solid var(--admin-border);
  padding: 0 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 1020;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.03);
}

.admin-body {
  padding: 28px;
  flex-grow: 1;
}

/* Stat Cards */
.stat-card {
  background: #fff;
  border-radius: 14px;
  padding: 24px;
  border: 1px solid var(--admin-border);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.03);
  transition: all 0.25s ease;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.stat-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.06);
}

.stat-card .stat-icon {
  width: 54px;
  height: 54px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
}

.stat-icon.orange {
  background: rgba(255, 87, 34, 0.12);
  color: var(--admin-primary);
}

.stat-icon.blue {
  background: rgba(59, 130, 246, 0.12);
  color: var(--admin-info);
}

.stat-icon.green {
  background: rgba(16, 185, 129, 0.12);
  color: var(--admin-success);
}

.stat-icon.purple {
  background: rgba(168, 85, 247, 0.12);
  color: #a855f7;
}

.stat-card .stat-info h3 {
  font-size: 1.75rem;
  font-weight: 700;
  margin: 0;
  color: var(--admin-dark);
}

.stat-card .stat-info p {
  margin: 4px 0 0;
  color: var(--admin-text-muted);
  font-size: 0.88rem;
  font-weight: 500;
}

/* Card General */
.admin-card {
  background: #fff;
  border-radius: 14px;
  border: 1px solid var(--admin-border);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.03);
  overflow: hidden;
  margin-bottom: 24px;
}

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

.admin-card-header h5 {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--admin-dark);
}

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

/* Tables */
.table-custom {
  margin-bottom: 0;
}

.table-custom thead th {
  background-color: #f8fafc;
  color: #475569;
  font-weight: 600;
  font-size: 0.82rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  border-bottom: 1px solid var(--admin-border);
  padding: 14px 18px;
}

.table-custom tbody td {
  padding: 14px 18px;
  vertical-align: middle;
  border-bottom: 1px solid #f1f5f9;
  font-size: 0.9rem;
}

.table-custom tbody tr:hover {
  background-color: #f8fafc;
}

/* Thumbnails */
.table-img {
  width: 50px;
  height: 50px;
  object-fit: cover;
  border-radius: 8px;
  background: #f1f5f9;
  border: 1px solid #e2e8f0;
}

/* Buttons */
.btn-primary-custom {
  background: var(--admin-primary);
  border: 1px solid var(--admin-primary);
  color: #fff;
  font-weight: 600;
  padding: 9px 18px;
  border-radius: 8px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  transition: all 0.2s ease;
}

.btn-primary-custom:hover {
  background: var(--admin-primary-dark);
  border-color: var(--admin-primary-dark);
  color: #fff;
  box-shadow: 0 4px 12px rgba(255, 87, 34, 0.3);
}

.btn-outline-custom {
  border: 1px solid var(--admin-border);
  background: #fff;
  color: var(--admin-text-main);
  font-weight: 600;
  padding: 8px 16px;
  border-radius: 8px;
  transition: all 0.2s ease;
}

.btn-outline-custom:hover {
  background: #f1f5f9;
  color: var(--admin-dark);
}

/* Badges */
.badge-status {
  padding: 6px 12px;
  border-radius: 30px;
  font-weight: 600;
  font-size: 0.78rem;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.badge-active {
  background: rgba(16, 185, 129, 0.12);
  color: #059669;
}

.badge-inactive {
  background: rgba(100, 116, 139, 0.12);
  color: #64748b;
}

.badge-featured {
  background: rgba(245, 158, 11, 0.15);
  color: #d97706;
}

/* Forms */
.form-label {
  font-weight: 600;
  font-size: 0.88rem;
  color: var(--admin-dark);
  margin-bottom: 6px;
}

.form-control, .form-select {
  border-radius: 8px;
  border: 1px solid var(--admin-border);
  padding: 10px 14px;
  font-size: 0.92rem;
  transition: all 0.2s;
}

.form-control:focus, .form-select:focus {
  border-color: var(--admin-primary);
  box-shadow: 0 0 0 3px rgba(255, 87, 34, 0.15);
}

/* Login Page */
.login-body {
  background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
}

.login-card {
  width: 100%;
  max-width: 440px;
  background: #ffffff;
  border-radius: 16px;
  padding: 40px;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.25);
}

.login-brand {
  text-align: center;
  margin-bottom: 28px;
}

.login-brand img {
  max-height: 48px;
}

/* Image preview container */
.img-preview-box {
  width: 120px;
  height: 120px;
  border-radius: 10px;
  border: 2px dashed var(--admin-border);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  background: #f8fafc;
  margin-top: 10px;
}

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

/* Responsive */
@media (max-width: 992px) {
  .admin-sidebar {
    left: calc(var(--sidebar-width) * -1);
  }
  .admin-sidebar.show {
    left: 0;
  }
  .admin-main {
    margin-left: 0;
  }
}

/* ==========================================================================
   Tiptap Rich Text Editor & ProseMirror Styling (Celestial Reference)
   ========================================================================== */
.tiptap-container {
  border: 1px solid var(--admin-border);
  border-radius: 12px;
  overflow: hidden;
  background: #ffffff;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
  transition: all 0.2s ease;
  display: flex;
  flex-direction: column;
  position: relative;
}

/* Seamless integration when nested in admin-card */
.admin-card .tiptap-container {
  border: none;
  border-radius: 0;
  box-shadow: none;
}

.tiptap-container:focus-within {
  border-color: var(--admin-primary);
  box-shadow: 0 0 0 3px rgba(255, 87, 34, 0.15);
}

.tiptap-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  padding: 10px 14px;
  background: #f8fafc;
  border-bottom: 1px solid #e2e8f0;
  position: relative;
  z-index: 5;
  flex-shrink: 0;
  width: 100%;
}

.tiptap-divider {
  display: inline-block;
  width: 1px;
  height: 22px;
  background: #cbd5e1;
  margin: 0 4px;
  align-self: center;
}

.tiptap-btn {
  background: #ffffff;
  border: 1px solid #cbd5e1;
  color: #334155;
  padding: 6px 10px;
  border-radius: 6px;
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.18s ease;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  line-height: 1.2;
}

.tiptap-btn:hover {
  background: #f1f5f9;
  border-color: #94a3b8;
  color: #0f172a;
  transform: translateY(-1px);
}

.tiptap-btn.is-active {
  background: linear-gradient(135deg, #ff5722 0%, #e64a19 100%) !important;
  color: #ffffff !important;
  border-color: #e64a19 !important;
  box-shadow: 0 2px 8px rgba(255, 87, 34, 0.3) !important;
}

.tiptap-btn.is-active i {
  color: #ffffff !important;
}

.tiptap-editor {
  background: #ffffff;
  min-height: 400px;
  padding: 24px;
  outline: none;
  position: relative;
  flex-grow: 1;
}

.tiptap-footer-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 16px;
  background: #f8fafc;
  border-top: 1px solid #e2e8f0;
  font-size: 0.78rem;
  color: #64748b;
  flex-shrink: 0;
}

/* Fullscreen Mode */
.tiptap-container.fullscreen {
  position: fixed !important;
  inset: 0 !important;
  z-index: 10500 !important;
  border-radius: 0 !important;
  height: 100vh !important;
  width: 100vw !important;
  display: flex !important;
  flex-direction: column !important;
  background: #ffffff !important;
}

.tiptap-container.fullscreen .tiptap-toolbar {
  position: sticky !important;
  top: 0 !important;
  z-index: 10 !important;
}

.tiptap-container.fullscreen .tiptap-editor {
  flex: 1 !important;
  overflow-y: auto !important;
  height: calc(100vh - 100px) !important;
}

/* ProseMirror Typography & Document Formatting */
.ProseMirror {
  outline: none;
  min-height: 360px;
  font-size: 1.02rem;
  line-height: 1.75;
  color: #1e293b;
}

.ProseMirror > *:first-child {
  margin-top: 0 !important;
}

.ProseMirror p {
  margin-bottom: 1.25rem;
}

.ProseMirror p.is-editor-empty:first-child::before {
  content: attr(data-placeholder);
  float: left;
  color: #94a3b8;
  pointer-events: none;
  height: 0;
}

.ProseMirror h1,
.ProseMirror h2,
.ProseMirror h3,
.ProseMirror h4 {
  font-family: inherit;
  color: #0f172a !important;
  line-height: 1.35 !important;
}

.ProseMirror h1 {
  font-size: 1.85rem !important;
  font-weight: 800 !important;
  margin-top: 2rem !important;
  margin-bottom: 0.85rem !important;
  letter-spacing: -0.01em;
}

.ProseMirror h2 {
  font-size: 1.45rem !important;
  font-weight: 700 !important;
  margin-top: 1.75rem !important;
  margin-bottom: 0.75rem !important;
  border-bottom: 2px solid #f1f5f9;
  padding-bottom: 6px;
}

.ProseMirror h3 {
  font-size: 1.25rem !important;
  font-weight: 600 !important;
  color: #1e293b !important;
  margin-top: 1.4rem !important;
  margin-bottom: 0.6rem !important;
}

.ProseMirror h4 {
  font-size: 1.1rem !important;
  font-weight: 600 !important;
  color: #334155 !important;
  margin-top: 1.2rem !important;
  margin-bottom: 0.5rem !important;
}

.ProseMirror a {
  color: #ff5722 !important;
  text-decoration: underline !important;
  text-underline-offset: 3px;
  font-weight: 600;
  cursor: pointer;
}

.ProseMirror a:hover {
  color: #d84315 !important;
}

.ProseMirror u {
  text-decoration: underline;
}

.ProseMirror ul,
.ProseMirror ol {
  padding-left: 1.75rem;
  margin-bottom: 1.25rem;
}

.ProseMirror li {
  margin-bottom: 0.4rem;
}

.ProseMirror hr {
  border: 0;
  height: 1px;
  background: #e2e8f0;
  margin: 1.75rem 0;
}

.ProseMirror blockquote {
  border-left: 4px solid var(--admin-primary);
  padding: 12px 18px;
  margin: 1.5rem 0;
  font-style: italic;
  color: #475569;
  background: #f8fafc;
  border-radius: 0 8px 8px 0;
}

.ProseMirror table {
  border-collapse: collapse;
  table-layout: fixed;
  width: 100%;
  margin: 1.5rem 0;
  overflow: hidden;
  border-radius: 8px;
}

.ProseMirror table td,
.ProseMirror table th {
  min-width: 1em;
  border: 1px solid #cbd5e1;
  padding: 10px 14px;
  vertical-align: top;
  box-sizing: border-box;
  position: relative;
}

.ProseMirror table th {
  font-weight: 700;
  text-align: left;
  background-color: #f1f5f9;
  color: #0f172a;
}

.ProseMirror img {
  max-width: 100%;
  height: auto;
  border-radius: 10px;
  display: inline-block;
  margin: 1rem auto;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
  cursor: pointer;
  transition: outline 0.15s ease, transform 0.15s ease;
}

.ProseMirror img:hover {
  outline: 3px solid rgba(253, 143, 20, 0.65);
}

.ProseMirror img.tiptap-selected-img {
  outline: 3px solid #ff5722 !important;
  box-shadow: 0 0 16px rgba(255, 87, 34, 0.45) !important;
}

/* Image alignment classes */
.ProseMirror img.img-align-left,
.img-align-left {
  float: left !important;
  margin: 10px 20px 15px 0 !important;
  display: block !important;
}

.ProseMirror img.img-align-right,
.img-align-right {
  float: right !important;
  margin: 10px 0 15px 20px !important;
  display: block !important;
}

.ProseMirror img.img-align-center,
.img-align-center {
  float: none !important;
  display: block !important;
  margin: 20px auto !important;
}

.ProseMirror img.img-align-full,
.img-align-full {
  float: none !important;
  display: block !important;
  width: 100% !important;
  margin: 20px auto !important;
}

/* Floating Image Bubble Toolbar */
.tiptap-image-toolbar {
  position: absolute;
  z-index: 10040;
  background: #0f172a;
  color: #ffffff;
  padding: 6px 10px;
  border-radius: 10px;
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.35);
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  border: 1px solid rgba(255, 255, 255, 0.15);
  animation: tiptapFadeIn 0.15s ease-out;
}

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

.tiptap-image-toolbar .btn-group {
  box-shadow: none;
}

.tiptap-image-toolbar .btn {
  padding: 4px 8px;
  font-size: 0.78rem;
  font-weight: 500;
  border-radius: 4px;
}

/* Article Images Sidebar Item */
.article-img-row {
  transition: background 0.15s ease, border-color 0.15s ease;
}
.article-img-row:hover {
  background: #f1f5f9 !important;
  border-color: #cbd5e1 !important;
}

.article-dropzone {
  border: 2px dashed #cbd5e1;
  background: #f8fafc;
  transition: all 0.2s ease;
  cursor: pointer;
}
.article-dropzone:hover,
.article-dropzone.dragover {
  border-color: #ff5722 !important;
  background: rgba(255, 87, 34, 0.05) !important;
}

