/* ==========================================================================
   ImagePrompt — Admin Panel Stylesheet
   ========================================================================== */

.admin-layout {
  display: flex !important;
  flex-direction: row !important;
  min-height: 100vh;
  width: 100%;
  background: var(--bg-primary);
  color: var(--text-primary);
  overflow-x: hidden;
}

/* ==========================================================================
   Admin Sidebar
   ========================================================================== */
.admin-sidebar {
  width: 270px;
  min-width: 270px;
  max-width: 270px;
  flex-shrink: 0;
  background: #FFFFFF;
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
  z-index: 1000;
  transition: transform 0.28s var(--ease-spring);
}

.sidebar-header {
  height: 72px;
  padding: 0 1.5rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  border-bottom: 1px solid var(--border);
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--text-primary);
}

.sidebar-brand span {
  font-size: 0.68rem;
  padding: 0.2rem 0.5rem;
  background: #F3F4FF;
  color: var(--accent);
  border-radius: var(--radius-xs);
  margin-left: 0.35rem;
  text-transform: uppercase;
  font-weight: 800;
  letter-spacing: 0.05em;
  border: 1px solid rgba(91, 92, 226, 0.2);
}

.sidebar-nav {
  flex: 1;
  padding: 1.25rem 0.85rem;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  overflow-y: auto;
}

.nav-section-title {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  padding: 0.85rem 0.75rem 0.4rem;
}

.sidebar-link {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.65rem 0.85rem;
  border-radius: var(--radius-md);
  color: var(--text-secondary);
  font-size: 0.88rem;
  font-weight: 600;
  transition: all var(--duration-fast) ease;
}

.sidebar-link svg {
  width: 17px;
  height: 17px;
  stroke: currentColor;
  flex-shrink: 0;
}

.sidebar-link:hover {
  background: #F8F9FC;
  color: var(--text-primary);
}

.sidebar-link.active {
  background: #F3F4FF;
  color: var(--accent);
  border: 1px solid rgba(91, 92, 226, 0.2);
}

.sidebar-link .badge-count {
  margin-left: auto;
  padding: 0.15rem 0.55rem;
  border-radius: var(--radius-full);
  font-size: 0.75rem;
  font-weight: 700;
}

.sidebar-footer {
  padding: 1rem 1.25rem;
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #FFFFFF;
}

/* ==========================================================================
   Admin Content & Topbar
   ========================================================================== */
.admin-main {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.admin-topbar {
  height: 72px;
  padding: 0 2rem;
  border-bottom: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 900;
}

.admin-topbar-title {
  font-size: 1.25rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--text-primary);
}

.admin-topbar-actions {
  display: flex;
  align-items: center;
  gap: 0.85rem;
}

.admin-container {
  padding: 2.25rem 2rem 4rem;
  max-width: 1400px;
  width: 100%;
  margin: 0 auto;
}

/* ==========================================================================
   Dashboard Stat Cards
   ========================================================================== */
/* ==========================================================================
   Dashboard Stat Cards
   ========================================================================== */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
  gap: 1.25rem;
  margin-bottom: 2.5rem;
}

.stat-card {
  background: #FFFFFF;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.35rem 1.5rem;
  display: flex;
  align-items: center;
  gap: 1.25rem;
  transition: transform var(--duration-fast) ease, border-color var(--duration-fast) ease, box-shadow var(--duration-fast) ease;
  box-shadow: var(--shadow-sm);
}

.stat-card:hover {
  transform: translateY(-3px);
  border-color: rgba(91, 92, 226, 0.3);
  box-shadow: var(--shadow-md);
}

.stat-icon-wrap {
  width: 50px;
  height: 50px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  background: #F3F4FF;
  color: var(--accent);
}

.stat-val {
  font-size: 1.85rem;
  font-weight: 800;
  line-height: 1.1;
  color: var(--text-primary);
  letter-spacing: -0.02em;
}

.stat-label {
  font-size: 0.8rem;
  color: var(--text-muted);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-top: 0.25rem;
}

/* ==========================================================================
   Admin Tables & Cards
   ========================================================================== */
.admin-card {
  background: #FFFFFF;
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  overflow: hidden;
  box-shadow: var(--shadow-card);
  margin-bottom: 2.25rem;
}

.admin-card-header {
  padding: 1.35rem 1.75rem;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1.25rem;
  background: #FFFFFF;
}

.admin-card-title {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text-primary);
}

.admin-filter-tabs {
  display: flex;
  gap: 0.4rem;
  background: #F2F4F7;
  padding: 0.3rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  overflow-x: auto;
}

.admin-tab-btn {
  padding: 0.4rem 0.95rem;
  font-size: 0.82rem;
  font-weight: 600;
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  transition: all var(--duration-fast) ease;
  white-space: nowrap;
}

.admin-tab-btn:hover {
  color: var(--text-primary);
}

.admin-tab-btn.active {
  background: var(--accent-gradient);
  color: #ffffff;
  box-shadow: 0 2px 8px rgba(91, 92, 226, 0.25);
}

/* Data Table */
.data-table-wrap {
  overflow-x: auto;
  width: 100%;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 0.88rem;
}

.data-table th {
  padding: 0.95rem 1.35rem;
  background: #F9FAFB;
  font-weight: 700;
  color: var(--text-muted);
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}

.data-table td {
  padding: 1.1rem 1.35rem;
  border-bottom: 1px solid var(--border);
  color: var(--text-secondary);
  vertical-align: middle;
}

.data-table tr:hover td {
  background: #F8F9FC;
  color: var(--text-primary);
}

.table-thumb {
  width: 54px;
  height: 54px;
  border-radius: var(--radius-md);
  object-fit: cover;
  background: #F2F4F7;
  border: 1px solid var(--border);
}

/* Status Badges */
.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.28rem 0.7rem;
  border-radius: var(--radius-full);
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.status-published { background: #ECFDF3; color: #027A48; border: 1px solid rgba(18, 183, 106, 0.25); }
.status-pending { background: #FFFAEB; color: #B54708; border: 1px solid rgba(247, 144, 9, 0.25); }
.status-draft { background: #F2F4F7; color: #475467; border: 1px solid #D0D5DD; }
.status-rejected { background: #FEF3F2; color: #B42318; border: 1px solid rgba(240, 68, 56, 0.25); }
.status-hidden { background: #F2F4F7; color: #475467; border: 1px solid #D0D5DD; }
.status-active { background: #ECFDF3; color: #027A48; border: 1px solid rgba(18, 183, 106, 0.25); }
.status-inactive { background: #FEF3F2; color: #B42318; border: 1px solid rgba(240, 68, 56, 0.25); }

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

.action-btn {
  width: 34px;
  height: 34px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-secondary);
  background: #FFFFFF;
  border: 1px solid var(--border);
  transition: all var(--duration-fast) ease;
  cursor: pointer;
}

.action-btn svg,
.action-btn svg * {
  pointer-events: none;
}

.action-btn:hover {
  color: var(--text-primary);
  border-color: var(--border-hover);
  background: #F8F9FC;
}

.action-btn-approve:hover {
  background: #ECFDF3;
  color: #027A48;
  border-color: #A6F4C5;
}

.action-btn-reject:hover {
  background: #FFFAEB;
  color: #B54708;
  border-color: #FEDF89;
}

.action-btn-delete:hover {
  background: #FEF3F2;
  color: #B42318;
  border-color: #FECDCA;
}

/* ==========================================================================
   Add Image Form & Upload Dropzone
   ========================================================================== */
.upload-dropzone {
  border: 2px dashed #D0D5DD;
  border-radius: var(--radius-lg);
  padding: 3rem 1.5rem;
  text-align: center;
  cursor: pointer;
  background: #F8F9FC;
  transition: all var(--duration-fast) ease;
  position: relative;
}

.upload-dropzone:hover, .upload-dropzone.dragover {
  border-color: var(--accent);
  background: #F3F4FF;
}

.dropzone-icon {
  font-size: 2.75rem;
  margin-bottom: 0.85rem;
  color: var(--accent);
}

.dropzone-text h4 {
  font-size: 1.15rem;
  font-weight: 700;
  margin-bottom: 0.35rem;
  color: var(--text-primary);
}

.dropzone-text p {
  font-size: 0.86rem;
  color: var(--text-muted);
}

/* Image Preview Box */
.image-preview-container {
  position: relative;
  border-radius: var(--radius-lg);
  overflow: hidden;
  max-width: 480px;
  margin: 0 auto 1.5rem;
  border: 1px solid var(--border);
  background: #F8F9FC;
}

.preview-img {
  width: 100%;
  max-height: 420px;
  object-fit: contain;
  display: block;
}

.preview-actions {
  position: absolute;
  top: 12px;
  right: 12px;
  display: flex;
  gap: 8px;
}

.preview-btn {
  padding: 0.4rem 0.85rem;
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid var(--border);
  color: var(--text-primary);
  border-radius: var(--radius-sm);
  font-size: 0.8rem;
  font-weight: 600;
  backdrop-filter: blur(8px);
  transition: all var(--duration-fast) ease;
}

.preview-btn:hover {
  background: var(--danger);
  border-color: var(--danger);
  color: #ffffff;
}

/* ==========================================================================
   Modal Dialogs
   ========================================================================== */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(16, 24, 40, 0.45);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  z-index: 2000;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
}

.modal-overlay.active,
.modal-overlay.open {
  display: flex !important;
  animation: adminModalFadeIn 0.2s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes adminModalFadeIn {
  from {
    opacity: 0;
    transform: scale(0.96);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

.modal-dialog {
  background: #FFFFFF;
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  max-width: 620px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  padding: 2.25rem;
  box-shadow: 0 20px 25px -5px rgba(16, 24, 40, 0.1), 0 8px 10px -6px rgba(16, 24, 40, 0.04);
  position: relative;
}

.modal-dialog input,
.modal-dialog select,
.modal-dialog textarea {
  width: 100%;
  background: #FFFFFF;
  border: 1px solid var(--border-input);
  border-radius: var(--radius-md);
  padding: 0.75rem 1rem;
  color: var(--text-primary);
  font-family: inherit;
  font-size: 0.9rem;
  transition: all var(--transition-fast);
}

.modal-dialog input:focus,
.modal-dialog select:focus,
.modal-dialog textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(91, 92, 226, 0.15);
  background: #FFFFFF;
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.75rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--border);
}

.modal-header h3 {
  font-size: 1.3rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--text-primary);
}

.modal-close {
  font-size: 1.6rem;
  line-height: 1;
  color: var(--text-muted);
  border-radius: var(--radius-xs);
  padding: 2px 6px;
  transition: color var(--duration-fast) ease;
}

.modal-close:hover {
  color: var(--text-primary);
}

.modal-footer {
  margin-top: 2rem;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.85rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--border);
}

/* Mobile Sidebar Toggle & Backdrop */
.mobile-nav-toggle {
  display: none;
  font-size: 1.35rem;
  color: var(--text-primary);
  background: #FFFFFF;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0.25rem 0.55rem;
  cursor: pointer;
}

.admin-sidebar-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(16, 24, 40, 0.45);
  backdrop-filter: blur(4px);
  z-index: 999;
}

.admin-sidebar-backdrop.active {
  display: block;
}

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

@media (max-width: 960px) {
  .admin-sidebar {
    position: fixed;
    transform: translateX(-100%);
    box-shadow: var(--shadow-lg);
    z-index: 1000;
  }
  .admin-sidebar.open {
    transform: translateX(0);
  }
  .admin-sidebar-backdrop {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.65);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    z-index: 999;
  }
  .admin-sidebar-backdrop.open {
    display: block;
  }
  .mobile-nav-toggle {
    display: block;
  }
  .admin-container {
    padding: 1.5rem 1rem 3rem;
  }
  .admin-topbar {
    padding: 0 1.25rem;
  }
}

@media (max-width: 640px) {
  .admin-topbar {
    height: auto;
    min-height: 64px;
    padding: 0.75rem 1rem;
    flex-wrap: wrap;
    gap: 0.75rem;
  }
  .admin-topbar-title {
    font-size: 1.15rem;
  }
  .admin-topbar-actions {
    width: 100%;
    flex-wrap: wrap;
    gap: 0.5rem;
    justify-content: flex-start;
  }
  .admin-topbar-actions .btn {
    font-size: 0.78rem;
    padding: 0.4rem 0.65rem;
  }
  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 0.75rem;
  }
  .stat-card {
    padding: 1rem 0.85rem;
    gap: 0.75rem;
  }
  .stat-val {
    font-size: 1.35rem;
  }
  .stat-label {
    font-size: 0.76rem;
  }
  .admin-card {
    padding: 1.25rem 1rem;
  }
  .modal-dialog {
    padding: 1.5rem 1.15rem;
  }
  .data-table th, .data-table td {
    padding: 0.75rem 0.6rem;
    font-size: 0.82rem;
  }
  .data-table .table-thumb {
    width: 44px;
    height: 44px;
  }
}

@media (max-width: 440px) {
  .stats-grid {
    grid-template-columns: 1fr;
  }
  .admin-topbar-actions {
    flex-direction: column;
    align-items: stretch;
  }
  .admin-topbar-actions .btn {
    width: 100%;
    justify-content: center;
    min-height: 40px;
  }
  .admin-card-header {
    flex-direction: column;
    align-items: stretch;
    gap: 0.85rem;
    padding: 1rem 0.85rem;
  }
  .admin-card-header input[type="text"] {
    width: 100% !important;
  }
  .admin-sidebar {
    width: 85vw;
    min-width: 250px;
    max-width: 290px;
  }
}

@media (max-width: 340px) {
  .admin-container {
    padding: 1rem 0.5rem 2.5rem;
  }
  .admin-topbar {
    padding: 0.5rem 0.65rem;
  }
  .modal-dialog {
    padding: 1.15rem 0.75rem;
    width: calc(100vw - 16px) !important;
  }
}

@keyframes spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

.action-spinner {
  animation: spin 0.8s linear infinite;
  display: inline-block;
  vertical-align: middle;
}

/* ==========================================================================
   User Management Section Styles
   ========================================================================== */
.badge-status {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.22rem 0.65rem;
  border-radius: var(--radius-full, 9999px);
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.badge-status.badge-published,
.badge-status.badge-active {
  background: #ECFDF3;
  color: #027A48;
  border: 1px solid rgba(18, 183, 106, 0.3);
}

.badge-status.badge-pending,
.badge-status.badge-suspended {
  background: #FFFAEB;
  color: #B54708;
  border: 1px solid rgba(247, 144, 9, 0.3);
}

.badge-status.badge-rejected,
.badge-status.badge-disabled {
  background: #FEF3F2;
  color: #B42318;
  border: 1px solid rgba(240, 68, 56, 0.3);
}

.badge-status.badge-draft,
.badge-status.badge-hidden {
  background: #F2F4F7;
  color: #475467;
  border: 1px solid #D0D5DD;
}

.badge-tag {
  display: inline-block;
  padding: 0.2rem 0.6rem;
  font-size: 0.7rem;
  font-weight: 700;
  border-radius: 4px;
  letter-spacing: 0.03em;
}

.user-name-link:hover {
  color: var(--accent) !important;
  text-decoration: underline !important;
}

#user-posts-gallery::-webkit-scrollbar {
  width: 5px;
}
#user-posts-gallery::-webkit-scrollbar-thumb {
  background: var(--border-subtle, #cbd5e1);
  border-radius: 4px;
}



