/* Admin page only */
.admin-page {
  --container: 1500px; /* Widened container to eliminate scrolling on desktops */
}

.admin-page .page-title {
  padding-bottom: 32px;
}

.admin-title {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 22px;
}

.admin-current {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 260px;
  border: 1px solid rgba(125, 211, 252, 0.24);
  border-radius: var(--radius);
  background: rgba(2, 6, 23, 0.72);
  padding: 14px;
}

.admin-current > span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  border: 1px solid rgba(112, 245, 157, 0.34);
  border-radius: var(--radius);
  background: rgba(46, 232, 120, 0.15);
  color: #d0ffd8;
  font-size: 20px;
}

.admin-current strong,
.admin-current small {
  display: block;
}

.admin-current small {
  color: #bfdbfe;
  overflow-wrap: anywhere;
}

/* Stat Grid & Stat Cards Overhaul with Gorgeous Icons & Glows */
.admin-page .admin-stat-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 18px;
}

.admin-page .stat-card {
  display: flex;
  align-items: center;
  gap: 16px;
  min-height: 110px;
  padding: 18px;
  border-radius: var(--radius);
  background: linear-gradient(135deg, rgba(15, 23, 42, 0.95), rgba(8, 16, 29, 0.98));
  border: 1px solid rgba(125, 211, 252, 0.16);
  transition: all 0.28s cubic-bezier(0.4, 0, 0.2, 1);
}

.admin-page .stat-card:hover {
  transform: translateY(-4px);
  border-color: rgba(46, 232, 120, 0.45);
  box-shadow: var(--glow), 0 20px 40px rgba(0, 0, 0, 0.35);
}

.admin-page .stat-icon-box {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  border-radius: 12px;
  font-size: 20px;
  flex-shrink: 0;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

/* Individual premium glowing themes for stat cards */
.stat-icon-box.total-users {
  background: rgba(56, 189, 248, 0.15);
  color: #38bdf8;
  border-color: rgba(56, 189, 248, 0.3);
}
.stat-icon-box.learners {
  background: rgba(167, 139, 250, 0.15);
  color: #a78bfa;
  border-color: rgba(167, 139, 250, 0.3);
}
.stat-icon-box.admins {
  background: rgba(250, 204, 21, 0.15);
  color: #facc15;
  border-color: rgba(250, 204, 21, 0.3);
}
.stat-icon-box.active {
  background: rgba(46, 232, 120, 0.15);
  color: #2ee878;
  border-color: rgba(46, 232, 120, 0.3);
}
.stat-icon-box.locked {
  background: rgba(248, 113, 113, 0.15);
  color: #f87171;
  border-color: rgba(248, 113, 113, 0.3);
}
.stat-icon-box.new-today {
  background: rgba(232, 121, 249, 0.15);
  color: #e879f9;
  border-color: rgba(232, 121, 249, 0.3);
}

.admin-page .stat-content {
  display: flex;
  flex-direction: column;
}

.admin-page .stat-content span {
  font-size: 13px;
  color: var(--muted);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.admin-page .stat-content strong {
  font-size: 26px;
  font-weight: 800;
  color: #ffffff;
  line-height: 1.2;
}

.admin-page .section-muted {
  background:
    linear-gradient(135deg, rgba(46, 232, 120, 0.07), rgba(56, 189, 248, 0.1)),
    radial-gradient(circle at 18% 0%, rgba(112, 245, 157, 0.12), transparent 30%),
    #07111d;
}

.admin-page .section-heading {
  max-width: none;
}

/* Beautiful Admin Dynamic Filter Bar Styles */
.admin-filters-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 24px;
  background: linear-gradient(145deg, rgba(15, 23, 42, 0.65), rgba(8, 16, 29, 0.85));
  border: 1px solid rgba(125, 211, 252, 0.16);
  border-radius: var(--radius);
  padding: 16px 20px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.22);
}

.admin-filters-bar .search-box {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 1;
  min-width: 280px;
  max-width: 480px;
  background: rgba(2, 6, 23, 0.6);
  border: 1px solid rgba(125, 211, 252, 0.2);
  border-radius: var(--radius);
  padding: 8px 14px;
  transition: all 0.2s ease;
}

.admin-filters-bar .search-box:focus-within {
  border-color: rgba(46, 232, 120, 0.5);
  box-shadow: 0 0 12px rgba(46, 232, 120, 0.15);
  background: rgba(2, 6, 23, 0.8);
}

.admin-filters-bar .search-box input {
  width: 100%;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--text);
  font-size: 14px;
}

.admin-filters-bar .search-box input::placeholder {
  color: rgba(148, 163, 184, 0.7);
}

.admin-filters-bar .search-box .search-icon {
  color: rgba(148, 163, 184, 0.7);
  font-size: 16px;
}

.admin-filters-bar .filter-group {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.admin-filters-bar .select-wrapper {
  position: relative;
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(2, 6, 23, 0.6);
  border: 1px solid rgba(125, 211, 252, 0.2);
  border-radius: var(--radius);
  padding: 8px 14px;
  transition: all 0.2s ease;
}

.admin-filters-bar .select-wrapper:hover {
  border-color: rgba(56, 189, 248, 0.4);
}

.admin-filters-bar .select-wrapper .select-icon {
  color: rgba(148, 163, 184, 0.7);
  font-size: 14px;
}

.admin-filters-bar .select-wrapper select {
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--text);
  font-size: 14px;
  cursor: pointer;
  padding-right: 10px;
}

.admin-filters-bar .select-wrapper select option {
  background: #0b1220;
  color: var(--text);
}

/* Users Table Overhaul & Scrolling Elimination */
.admin-users-card {
  overflow: auto hidden;
  padding: 0;
  border-color: rgba(112, 245, 157, 0.28);
  background:
    linear-gradient(180deg, rgba(15, 23, 42, 0.98), rgba(6, 13, 25, 0.98));
  box-shadow:
    0 0 0 1px rgba(46, 232, 120, 0.08),
    0 28px 78px rgba(0, 0, 0, 0.44);
  scrollbar-color: rgba(112, 245, 157, 0.72) rgba(148, 163, 184, 0.16);
  scrollbar-width: thin;
}

.admin-users-card::-webkit-scrollbar {
  height: 8px; /* Slightly thinner scrollbar */
}

.admin-users-card::-webkit-scrollbar-track {
  background: rgba(148, 163, 184, 0.14);
  border-radius: 999px;
  margin: 0 14px;
}

.admin-users-card::-webkit-scrollbar-thumb {
  border: 2px solid rgba(6, 13, 25, 0.96);
  border-radius: 999px;
  background: linear-gradient(90deg, rgba(112, 245, 157, 0.9), rgba(56, 189, 248, 0.9));
}

.admin-users-card table {
  width: 100%;
  min-width: 1100px; /* Reduced min-width so table fits perfectly on desktop containers */
  table-layout: fixed;
}

.admin-users-card th,
.admin-users-card td {
  padding: 16px 14px;
}

.admin-users-card th {
  position: sticky;
  top: 0;
  z-index: 2;
  background: rgba(10, 18, 32, 0.98);
  color: #d7ecff;
}

/* Dynamic & optimized column sizing */
.admin-users-card th:nth-child(1),
.admin-users-card td:nth-child(1) {
  width: 180px; /* Name */
}

.admin-users-card th:nth-child(2),
.admin-users-card td:nth-child(2) {
  width: 190px; /* Email */
}

.admin-users-card th:nth-child(3),
.admin-users-card td:nth-child(3) {
  width: 85px; /* Role */
}

.admin-users-card th:nth-child(4),
.admin-users-card td:nth-child(4) {
  width: 65px; /* Level */
}

.admin-users-card th:nth-child(5),
.admin-users-card td:nth-child(5) {
  width: 140px; /* Goal */
}

.admin-users-card th:nth-child(6),
.admin-users-card td:nth-child(6) {
  width: 95px; /* Status */
}

.admin-users-card th:nth-child(7),
.admin-users-card td:nth-child(7),
.admin-users-card th:nth-child(8),
.admin-users-card td:nth-child(8) {
  width: 125px; /* Created & Last login */
}

.admin-users-card th:nth-child(9),
.admin-users-card td:nth-child(9) {
  position: sticky;
  right: 0;
  z-index: 1;
  width: 170px; /* Actions */
  border-left: 1px solid rgba(125, 211, 252, 0.16);
  background: linear-gradient(90deg, rgba(8, 16, 29, 0.86), rgba(7, 15, 28, 0.99) 18%);
}

.admin-users-card th:nth-child(9) {
  z-index: 3;
  background: linear-gradient(90deg, rgba(10, 18, 32, 0.9), rgba(10, 18, 32, 1) 18%);
}

.admin-users-card td {
  vertical-align: middle;
  color: #eef7ff;
  overflow-wrap: anywhere;
}

.admin-users-card tbody tr {
  transition: background 0.18s ease, box-shadow 0.18s ease;
}

.admin-users-card tbody tr:hover {
  background: rgba(46, 232, 120, 0.055);
  box-shadow: inset 3px 0 0 rgba(112, 245, 157, 0.7);
}

.admin-user-cell {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.admin-user-cell strong {
  display: inline-block;
  max-width: 110px;
  overflow: hidden;
  text-overflow: ellipsis;
  vertical-align: middle;
  white-space: nowrap;
}

.table-avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  width: 34px;
  height: 34px;
  flex: 0 0 34px;
  border: 1px solid rgba(112, 245, 157, 0.38);
  border-radius: 999px;
  background:
    linear-gradient(135deg, rgba(46, 232, 120, 0.26), rgba(56, 189, 248, 0.18)),
    rgba(2, 6, 23, 0.86);
  color: #eafff0;
  font-size: 12px;
  font-weight: 900;
}

.table-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.mini-badge,
.role-pill,
.status-pill,
.admin-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius);
  font-weight: 900;
  white-space: nowrap;
}

.mini-badge {
  margin-left: 8px;
  border: 1px solid rgba(125, 211, 252, 0.22);
  color: #bfdbfe;
  font-size: 11px;
  padding: 2px 7px;
}

.role-pill,
.status-pill {
  min-height: 28px;
  border: 1px solid rgba(125, 211, 252, 0.24);
  background: rgba(2, 6, 23, 0.72);
  color: #dbeafe;
  font-size: 12px;
  padding: 4px 9px;
}

.role-pill.is-admin {
  border-color: rgba(250, 204, 21, 0.38);
  background: rgba(250, 204, 21, 0.1);
  color: #fde68a;
}

.status-pill.is-active {
  border-color: rgba(112, 245, 157, 0.38);
  background: rgba(46, 232, 120, 0.12);
  color: #bbf7d0;
}

.status-pill.is-locked {
  border-color: rgba(248, 113, 113, 0.38);
  background: rgba(248, 113, 113, 0.1);
  color: #fecaca;
}

.table-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  min-width: 142px;
}

/* Refined Premium User Action Buttons with Semantic Hover States */
.admin-action {
  min-height: 32px;
  border: 1px solid rgba(125, 211, 252, 0.24);
  background: rgba(15, 23, 42, 0.88);
  color: #e6f6ff;
  cursor: pointer;
  font-size: 12px;
  gap: 6px;
  padding: 5px 8px;
  border-radius: 6px;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.admin-action span {
  font-size: 11px;
}

.admin-action:hover:not(:disabled) {
  transform: translateY(-1px);
  border-color: rgba(112, 245, 157, 0.55);
  box-shadow: var(--glow);
}

/* Success Actions (Unlock, Make Admin) */
.admin-action.success:hover:not(:disabled) {
  background: rgba(46, 232, 120, 0.12);
  border-color: rgba(46, 232, 120, 0.5);
  box-shadow: 0 0 12px rgba(46, 232, 120, 0.2);
  color: #bbf7d0;
}

/* Warning Actions (Lock, Make User) */
.admin-action.warning:hover:not(:disabled) {
  background: rgba(250, 204, 21, 0.1);
  border-color: rgba(250, 204, 21, 0.5);
  box-shadow: 0 0 12px rgba(250, 204, 21, 0.15);
  color: #fde68a;
}

/* Danger Action (Delete) */
.admin-action.danger {
  border-color: rgba(248, 113, 113, 0.28);
  color: #fecaca;
}

.admin-action.danger:hover:not(:disabled) {
  background: rgba(248, 113, 113, 0.15);
  border-color: rgba(248, 113, 113, 0.6);
  box-shadow: 0 0 12px rgba(248, 113, 113, 0.2);
  color: #ff8a8a;
}

.admin-action:disabled {
  cursor: not-allowed;
  opacity: 0.45;
}

.admin-note-grid .feature-card {
  min-height: 170px;
}

.admin-page .stat-card:hover,
.admin-page .table-card:hover {
  border-color: rgba(74, 222, 128, 0.58);
  box-shadow: var(--glow), 0 26px 70px rgba(0, 0, 0, 0.42);
}

/* Responsive Overhaul for various screen sizes */
@media (max-width: 1400px) {
  .admin-page .admin-stat-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr)); /* Wraps to 3 columns on smaller monitors */
  }
}

@media (max-width: 980px) {
  .admin-title {
    align-items: flex-start;
    flex-direction: column;
  }

  .admin-page .admin-stat-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr)); /* Wraps to 2 columns on tablets */
  }
}

@media (max-width: 680px) {
  .admin-page .admin-stat-grid {
    grid-template-columns: 1fr; /* 1 column on phones */
  }

  .admin-current {
    width: 100%;
    min-width: 0;
  }
  
  .admin-filters-bar {
    padding: 12px;
  }
}

/* ==========================================================================
   Admin Blog Approval Table Overhaul (Pullup Hover & Scrollbar Elimination)
   ========================================================================== */
.admin-blog-card {
  overflow: visible !important; /* Allow the popup to hover outside the card */
  padding: 0;
  border-color: rgba(112, 245, 157, 0.28);
  background: linear-gradient(180deg, rgba(15, 23, 42, 0.98), rgba(6, 13, 25, 0.98));
  box-shadow: 0 0 0 1px rgba(46, 232, 120, 0.08), 0 28px 78px rgba(0, 0, 0, 0.44);
}

.admin-blog-card table {
  width: 100%;
  min-width: auto; /* Fit container perfectly to avoid scrollbar */
  table-layout: fixed;
  border-collapse: collapse;
}

.admin-blog-card th,
.admin-blog-card td {
  padding: 16px 14px;
}

.admin-blog-card th {
  background: rgba(10, 18, 32, 0.98);
  color: #d7ecff;
}

.admin-blog-card tbody tr {
  transition: background 0.18s ease;
}

.admin-blog-card tbody tr:hover {
  background: rgba(46, 232, 120, 0.04);
}

/* Hover Pullup content style */
.admin-blog-content-cell {
  position: relative;
}

.admin-blog-content-cell .content-preview {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 280px; /* Truncated preview */
  color: #a6b4c9;
  cursor: help;
  transition: color 0.2s ease;
}

.admin-blog-content-cell:hover .content-preview {
  color: var(--primary);
}

.admin-blog-content-cell .content-full-popup {
  display: block;
  visibility: hidden;
  opacity: 0;
  position: absolute;
  bottom: 80%;
  left: 30px;
  width: 340px;
  background: linear-gradient(135deg, #0f172a 0%, #090f1d 100%);
  border: 1px solid rgba(46, 232, 120, 0.5);
  border-radius: 8px;
  padding: 14px 16px;
  box-shadow: 
    0 12px 32px rgba(0, 0, 0, 0.7),
    0 0 20px rgba(46, 232, 120, 0.25);
  color: #f8fbff;
  font-size: 13.5px;
  line-height: 1.6;
  z-index: 999;
  pointer-events: none;
  transform: translateY(10px) scale(0.95);
  transition: all 0.24s cubic-bezier(0.34, 1.56, 0.64, 1);
  white-space: normal;
  text-align: left;
}

.admin-blog-content-cell:hover .content-full-popup {
  visibility: visible;
  opacity: 1;
  pointer-events: auto;
  transform: translateY(-8px) scale(1);
}

/* Little arrow for the popup speech bubble */
.admin-blog-content-cell .content-full-popup::after {
  content: "";
  position: absolute;
  top: 100%;
  left: 40px;
  border-width: 8px;
  border-style: solid;
  border-color: rgba(46, 232, 120, 0.5) transparent transparent transparent;
}

/* Learning content admin */
.admin-content-toolbar {
  display: grid;
  grid-template-columns: auto minmax(260px, 1fr) auto;
  gap: 14px;
  align-items: center;
  margin-bottom: 18px;
}

.admin-content-tabs,
.admin-content-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.admin-content-tab {
  min-height: 38px;
  border: 1px solid rgba(125, 211, 252, 0.22);
  border-radius: 7px;
  background: rgba(2, 6, 23, 0.72);
  color: #dbeafe;
  cursor: pointer;
  font-weight: 900;
  padding: 8px 14px;
}

.admin-content-tab.is-active {
  border-color: rgba(112, 245, 157, 0.58);
  background: linear-gradient(135deg, rgba(46, 232, 120, 0.28), rgba(56, 189, 248, 0.2));
  color: #ffffff;
}

.admin-content-search {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 42px;
  border: 1px solid rgba(125, 211, 252, 0.2);
  border-radius: var(--radius);
  background: rgba(2, 6, 23, 0.62);
  padding: 0 14px;
}

.admin-content-search input {
  width: 100%;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--text);
}

.admin-content-layout {
  display: grid;
  grid-template-columns: minmax(280px, 390px) minmax(0, 1fr);
  gap: 18px;
  align-items: start;
}

.admin-content-list,
.admin-content-editor {
  border: 1px solid rgba(125, 211, 252, 0.18);
  border-radius: var(--radius);
  background: rgba(6, 13, 25, 0.88);
  box-shadow: 0 22px 60px rgba(0, 0, 0, 0.28);
}

.admin-content-list {
  overflow: auto;
  max-height: 760px;
  padding: 10px;
}

.admin-content-item {
  width: 100%;
  border: 1px solid rgba(125, 211, 252, 0.14);
  border-radius: 7px;
  background: rgba(15, 23, 42, 0.78);
  color: #eff6ff;
  cursor: pointer;
  margin-bottom: 8px;
  padding: 12px;
  text-align: left;
}

.admin-content-item:hover,
.admin-content-item.is-active {
  border-color: rgba(112, 245, 157, 0.52);
  box-shadow: inset 3px 0 0 rgba(112, 245, 157, 0.72);
}

.admin-content-item strong,
.admin-content-item small {
  display: block;
}

.admin-content-item small {
  color: var(--muted);
  margin-top: 5px;
  overflow-wrap: anywhere;
}

.admin-content-item-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
}

.admin-content-item-meta span {
  border: 1px solid rgba(125, 211, 252, 0.18);
  border-radius: 999px;
  color: #bfdbfe;
  font-size: 11px;
  font-weight: 800;
  padding: 3px 8px;
}

.admin-content-empty {
  color: var(--muted);
  margin: 0;
  padding: 18px;
  text-align: center;
}

.admin-content-editor {
  display: grid;
  gap: 14px;
  padding: 18px;
}

.admin-content-editor-head {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  align-items: flex-start;
}

.admin-content-editor h3 {
  margin: 0;
}

.admin-content-editor label,
.admin-content-editor label span {
  display: grid;
  gap: 7px;
}

.admin-content-editor label span {
  color: #c7d2fe;
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

.admin-content-editor input,
.admin-content-editor select,
.admin-content-editor textarea {
  width: 100%;
  border: 1px solid rgba(125, 211, 252, 0.2);
  border-radius: 7px;
  outline: 0;
  background: rgba(2, 6, 23, 0.72);
  color: var(--text);
  padding: 10px 12px;
}

.admin-content-editor textarea {
  resize: vertical;
}

.admin-content-json {
  min-height: 360px;
  font-family: Consolas, "Courier New", monospace;
  font-size: 13px;
  line-height: 1.5;
}

.admin-content-form-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.admin-content-editor-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

@media (max-width: 980px) {
  .admin-content-toolbar,
  .admin-content-layout {
    grid-template-columns: 1fr;
  }

  .admin-content-form-grid {
    grid-template-columns: 1fr;
  }
}

