/* Admin Panel Styles */

.admin-layout {
  display: flex;
  min-height: calc(100vh - 200px);
  gap: 1rem;
  max-width: 1200px;
  margin: 0 auto;
  padding: 1rem;
}

@media (min-width: 768px) {
  .admin-layout {
    gap: 1.5rem;
    padding: 1.5rem;
  }
}

@media (min-width: 1200px) {
  .admin-layout {
    gap: 2rem;
    padding: 2rem;
  }
}

.admin-sidebar {
  width: 240px;
  background: linear-gradient(to bottom, #ffffff, #f8f9fa);
  border-radius: 12px;
  padding-block: 1.5rem;
  padding-inline: 1.25rem;
  height: fit-content;
  position: sticky;
  top: 2rem;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
  border: 1px solid #e5e7eb;
  transition: box-shadow 0.3s ease;
  flex-shrink: 0;
}

@media (min-width: 1024px) {
  .admin-sidebar {
    width: 260px;
    padding-block: 2rem;
    padding-inline: 1.5rem;
  }
}

@media (min-width: 1200px) {
  .admin-sidebar {
    width: 280px;
  }
}

.admin-sidebar:hover {
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
}

.admin-sidebar-header {
  margin-bottom: 2rem;
  padding-bottom: 1.5rem;
  border-bottom: 2px solid #e5e7eb;
}

.admin-sidebar-title {
  font-size: 1.5rem;
  font-weight: 700;
  color: #111827;
  margin: 0;
  letter-spacing: -0.02em;
}

.admin-sidebar-nav {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.admin-sidebar-item {
  display: flex;
  align-items: center;
  gap: 0.875rem;
  padding: 0.875rem 1.125rem;
  border: none;
  background: transparent;
  border-radius: 8px;
  cursor: pointer;
  text-align: left;
  font-size: 0.9375rem;
  font-weight: 500;
  color: #6b7280;
  transition: all 0.2s ease;
  position: relative;
}

.admin-sidebar-item::before {
  content: '';
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 3px;
  height: 0;
  background: var(--color-brand, #000000);
  border-radius: 0 2px 2px 0;
  transition: height 0.2s ease;
}

.admin-sidebar-item:hover {
  background: #f3f4f6;
  color: #111827;
  transform: translateX(2px);
}

.admin-sidebar-item:hover::before {
  height: 60%;
}

.admin-sidebar-item.active {
  background: linear-gradient(to right, rgba(0, 0, 0, 0.05), transparent);
  color: #000000;
  font-weight: 600;
}

.admin-sidebar-item.active::before {
  height: 80%;
}

.sidebar-item-icon {
  font-size: 1.375rem;
  transition: transform 0.2s ease;
}

.admin-sidebar-item:hover .sidebar-item-icon {
  transform: scale(1.1);
}

.admin-sidebar-item.active .sidebar-item-icon {
  transform: scale(1.15);
}

.admin-content {
  flex: 1;
  border-radius: 12px;
  background: white;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
  border: 1px solid #e5e7eb;
  min-height: 400px;
}

/* Post Create Form */
.post-create-header{
  display: flex;
  flex-direction: column;
  align-items: center;
  color: #333;
  text-align: center;
  }



.post-create-form {
  display: flex;
  flex-direction: column;
  padding: 1rem;
  gap: 1.5rem;
}
/* Loading and Error States */
.js-posts-loading,
.js-comments-loading,
.js-users-loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  padding: 3rem 2rem;
  color: #6b7280;
  min-height: 200px;
}

.js-posts-loading::before,
.js-comments-loading::before,
.js-users-loading::before {
  content: '';
  width: 40px;
  height: 40px;
  border: 3px solid #e5e7eb;
  border-top-color: var(--color-brand, #000000);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

.js-posts-error,
.js-comments-error,
.js-users-error {
  padding: 1.25rem 1.5rem;
  background: linear-gradient(to right, #fee2e2, #fef2f2);
  color: #991b1b;
  border-radius: 8px;
  margin-bottom: 1.5rem;
  border: 1px solid #fecaca;
  border-left: 4px solid #dc2626;
  box-shadow: 0 2px 4px rgba(220, 38, 38, 0.1);
}

.js-posts-error .error-message,
.js-comments-error .error-message,
.js-users-error .error-message {
  margin: 0;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.js-posts-error .error-message::before,
.js-comments-error .error-message::before,
.js-users-error .error-message::before {
  content: '⚠️';
  font-size: 1.25rem;
}

.js-posts-empty,
.js-comments-empty,
.js-users-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  padding: 4rem 2rem;
  color: #6b7280;
  min-height: 300px;
  text-align: center;
}

.js-posts-empty::before,
.js-comments-empty::before,
.js-users-empty::before {
  content: '📭';
  font-size: 3rem;
  opacity: 0.5;
}

.js-posts-empty p,
.js-comments-empty p,
.js-users-empty p {
  margin: 0;
  font-size: 1rem;
  font-weight: 500;
}

/* Responsive */
@media (max-width: 768px) {
  .admin-layout {
    flex-direction: column;
    padding: 1rem;
    gap: 1.5rem;
  }

  .admin-sidebar {
    width: 100%;
    position: static;
    border-radius: 12px;
  }

  .admin-sidebar-nav {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  .admin-sidebar-item {
    white-space: nowrap;
  }

  .admin-content {
    border-radius: 12px;
  }

  .admin-section {
    padding: 1rem 0.75rem;
    gap: 1rem;
  }

  .admin-section-header {
    padding-bottom: 1rem;
  }
  
  .admin-section-header h1 {
    font-size: 1.5rem;
  }
  
  .admin-section-header p {
    font-size: 0.875rem;
  }

  .post-management-item,
  .user-management-item {
    padding: 1rem 0.75rem;
    gap: 0.75rem;
  }

  .post-management-item-actions,
  .user-management-item-actions {
    flex-direction: column;
    width: 100%;
    gap: 0.5rem;
  }
  
  .post-management-item-actions .btn,
  .user-management-item-actions .btn {
    width: 100%;
    padding: 0.75rem 1rem;
    font-size: 0.875rem;
    min-height: 44px; /* Better touch target */
  }
  
  /* User Management Mobile Specific Styles */
  .js-users-search {
    font-size: 16px; /* Prevents zoom on iOS */
    padding: 0.875rem 1rem;
    max-width: 100%;
  }
  
  /* Mobile: Stack avatar and info vertically, badge on right */
  .user-management-item-header {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 1rem;
    align-items: start;
    margin-bottom: 0.5rem;
  }
  
  /* Avatar and info stack vertically in first column */
  .user-management-item-avatar {
    grid-column: 1;
    flex-shrink: 0;
    margin-bottom: 0.5rem;
  }
  
  .user-avatar,
  .user-avatar-placeholder {
    width: 40px;
    height: 40px;
    font-size: 1rem;
  }
  
  .user-management-item-info {
    grid-column: 1;
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
  }
  
  .user-management-item-username {
    font-size: 0.9375rem;
    margin: 0;
    word-break: break-word;
  }
  
  .user-management-item-email {
    font-size: 0.8125rem;
    margin: 0;
    word-break: break-all;
  }
  
  .user-management-item-id {
    font-size: 0.6875rem;
    word-break: break-all;
    line-height: 1.4;
    margin: 0;
  }
  
  /* Status badge stays on the right in second column */
  .user-status-badge {
    grid-column: 2;
    grid-row: 1;
    font-size: 0.6875rem;
    padding: 0.25rem 0.625rem;
    align-self: flex-start;
    flex-shrink: 0;
  }
  
  .user-management-item-meta {
    font-size: 0.75rem;
    margin-top: 0.5rem;
  }
  
  .user-management-item-actions {
    margin-top: 0.75rem;
    gap: 0.625rem;
  }
  
  .button-group {
    flex-direction: column;
    width: 100%;
    gap: 0.75rem;
  }
  
  .button-group .btn {
    width: 100%;
  }
  
  .form-input,
  .form-textarea {
    font-size: 16px; /* Prevents zoom on iOS */
    padding: 0.75rem;
  }
  
  .image-upload-area {
    padding: 2rem 1rem;
    min-height: 150px;
  }
  
  .admin-sidebar-item {
    padding: 0.625rem 0.875rem;
    font-size: 0.875rem;
  }

  .post-management-item-actions .btn,
  .user-management-item-actions .btn {
    width: 100%;
  }

  .admin-modal-content {
    margin: 0.5rem;
    max-height: 95vh;
  }

  .admin-modal-header,
  .admin-modal-body,
  .admin-modal-footer {
    padding: 1rem;
  }
}


/* Header Section */

/* Static preview card styles */
.post-preview-card {
  background: var(--color-background);
  border-radius: var(--border-radius-xl);
  display: flex;
  flex-direction: column;
  gap: .5rem;
}

.post-create-header-caption{
  color: var(--color-text-muted);
  text-align: center;
  margin: 0;
}

.post-create-header-hint {
  color: var(--color-text-secondary);
  font-size: var(--text-sm);
  text-align: center;
  font-style: italic;
}
.post-reactions {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: .75rem;
}

.pill-btn {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: var(--padding-xs);
  padding-inline: .55rem;
  padding-block: .75rem;
  background: #eef2f7;
  border: 0.5px solid var(--color-border);
  color: var(--color-foreground);
  border-radius: var(--button-radius);
  font-size: .87rem;
  cursor: pointer;
  transition: all 0.2s ease;
}

.pill-btn:focus-visible {
  outline: 2px solid var(--color-brand);
  outline-offset: 2px;
}

.pill-btn-icon { 
  font-size: .95rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

.pill-btn-icon svg {
  width: 16px;
  height: 16px;
  fill: currentColor;
}
.pill-btn .count { font-weight: 700; }

.pill-btn.vote {
  cursor: pointer;
}

.pill-btn.vote .icon {
  cursor: pointer;
  transition: color 0.2s ease;
}

.pill-btn.vote.upvoted .icon:first-child {
  color: #ef4444;
}

.pill-btn-share{
  font-weight: 600;
}

.post-preview-title {
  margin: 0;
  font-size: var(--text-xl);
  font-weight: 800;
  color: var(--color-foreground);
  text-align: center;
}

.post-preview-tag {
  display: inline-block;
  background: #E6F0FF;
  border: 1px solid #bfdbfe;
  border-radius: 999px;
  padding: 0.25rem .6rem;
  font-size: .75rem;
  font-weight: 700;
  align-self: center;
}

.post-preview-image-wrap {
  position: relative;
  border-radius: 12px;
  overflow: hidden;
  background: #f3f4f6;
  display: flex;
  align-items: center;
  justify-content: center;
}

.post-preview-image {
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center;
}

.post-preview-caption {
  margin: 0;
  color: var(--color-text-muted);
  line-height: 1.6;
  font-size: .95rem;
}

/* Form Styles */
.post-create-form {
  background: white;
  border-radius: 16px;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
  border: 1px solid #e5e7eb;
  display: flex;
  flex-direction: column;
  gap: 2rem;
  transition: box-shadow 0.3s ease;
}

.post-create-form:hover {
  box-shadow: 0 8px 16px -4px rgba(0, 0, 0, 0.1), 0 4px 8px -2px rgba(0, 0, 0, 0.08);
}



/* Label Styles */
.form-label {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 600;
  color: #374151;
}

.label-text {
  font-size: 1rem;
}

.label-required {
  color: #ef4444;
  font-size: 0.875rem;
}

.label-optional {
  color: #9ca3af;
  font-size: 0.875rem;
  font-weight: 400;
}

/* Input Styles */
.form-input {
  width: 100%;
  padding: 0.875rem 1.125rem;
  border: 2px solid var(--color-border);
  border-radius: 10px;
  font-size: 1rem;
  line-height: 1.5;
  color: #374151;
  background-color: white;
  transition: all 0.2s ease;
  box-sizing: border-box;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

.form-input:hover:not(:disabled) {
  border-color: #d1d5db;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.08);
}

.form-input:focus {
  outline: none;
  border-color: var(--color-brand, #000000);
  box-shadow: 0 0 0 3px rgba(0, 0, 0, 0.1), 0 2px 4px rgba(0, 0, 0, 0.1);
  transform: translateY(-1px);
}

.form-input::placeholder {
  color: #9ca3af;
  font-style: italic;
}

/* Textarea Styles */
.form-textarea {
  width: 100%;
  padding: 0.875rem 1.125rem;
  border: 2px solid var(--color-border);
  border-radius: 10px;
  font-size: 1rem;
  line-height: 1.6;
  color: #374151;
  background-color: white;
  transition: all 0.2s ease;
  resize: vertical;
  min-height: 120px;
  font-family: inherit;
  box-sizing: border-box;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

.form-textarea:hover:not(:disabled) {
  border-color: #d1d5db;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.08);
}

.form-textarea:focus {
  outline: none;
  border-color: var(--color-brand, #000000);
  box-shadow: 0 0 0 3px rgba(0, 0, 0, 0.1), 0 2px 4px rgba(0, 0, 0, 0.1);
  transform: translateY(-1px);
}

.form-textarea::placeholder {
  color: #9ca3af;
  font-style: italic;
}

/* Character Counters */
.input-counter,
.textarea-counter {
  display: flex;
  justify-content: flex-end;
  font-size: 0.875rem;
  color: #6b7280;
}

.input-counter.warning {
  color: #f59e0b;
}

.input-counter.error {
  color: #ef4444;
}

/* Error Messages */
.input-error {
  margin-top: 0.5rem;
  font-size: 0.875rem;
  color: #ef4444;
  display: none;
}

.input-error.show {
  display: block;
}

/* Image Upload Area */
.image-upload-area {
  border: 2px dashed #d1d5db;
  border-radius: 12px;
  padding: 3rem 2rem;
  text-align: center;
  background: linear-gradient(to bottom, #f9fafb, #ffffff);
  transition: all 0.3s ease;
  cursor: pointer;
  position: relative;
  overflow: hidden;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.image-upload-area::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.4), transparent);
  transition: left 0.5s ease;
}

.image-upload-area:hover {
  background: linear-gradient(to bottom, #eff6ff, #f0f9ff);
  border-color: var(--color-brand, #000000);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  transform: translateY(-2px);
}

.image-upload-area:hover::before {
  left: 100%;
}

.image-upload-area.dragover {
  background: linear-gradient(to bottom, #dbeafe, #e0f2fe);
  border-color: var(--color-brand, #000000);
  transform: scale(1.02);
  box-shadow: 0 8px 16px rgba(0, 0, 0, 0.15);
}

.upload-content {
  pointer-events: none;
}

.upload-icon {
  color: #6b7280;
  margin-bottom: 1rem;
}

.upload-icon svg {
  width: 48px;
  height: 48px;
}

.upload-text h3 {
  font-size: 1.25rem;
  font-weight: 600;
  color: #374151;
  margin: 0 0 0.5rem 0;
}

.upload-text p {
  font-size: 0.875rem;
  color: #6b7280;
  margin: 0 0 0.25rem 0;
}

.upload-limit {
  font-size: 0.75rem !important;
  color: #9ca3af !important;
}

 

/* Image Preview Container */
.image-preview-container {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  margin-top: 1rem;
  min-height: 150px;
}

/* Image Preview Grid */
.image-preview-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 1rem;
  margin-top: 1rem;
}

.image-preview-item {
  position: relative;
  aspect-ratio: 1;
  border-radius: 8px;
  overflow: hidden;
  width: 150px;
  min-width: 150px;
  min-height: 150px;
  background-color: #f3f4f6;
  border: 2px solid var(--color-border);
}

.image-preview-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* Handle image load errors */
.image-preview-item img[src=""],
.image-preview-item img:not([src]) {
  display: none;
}

.image-preview-item img::after {
  content: 'Image failed to load';
  display: block;
  padding: 1rem;
  text-align: center;
  color: #6b7280;
  font-size: 0.875rem;
}

.image-preview-item .remove-btn,
.image-preview-item .image-preview-remove {
  position: absolute;
  top: 0.5rem;
  right: 0.5rem;
  width: 28px;
  height: 28px;
  background-color: rgba(239, 68, 68, 0.95);
  color: white;
  border: 2px solid white;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  font-weight: bold;
  line-height: 1;
  transition: all 0.2s ease;
  z-index: 10;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.image-preview-item .remove-btn:hover,
.image-preview-item .image-preview-remove:hover {
  background-color: #dc2626;
  transform: scale(1.1);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
}

.image-preview-item .remove-btn:active,
.image-preview-item .image-preview-remove:active {
  transform: scale(0.95);
}

.image-preview-item .image-number {
  position: absolute;
  bottom: 0.5rem;
  left: 0.5rem;
  background-color: rgba(0, 0, 0, 0.7);
  color: white;
  padding: 0.25rem 0.5rem;
  border-radius: 4px;
  font-size: 0.75rem;
  font-weight: 600;
}

/* Upload Progress */
.upload-progress {
  margin-top: 1rem;
}

.progress-bar {
  width: 100%;
  height: 8px;
  background-color: #e5e7eb;
  border-radius: 4px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  border-radius: 4px;
  transition: width 0.3s ease;
  width: 0%;
}

.progress-text {
  margin-top: 0.5rem;
  font-size: 0.875rem;
  color: #6b7280;
  text-align: center;
}

/* Form Actions */
.form-actions {
  display: flex;
  gap: 1rem;
  flex-direction: column;
  justify-content: space-between;
}
@media screen and (min-width: 480px) {
  .form-actions {
    flex-direction: row;
  }
}
/* Button Styles */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.75rem 1.5rem;
  border-radius: 10px;
  font-size: 0.875rem;
  font-weight: 600;
  text-decoration: none;
  border: 2px solid transparent; /* Changed from 'none' to allow outline buttons */
  cursor: pointer;
  transition: all 0.2s ease;
  min-height: 44px;
  position: relative;
  overflow: hidden;
}

.btn::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.2);
  transform: translate(-50%, -50%);
  transition: width 0.6s, height 0.6s;
}

.btn:active::before {
  width: 300px;
  height: 300px;
}

.btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.btn--outline {
  background-color: #ffffff;
  color: #374151;
  border: 2px solid var(--color-border, #e5e7eb);
  transition: all 0.2s ease;
}

.btn--outline:hover:not(:disabled) {
  border-color: #d1d5db;
  background-color: #f9fafb;
  color: #111827;
  transform: translateY(-1px);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

.btn--outline:active:not(:disabled) {
  transform: translateY(0);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
  background-color: #f3f4f6;
}

/* Secondary button (used with outline for cancel buttons) */
/* .btn-secondary - Secondary buttons use outline style by default */

.btn--outline.btn-secondary {
  background-color: #ffffff;
  color: #6b7280;
  border: 2px solid #e5e7eb;
}

.btn--outline.btn-secondary:hover:not(:disabled) {
  background-color: #f9fafb;
  border-color: #d1d5db;
  color: #374151;
}

/* Primary button (solid) */
.admin-modal-content .btn--primary {
  background-color: var(--color-brand, #000000);
  color: white;
  border: 2px solid var(--color-brand, #000000);
}

.admin-modal-content .btn--primary:hover:not(:disabled) {
  background-color: var(--color-brand-dark, #111111);
  border-color: var(--color-brand-dark, #111111);
  transform: translateY(-2px);
  box-shadow: 0 6px 12px rgba(0, 0, 0, 0.15);
}

.admin-modal-content .btn--primary:active:not(:disabled) {
  transform: translateY(0);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.admin-modal-content .btn--primary {
  background-color: var(--color-brand, #000000);
  color: white;
  border: 2px solid var(--color-brand, #000000);
}

.admin-modal-content .btn--primary:hover:not(:disabled) {
  background-color: var(--color-brand-dark, #111111);
  border-color: var(--color-brand-dark, #111111);
  transform: translateY(-2px);
  box-shadow: 0 6px 12px rgba(0, 0, 0, 0.15);
}

.admin-modal-content .btn--primary:active:not(:disabled) {
  transform: translateY(0);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.btn-loading {
  display: none;
}

.btn.loading .btn-text {
  display: none;
}

.btn.loading .btn-loading {
  display: flex;
}

/* NOTE: spinner-small is deprecated - use .loader.loader--small from global.css instead */
.spinner-small {
  width: 16px;
  height: 16px;
  border: 2px solid transparent;
  border-top: 2px solid currentColor;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

/* Comments Loading State - Reusable loader component */
.comments-status {
  text-align: center;
  padding: 2rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
}

.comments-status p {
  margin: 0;
  font-size: 0.875rem;
  color: var(--color-text-muted, #6b7280);
}

/* Success Message */
.success-message {
  background: white;
  border-radius: 16px;
  padding: 3rem 2rem;
  text-align: center;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
  border: 1px solid #e5e7eb;
}

.success-content {
  max-width: 400px;
  margin: 0 auto;
}

.success-icon {
  width: 64px;
  height: 64px;
  background-color: #10b981;
  color: white;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: var(--text-3xl);
  font-weight: bold;
  margin: 0 auto 1.5rem;
}

.success-content h3 {
  font-size: var(--text-xl);
  font-weight: 700;
  color: #1a1a1a;
  margin: 0 0 0.5rem 0;
}

.success-content p {
  font-size: 1rem;
  color: #6b7280;
  margin: 0 0 2rem 0;
}

.success-actions {
  display: flex;
  gap: 1rem;
  justify-content: center;
}

/* ==========================================================================
 MOBILE-FIRST RESPONSIVE DESIGN
 Starting from 320px and scaling up
 ========================================================================== */

.image-preview-grid {
  grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
  gap: 0.5rem;
}


.success-actions {
  flex-direction: column;
  gap: 0.5rem;
}





.comment-action-btn {
  font-size: 0.75rem; /* Minimum 12px for WCAG compliance */
  padding: 0.15rem 0.3rem;
}


/* Post Creation Page Styles */
/* Modern, clean design with excellent UX */

/* Note: CSS Custom Properties are defined in global.css for consistency across the app */

.post-create-wrapper {
  display: flex;
  flex-direction: column;
  line-height: 1.5;
  max-width: 800px;
  margin: 0 auto;
  gap: 1rem;
  padding-block-end: 2rem;
}
.admin-section .post-create-wrapper{
  max-width: unset;
  margin: unset;
}

/* ==========================================================================
 PROGRESSIVE ENHANCEMENT - LARGER SCREENS
 ========================================================================== */

/* Tablet Portrait (768px+) */
@media (min-width: 768px) {
  
  .image-preview-grid {
      grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
      gap: 1rem;
  }
  .success-actions {
      flex-direction: row;
      gap: 1rem;
  }

  
  .post-preview-image-wrap {
      aspect-ratio: 3 / 4;
      max-height: 80vh;
  }
}

/* Desktop (1024px+) */
@media (min-width: 1024px) {
  
  .image-preview-grid {
      grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
      gap: 1.25rem;
  }
  
  
  .author-name {
      font-size: 0.875rem;
  }
  
  .comment-time {
      font-size: 0.75rem;
  }
  
  

  
  .thread-line,
  .main-thread-line {
      left: -1.5rem;
      width: 1px;
  }
  
  
  .comment-action-btn {
      font-size: 0.75rem;
      padding: 0.25rem 0.5rem;
  }
}

/* Utility Classes */
.hide {
  display: none !important;
}

.fade-in {
  animation: fadeIn 0.3s ease-in;
}

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

/* Focus States for Accessibility */
.form-input:focus,
.form-textarea:focus {
  outline-offset: 2px;
}

/* High Contrast Mode Support */
@media (prefers-contrast: high) {
  .form-input,
  .form-textarea {
      border-width: 3px;
  }
  
  .btn {
      border-width: 2px;
  }
}




/* Comment styles are now in /css/comments.css */



/* ============================================
 Admin Navigation Tabs
 ============================================ */

.admin-nav-tabs {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 2rem;
  border-bottom: 2px solid var(--color-border, #e5e7eb);
}

.admin-tab {
  padding: 0.75rem 1.5rem;
  background: transparent;
  border: none;
  border-bottom: 2px solid transparent;
  color: var(--color-text-secondary, #6b7280);
  font-size: 1rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
  margin-bottom: -2px;
}

.admin-tab:hover {
  color: var(--color-text-dark, #111827);
  background: var(--color-background-secondary, #f9fafb);
}

.admin-tab.active,
.admin-tab[aria-selected="true"] {
  color: var(--color-brand, #2563eb);
  border-bottom-color: var(--color-brand, #2563eb);
  font-weight: 600;
}

.admin-tab:focus-visible {
  outline: 2px solid var(--color-brand, #2563eb);
  outline-offset: 2px;
  border-radius: 4px;
}

/* ============================================
 Admin Sections
 ============================================ */

.admin-section {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  animation: fadeIn 0.3s ease;
  padding-block: 1rem;
  padding-inline: 1rem;
  min-height: 400px;
}

@media (min-width: 768px) {
  .admin-section {
    padding-block: 1.5rem;
    padding-inline: 1.5rem;
  }
}

@media (min-width: 1200px) {
  .admin-section {
    padding-block: 2rem;
    padding-inline: 2rem;
  }
}
.form-group {
  display: flex;
  flex-direction: column;
  gap: .5rem;
}

@keyframes fadeIn {
  from {
      opacity: 0;
  }
  to {
      opacity: 1;
  }
}

.admin-section-header {
  border-bottom: 2px solid var(--color-border, #e5e7eb);
  padding-bottom: 1.5rem;
  margin-bottom: 2rem;
}

.admin-section-header h1 {
  font-size: 2rem;
  font-weight: 700;
  color: var(--color-text-dark, #111827);
  line-height: 1.2;
  margin: 0 0 0.5rem 0;
  letter-spacing: -0.02em;
}

.admin-section-header p {
  font-size: 1rem;
  color: var(--color-text-secondary, #6b7280);
  margin: 0;
  line-height: 1.6;
}

/* Search Wrapper */
.admin-search-wrapper {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-bottom: 1.5rem;
}

/* Search Input Styling */
.js-posts-search,
.js-comments-search,
.js-users-search {
  width: 100%;
  padding: 0.875rem 1.125rem;
  padding-right: 3rem;
  border: 2px solid var(--color-border, #e5e7eb);
  border-radius: 10px;
  font-size: 1rem;
  background: var(--color-background, #ffffff);
  color: var(--color-text-dark, #111827);
  transition: all 0.2s ease;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
  position: relative;
}

/* Search Results Count */
.admin-search-results {
  font-size: 0.875rem;
  color: var(--color-text-secondary, #6b7280);
  text-align: left;
  padding-left: 0.25rem;
}

.js-posts-search:focus,
.js-comments-search:focus,
.js-users-search:focus {
  outline: none;
  border-color: var(--color-brand, #000000);
  box-shadow: 0 0 0 3px rgba(0, 0, 0, 0.1), 0 2px 4px rgba(0, 0, 0, 0.1);
  transform: translateY(-1px);
}

.js-posts-search:hover:not(:focus),
.js-comments-search:hover:not(:focus),
.js-users-search:hover:not(:focus) {
  border-color: #d1d5db;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.08);
}

.js-posts-search::placeholder,
.js-comments-search::placeholder,
.js-users-search::placeholder {
  color: var(--color-text-tertiary, #9ca3af);
  font-style: italic;
}

/* ============================================
 Comments Management
 ============================================ */

.comments-management-wrapper {
  max-width: 1000px;
  margin: 0 auto;
  padding-inline: clamp(1rem, 4vw, 1.5rem);
}

.comments-management-header {
  margin-bottom: 2rem;
}

.comments-management-header h1 {
  font-size: 2rem;
  font-weight: 700;
  color: var(--color-text-dark, #111827);
  margin-bottom: 0.5rem;
}

.comments-management-caption {
  color: var(--color-text-muted, #9ca3af);
  font-size: 1rem;
  margin: 0;
}

/* Search Container */
.comments-search-container {
  margin-bottom: 2rem;
}

.comments-search-input {
  width: 100%;
  padding: 0.75rem 1rem;
  font-size: 1rem;
  border: 1px solid var(--color-border, #e5e7eb);
  border-radius: var(--border-radius-md, 8px);
  background: var(--color-background, #ffffff);
  color: var(--color-text-dark, #111827);
  transition: all 0.2s ease;
}

.comments-search-input:focus {
  outline: none;
  border-color: var(--color-brand, #2563eb);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.comments-search-input::placeholder {
  color: var(--color-text-tertiary, #9ca3af);
}

/* Loading, Error, Empty States */
.comments-loading,
.comments-error,
.comments-empty {
  text-align: center;
  padding: 3rem 1rem;
  color: var(--color-text-secondary, #6b7280);
}

.comments-loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
}

.comments-error {
  color: var(--color-error, #dc2626);
}

.comments-error .error-message {
  margin: 0;
  font-weight: 500;
}

/* Comment card styles are now in /css/comments.css */

/* Comments List Container - Ensure visibility */
.comments-management-list.js-comments-list,
.js-comments-list {
  display: flex !important;
  flex-direction: column;
  gap: 1rem;
  width: 100%;
}

.comments-management-list.js-comments-list:empty {
  display: none !important;
}

/* Ensure comment cards are visible */
.js-comments-list .comment-card {
  display: block;
  width: 100%;
}

/* Responsive Design */
@media (max-width: 768px) {
  .admin-nav-tabs {
      flex-direction: column;
      gap: 0;
      border-bottom: none;
  }

  .admin-tab {
      border-bottom: 1px solid var(--color-border, #e5e7eb);
      border-left: 3px solid transparent;
      margin-bottom: 0;
      text-align: left;
  }

  .admin-tab.active,
  .admin-tab[aria-selected="true"] {
      border-left-color: var(--color-brand, #2563eb);
      border-bottom-color: var(--color-border, #e5e7eb);
  }

  .comment-card-header {
      flex-direction: column;
      align-items: stretch;
  }

  .comment-delete-btn {
      width: 100%;
      margin-top: 0.5rem;
  }

  .comments-management-header h1 {
      font-size: 1.5rem;
  }
}


/* Post Management Styles - Mobile First */
.posts-management-wrapper {
  width: 100%;
  margin: 0 auto;
  padding: 0 1rem;
}

.posts-management-header {
  margin-bottom: 1.5rem;
}

.posts-management-header h1 {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--color-foreground);
  margin: 0 0 0.5rem;
}

.posts-management-caption {
  color: var(--color-text-muted);
  margin: 0;
  font-size: 0.875rem;
}

.posts-search-container {
  margin-bottom: 1.5rem;
}

.posts-search-input {
  width: 100%;
  padding: 0.75rem 1rem;
  border: 1px solid var(--color-border);
  border-radius: var(--border-radius-md);
  font-size: 0.9375rem;
  background: var(--color-background);
  color: var(--color-foreground);
  transition: border-color 0.2s ease;
}

.posts-search-input:focus {
  outline: none;
  border-color: var(--color-brand);
  box-shadow: 0 0 0 3px rgba(var(--color-brand-rgb), 0.1);
}

.posts-list {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.post-management-item {
  background: var(--color-background);
  border: 1px solid var(--color-border);
  border-radius: 12px;
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  transition: all 0.3s ease;
  position: relative;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.post-management-item:hover {
  border-color: var(--color-brand, #000000);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  transform: translateY(-2px);
  background: linear-gradient(to bottom, #ffffff, #fafafa);
}

.post-management-item-content {
  flex: 1;
  min-width: 0;
  width: 100%;
  overflow: hidden;
}


.post-management-item-title {
  font-size: 1rem;
  font-weight: 600;
  color: var(--color-foreground);
  margin: 0 0 0.5rem;
  line-height: 1.4;
  word-wrap: break-word;
  overflow-wrap: break-word;
  hyphens: auto;
}

.post-management-item-meta {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
  font-size: 0.8125rem;
  color: var(--color-text-muted);
}

.post-management-item-separator {
  color: var(--color-text-muted);
}

.post-management-item-body {
  color: var(--color-text-secondary);
  font-size: 0.875rem;
  line-height: 1.6;
  margin: 0;
}

.post-management-item-actions {
  display: flex;
  gap: 0.5rem;
  flex-wrap: nowrap;
  justify-content: flex-end;
  align-items: center;
  flex-shrink: 0;
  min-width: fit-content;
}

.post-management-item-actions .btn {
  padding: 0.5rem 1rem;
  font-size: 0.8125rem;
  white-space: nowrap;
}

.post-management-item-actions .btn {
  transition: all 0.2s ease;
  font-weight: 600;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

.post-management-item-actions .btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

.post-management-item-actions .btn:active {
  transform: translateY(0);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}
/* Tablet and Desktop Post Management Styles */
@media (min-width: 768px) {
  .post-management-item {
      flex-direction: row;
      padding: 1rem;
      gap: 1rem;
      align-items: flex-start;
  }
  
  .post-management-item-content {
      flex: 1 1 auto;
      min-width: 250px !important;
      max-width: none;
      overflow: hidden;
  }
  
  .post-management-item-actions {
      flex-shrink: 0 !important;
      flex-grow: 0 !important;
      min-width: 120px !important;
      max-width: 140px !important;
      flex-wrap: nowrap;
      width: auto;
  }
  
  .post-management-item-actions .btn {
      padding: 0.5rem 0.875rem !important;
      font-size: 0.8125rem;
      min-width: auto;
      width: auto;
      flex-shrink: 0;
  }
}

/* Desktop Post Management Styles */
@media (min-width: 1024px) {
  .posts-management-wrapper {
      max-width: 1200px;
      padding: 0 1.5rem;
  }

  .posts-management-header {
      margin-bottom: 2rem;
  }

  .posts-management-header h1 {
      font-size: 2rem;
  }

  .posts-management-caption {
      font-size: 1rem;
  }

  .posts-search-input {
      max-width: 500px;
  }

  .post-management-item {
      padding: 1.25rem;
      gap: 1.25rem;
  }
  
  .post-management-item-content {
      min-width: 300px !important;
  }
  
  .post-management-item-actions {
      min-width: 140px !important;
      max-width: 160px !important;
      width: auto !important;
  }

  .post-management-item-title {
      font-size: 1.125rem;
  }

  .post-management-item-meta {
      font-size: 0.875rem;
  }

  .post-management-item-body {
      font-size: 0.9375rem;
  }
}

@media (min-width: 1200px) {
  .post-management-item {
      padding: 1.5rem;
      gap: 1.5rem;
  }
  
  .post-management-item-actions {
      min-width: 160px;
      max-width: 180px;
  }
  
  .post-management-item-actions .btn {
      padding: 0.75rem 1.5rem;
      font-size: 0.875rem;
  }
}

.btn--danger {
  background: #dc2626;
  color: white;
  border: 2px solid #dc2626;
}

/* Danger button with primary (solid) */
.btn--primary.btn--danger {
  background: #dc2626;
  color: white;
  border: 2px solid #dc2626;
}

.btn--danger:hover:not(:disabled),
.btn--primary.btn--danger:hover:not(:disabled) {
  background: #b91c1c;
  border-color: #b91c1c;
  transform: translateY(-2px);
  box-shadow: 0 6px 12px rgba(220, 38, 38, 0.3);
}

.btn--danger:active:not(:disabled),
.btn--primary.btn--danger:active:not(:disabled) {
  transform: translateY(0);
  box-shadow: 0 2px 4px rgba(220, 38, 38, 0.2);
}

/* Ensure danger buttons without primary are still solid */
.btn--danger:not(.btn--outline) {
  background: #dc2626;
  color: white;
  border: 2px solid #dc2626;
}

.btn--warning {
  background: #f59e0b;
  color: white;
  border: 2px solid #f59e0b;
}

.btn--primary.btn--warning {
  background: #f59e0b;
  color: white;
  border: 2px solid #f59e0b;
}

.btn--warning:hover:not(:disabled),
.btn--primary.btn--warning:hover:not(:disabled) {
  background: #d97706;
  border-color: #d97706;
  transform: translateY(-2px);
  box-shadow: 0 6px 12px rgba(245, 158, 11, 0.3);
}

.btn--warning:active:not(:disabled),
.btn--primary.btn--warning:active:not(:disabled) {
  transform: translateY(0);
  box-shadow: 0 2px 4px rgba(245, 158, 11, 0.2);
}

.btn--small {
  padding: 0.5rem 1rem;
  font-size: 0.8125rem;
  min-height: 36px;
}

/* Pagination */
.pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  margin-top: 2rem;
  flex-wrap: wrap;
}

.pagination-btn {
  padding: 0.625rem 0.875rem;
  border: 2px solid var(--color-border);
  border-radius: 8px;
  background: var(--color-background);
  color: var(--color-foreground);
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
  min-width: 44px;
  min-height: 44px;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

.pagination-btn:hover:not(.disabled) {
  background: var(--color-surface, #f3f4f6);
  border-color: var(--color-brand, #000000);
  transform: translateY(-1px);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.pagination-btn:active:not(.disabled) {
  transform: translateY(0);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

.pagination-btn.active {
  background: var(--color-brand, #000000);
  color: white;
  border-color: var(--color-brand, #000000);
  font-weight: 600;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.15);
}

.pagination-btn.active:hover {
  background: var(--color-brand-dark, #111111);
  border-color: var(--color-brand-dark, #111111);
}

.pagination-btn.disabled {
  opacity: 0.4;
  cursor: not-allowed;
  background: #f3f4f6;
  border-color: #e5e7eb;
}

.pagination-ellipsis {
  padding: 0.5rem;
  color: var(--color-text-muted);
}

/* ============================================
   User Management
   ============================================ */

.users-management-list {
  display: flex !important;
  flex-direction: column;
  gap: 1rem;
  width: 100%;
  margin-top: 1rem;
}

.users-management-list:empty {
  display: none !important;
}

.user-management-item {
  background: var(--color-background);
  border: 1px solid var(--color-border);
  border-radius: 12px;
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  transition: all 0.3s ease;
  position: relative;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.user-management-item:hover {
  border-color: var(--color-brand, #000000);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  transform: translateY(-2px);
  background: linear-gradient(to bottom, #ffffff, #fafafa);
}

.user-management-item-content {
  flex: 1;
  min-width: 0;
  width: 100%;
}

.user-management-item-header {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  margin-bottom: 0.75rem;
}

.user-management-item-avatar {
  flex-shrink: 0;
}

.user-avatar {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  object-fit: cover;
}

.user-avatar-placeholder {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--color-surface, #f3f4f6);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--color-text-muted, #6b7280);
  font-weight: 600;
  font-size: 1.125rem;
}

.user-management-item-info {
  flex: 1;
  min-width: 0;
}

.user-management-item-username {
  font-size: 1rem;
  font-weight: 600;
  color: var(--color-foreground);
  margin: 0 0 0.25rem;
  line-height: 1.4;
}

.user-management-item-email {
  font-size: 0.875rem;
  color: var(--color-text-secondary);
  margin: 0 0 0.25rem;
}

.user-management-item-id {
  font-size: 0.75rem;
  color: var(--color-text-muted);
  margin: 0;
  font-family: monospace;
}

.user-status-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  padding: 0.375rem 0.875rem;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 600;
  white-space: nowrap;
  flex-shrink: 0;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
  border: 1px solid transparent;
}

.user-status-badge--active {
  background: linear-gradient(to bottom, #d1fae5, #a7f3d0);
  color: #065f46;
  border-color: #6ee7b7;
}

.user-status-badge--banned {
  background: linear-gradient(to bottom, #fee2e2, #fecaca);
  color: #991b1b;
  border-color: #fca5a5;
}

.user-status-badge--suspended {
  background: linear-gradient(to bottom, #fef3c7, #fde68a);
  color: #92400e;
  border-color: #fcd34d;
}

.user-management-item-meta {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
  font-size: 0.8125rem;
  color: var(--color-text-muted);
}

.user-management-item-date {
  color: var(--color-text-muted);
}

.user-management-item-actions {
  display: flex;
  gap: 0.75rem;
  flex-shrink: 0;
  flex-grow: 0;
  width: 100%;
  justify-content: flex-end;
  align-items: center;
  margin-top: auto;
  flex-wrap: wrap;
}

.user-management-item-actions .btn {
  transition: all 0.2s ease;
  font-weight: 600;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

.user-management-item-actions .btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

.user-management-item-actions .btn:active {
  transform: translateY(0);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

/* Tablet and Desktop User Management Styles */
@media (min-width: 768px) {
  .user-management-item {
    flex-direction: row;
    padding: 1.25rem;
    gap: 1.25rem;
    align-items: flex-start;
  }
  
  .user-management-item-content {
    flex: 1;
    min-width: 200px;
    max-width: none;
  }

  .user-management-item-actions {
    width: auto;
    min-width: 140px;
    max-width: 160px;
    justify-content: flex-end;
    margin-top: 0;
    align-self: flex-start;
    flex-shrink: 0;
    flex-grow: 0;
  }

  .user-management-item-username {
    font-size: 1.125rem;
  }

  .user-management-item-email {
    font-size: 0.9375rem;
  }
}

@media (min-width: 1024px) {
  .user-management-item {
    padding: 1.5rem;
    gap: 1.5rem;
  }
  
  .user-management-item-actions {
    min-width: 180px;
    max-width: 180px;
  }
}

/* Modal Styles */
.admin-modal {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 1000;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.admin-modal[style*="display: flex"],
.admin-modal[style*="display:flex"],
.admin-modal[aria-hidden="false"] {
  display: flex !important;
  opacity: 1 !important;
  pointer-events: all !important;
  animation: modalFadeIn 0.3s ease;
}

@keyframes modalFadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

.admin-modal-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(8px);
  animation: overlayFadeIn 0.3s ease;
}

@keyframes overlayFadeIn {
  from {
    background: rgba(0, 0, 0, 0);
    backdrop-filter: blur(0);
  }
  to {
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(8px);
  }
}

.admin-modal-content {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 0;
  background: var(--color-background);
  border-radius: 16px;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
  max-width: 800px;
  width: 100%;
  max-height: 90vh;
  overflow: hidden;
  z-index: 1;
  transform: scale(0.95) translateY(-20px);
  animation: modalSlideIn 0.3s ease forwards;
}

/* Make modal form scrollable */
.admin-modal-form {
  padding: 1.5rem;
  overflow-y: auto;
  overflow-x: hidden;
  flex: 1 1 auto;
  min-height: 0;
  max-height: calc(90vh - 120px); /* Account for header and footer */
}

/* Ensure modal body is scrollable too */
.admin-modal-body {
  padding: 1.5rem;
  overflow-y: auto;
  overflow-x: hidden;
  flex: 1 1 auto;
  min-height: 0;
  max-height: calc(90vh - 120px); /* Account for header and footer */
}

@keyframes modalSlideIn {
  to {
    transform: scale(1) translateY(0);
  }
}



.admin-modal-content--small {
  max-width: 500px;
}

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

.admin-modal-header h3 {
  font-size: 1.5rem;
  font-weight: 600;
  color: var(--color-foreground);
  margin: 0;
}

.admin-modal-close {
  background: none;
  border: none;
  font-size: 1.75rem;
  color: var(--color-text-muted);
  cursor: pointer;
  padding: 0;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  transition: all 0.2s ease;
  line-height: 1;
  font-weight: 300;
}

.admin-modal-close:hover {
  background: #f3f4f6;
  color: var(--color-foreground);
  transform: rotate(90deg);
}

.admin-modal-close:active {
  transform: rotate(90deg) scale(0.95);
}

.admin-modal-form {
  padding: 1.5rem;
  overflow-y: auto;
  overflow-x: hidden;
  flex: 1 1 auto;
  min-height: 0;
  max-height: calc(90vh - 120px); /* Account for header and footer */
}

.admin-modal-body {
  padding: 1.5rem;
}

.admin-modal-body p {
  margin: 0 0 1rem 0;
  line-height: 1.6;
  color: var(--color-text-dark, #111827);
}

.admin-modal-body p:last-child {
  margin-bottom: 0;
}

.text-muted {
  color: var(--color-text-secondary, #6b7280);
  font-size: 0.875rem;
}

.admin-modal-footer {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.75rem;
  padding: 1.5rem;
  border-top: 1px solid var(--color-border);
}

@media (max-width: 768px) {
  .admin-modal-footer {
    flex-direction: column;
    gap: 0.75rem;
    padding: 1rem;
  }
  
  .admin-modal-footer .btn {
    width: 100%;
    justify-content: center;
  }
}

/* Additional Mobile Overlay for Sidebar */
@media (max-width: 767px) {
  .admin-sidebar::before {
      content: '';
      position: fixed;
      top: 0;
      left: 0;
      right: 0;
      bottom: 0;
      background: rgba(0, 0, 0, 0.5);
      opacity: 0;
      pointer-events: none;
      transition: opacity 0.3s ease;
      z-index: -1;
  }

  .admin-sidebar.open::before {
      opacity: 1;
      pointer-events: all;
  }
}

/* Comment options menu styles are now in /css/comments.css */

/* ============================================
   Admin Panel UI/UX Enhancements Summary
   ============================================
   
   Enhanced Features:
   - Sidebar: Improved visual hierarchy, hover effects, active states
   - Forms: Better input styling, focus states, validation feedback
   - Buttons: Enhanced hover/active states, loading indicators, ripple effects
   - Modals: Smooth animations, better backdrop, improved UX
   - Search: Enhanced styling, better focus states
   - Loading/Error/Empty: Improved visual feedback with icons and animations
   - Cards/Items: Better hover effects, spacing, visual hierarchy
   - Pagination: Enhanced styling with better hover states
   - Status Badges: Gradient backgrounds, better visual distinction
   - Responsive: Mobile-first improvements for all components
   
   ============================================ */