:root {
  --primary: #4f46e5;
  --primary-hover: #4338ca;
  --secondary: #6b7280;
  --success: #10b981;
  --warning: #f59e0b;
  --danger: #ef4444;
  --light: #f9fafb;
  --dark: #1f2937;
  --gray-100: #f3f4f6;
  --gray-200: #e5e7eb;
  --gray-300: #d1d5db;
  --gray-400: #9ca3af;
  --gray-500: #6b7280;
  --gray-600: #4b5563;
  --gray-700: #374151;
  --gray-800: #1f2937;
  --gray-900: #111827;
  --border-radius: 8px;
  --shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1),
    0 4px 6px -2px rgba(0, 0, 0, 0.05);
}

* {
  box-sizing: border-box;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen,
    Ubuntu, Cantarell, "Open Sans", "Helvetica Neue", sans-serif;
  line-height: 1.6;
  color: var(--gray-800);
  background-color: var(--gray-100);
}

.mbd-dashboard-container {
  max-width: 1200px;
  margin: 2rem auto;
  padding: 0 1rem;
}

/* Header */
.mbd-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 2rem;
  padding: 1.5rem;
  background: white;
  border-radius: var(--border-radius);
  box-shadow: var(--shadow);
}

.mbd-user-info {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.mbd-user-avatar {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  object-fit: cover;
}

.mbd-header h2 {
  margin: 0;
  font-size: 1.5rem;
  font-weight: 600;
}

.mbd-header p {
  margin: 0;
  color: var(--gray-500);
}

.mbd-header-actions {
  display: flex;
  gap: 0.75rem;
}

/* Stats Cards */
.mbd-stats-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
  margin-bottom: 2rem;
}

.mbd-stat-card {
  display: flex;
  align-items: center;
  padding: 1.5rem;
  background: white;
  border-radius: var(--border-radius);
  box-shadow: var(--shadow);
}

.mbd-stat-icon {
  font-size: 2rem;
  margin-right: 1rem;
}

.mbd-stat-content h3 {
  margin: 0;
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--primary);
}

.mbd-stat-content p {
  margin: 0;
  color: var(--gray-500);
  font-size: 0.875rem;
}

/* Tabs */
.mbd-tabs {
  display: flex;
  border-bottom: 1px solid var(--gray-200);
  margin-bottom: 1.5rem;
}

.mbd-tab-link {
  padding: 0.75rem 1.5rem;
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  font-size: 1rem;
  font-weight: 500;
  color: var(--gray-500);
  cursor: pointer;
  transition: all 0.2s;
}

.mbd-tab-link:hover {
  color: var(--primary);
}

.mbd-tab-link.active {
  color: var(--primary);
  border-bottom-color: var(--primary);
}

.mbd-tab-content {
  display: none;
}

.mbd-tab-content.active {
  display: block;
}

/* Cards */
.mbd-card {
  background: white;
  border-radius: var(--border-radius);
  box-shadow: var(--shadow);
  padding: 1.5rem;
  margin-bottom: 1.5rem;
}

.mbd-card h3 {
  margin-top: 0;
  margin-bottom: 1.5rem;
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--gray-800);
}

/* Forms */
.mbd-form-group {
  margin-bottom: 1.25rem;
}

.mbd-form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

.mbd-form-group label {
  display: block;
  margin-bottom: 0.5rem;
  font-weight: 500;
  color: var(--gray-700);
}

.mbd-form-group input,
.mbd-form-group textarea,
.mbd-form-group select {
  width: 100%;
  padding: 0.75rem;
  border: 1px solid var(--gray-300);
  border-radius: var(--border-radius);
  font-size: 1rem;
  transition: border-color 0.2s;
}

.mbd-form-group input:focus,
.mbd-form-group textarea:focus,
.mbd-form-group select:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
}

.mbd-form-group textarea {
  min-height: 100px;
  resize: vertical;
}

select[multiple] {
  height: auto;
  min-height: 120px;
}

/* Buttons */
.mbd-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.75rem 1.5rem;
  border: none;
  border-radius: var(--border-radius);
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
  text-decoration: none;
}

.mbd-btn-primary {
  background: var(--primary);
  color: white;
}

.mbd-btn-primary:hover {
  background: var(--primary-hover);
}

.mbd-btn-secondary {
  background: var(--gray-200);
  color: var(--gray-700);
}

.mbd-btn-secondary:hover {
  background: var(--gray-300);
}

.mbd-btn-danger {
  background: var(--danger);
  color: white;
}

.mbd-btn-danger:hover {
  background: #dc2626;
}

.mbd-btn-logout {
  background: var(--gray-100);
  color: var(--gray-700);
}

.mbd-btn-logout:hover {
  background: var(--gray-200);
}

.mbd-btn-small {
  padding: 0.5rem 1rem;
  font-size: 0.8125rem;
}

.mbd-btn-block {
  width: 100%;
}

/* Image Upload */
.mbd-image-upload {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.mbd-image-preview {
  margin-top: 0.5rem;
}

.mbd-image-preview img {
  max-width: 200px;
  max-height: 200px;
  border-radius: var(--border-radius);
}

/* Posts List */
.mbd-posts-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.5rem;
}

.mbd-search-box input {
  padding: 0.5rem 1rem;
  border: 1px solid var(--gray-300);
  border-radius: var(--border-radius);
  font-size: 0.875rem;
}

.mbd-post-filters {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 1.5rem;
}

.mbd-filter-btn {
  padding: 0.5rem 1rem;
  background: var(--gray-100);
  border: 1px solid var(--gray-300);
  border-radius: var(--border-radius);
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--gray-600);
  cursor: pointer;
  transition: all 0.2s;
}

.mbd-filter-btn:hover,
.mbd-filter-btn.active {
  background: var(--primary);
  color: white;
  border-color: var(--primary);
}

.mbd-posts-list {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.mbd-post-item {
  display: flex;
  padding: 1rem;
  border: 1px solid var(--gray-200);
  border-radius: var(--border-radius);
  transition: all 0.2s;
}

.mbd-post-item:hover {
  border-color: var(--primary);
  box-shadow: var(--shadow);
}

.mbd-post-thumb {
  flex: 0 0 100px;
  margin-right: 1rem;
}

.mbd-post-thumb img {
  width: 100px;
  height: 80px;
  object-fit: cover;
  border-radius: var(--border-radius);
}

.mbd-no-thumb {
  width: 100px;
  height: 80px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--gray-100);
  border-radius: var(--border-radius);
  color: var(--gray-400);
  font-size: 0.75rem;
}

.mbd-post-info {
  flex: 1;
}

.mbd-post-title {
  margin: 0 0 0.5rem 0;
  font-size: 1.125rem;
  font-weight: 600;
}

.mbd-post-title a {
  color: var(--gray-800);
  text-decoration: none;
}

.mbd-post-title a:hover {
  color: var(--primary);
}

.mbd-post-meta {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 0.5rem;
  font-size: 0.875rem;
  color: var(--gray-500);
}

.mbd-post-status {
  padding: 0.25rem 0.5rem;
  border-radius: 9999px;
  font-size: 0.75rem;
  font-weight: 500;
}

.mbd-post-status.publish {
  background: #d1fae5;
  color: #065f46;
}

.mbd-post-status.pending {
  background: #fef3c7;
  color: #92400e;
}

.mbd-post-status.draft {
  background: #e5e7eb;
  color: #374151;
}

.mbd-post-views {
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

.mbd-post-excerpt {
  font-size: 0.875rem;
  color: var(--gray-600);
  margin-bottom: 0;
}

.mbd-post-actions {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

/* Empty State */
.mbd-empty-state {
  text-align: center;
  padding: 3rem 1rem;
  color: var(--gray-500);
}

.mbd-empty-state p {
  margin: 0;
}

.mbd-empty-state p:first-child {
  font-size: 1.125rem;
  font-weight: 500;
  margin-bottom: 0.5rem;
}

/* Pagination */
.mbd-pagination {
  display: flex;
  justify-content: center;
  margin-top: 2rem;
}

.mbd-pagination .page-numbers {
  display: flex;
  gap: 0.5rem;
}

.mbd-pagination a,
.mbd-pagination span {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2.5rem;
  height: 2.5rem;
  border-radius: var(--border-radius);
  font-size: 0.875rem;
  font-weight: 500;
  text-decoration: none;
}

.mbd-pagination a {
  background: white;
  border: 1px solid var(--gray-300);
  color: var(--gray-700);
}

.mbd-pagination a:hover {
  background: var(--primary);
  border-color: var(--primary);
  color: white;
}

.mbd-pagination span.current {
  background: var(--primary);
  color: white;
}

/* Modals */
.mbd-modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  z-index: 1000;
  overflow-y: auto;
}

.mbd-modal-content {
  position: relative;
  background: white;
  margin: 2rem auto;
  max-width: 800px;
  border-radius: var(--border-radius);
  box-shadow: var(--shadow-lg);
}

.mbd-modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.5rem;
  border-bottom: 1px solid var(--gray-200);
}

.mbd-modal-header h3 {
  margin: 0;
}

.mbd-modal-close {
  font-size: 1.5rem;
  cursor: pointer;
  color: var(--gray-500);
}

.mbd-modal-close:hover {
  color: var(--gray-700);
}

.mbd-modal-body {
  padding: 1.5rem;
}

.mbd-modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.75rem;
  margin-top: 1.5rem;
}

/* Notifications */
.mbd-notification {
  position: fixed;
  top: 1rem;
  right: 1rem;
  padding: 1rem 1.5rem;
  border-radius: var(--border-radius);
  box-shadow: var(--shadow-lg);
  color: white;
  z-index: 1001;
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-width: 300px;
  animation: slideIn 0.3s ease;
}

.mbd-notification-success {
  background: var(--success);
}

.mbd-notification-error {
  background: var(--danger);
}

.mbd-notification-warning {
  background: var(--warning);
}

.mbd-notification-close {
  margin-left: 1rem;
  cursor: pointer;
  font-weight: bold;
}

@keyframes slideIn {
  from {
    transform: translateX(100%);
    opacity: 0;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}

/* Auth Styles */
.mbd-auth-container {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 80vh;
  padding: 2rem 1rem;
}

.mbd-auth-form {
  width: 100%;
  max-width: 400px;
  padding: 2rem;
  background: white;
  border-radius: var(--border-radius);
  box-shadow: var(--shadow-lg);
}

.mbd-auth-form h2 {
  margin-top: 0;
  margin-bottom: 1.5rem;
  text-align: center;
  font-size: 1.5rem;
  font-weight: 600;
  color: var(--gray-800);
}

.mbd-auth-links {
  display: flex;
  justify-content: center;
  gap: 0.5rem;
  margin-top: 1.5rem;
  font-size: 0.875rem;
  color: var(--gray-500);
}

.mbd-auth-links a {
  color: var(--primary);
  text-decoration: none !important;
}

.mbd-auth-links a:hover {
  text-decoration: underline;
}

/* Responsive */
@media (max-width: 768px) {
  .mbd-header {
    flex-direction: column;
    gap: 1rem;
    text-align: center;
  }

  .mbd-user-info {
    flex-direction: column;
    text-align: center;
  }

  .mbd-header-actions {
    justify-content: center;
  }

  .mbd-form-row {
    grid-template-columns: 1fr;
  }

  .mbd-post-item {
    flex-direction: column;
  }

  .mbd-post-thumb {
    margin-right: 0;
    margin-bottom: 1rem;
  }

  .mbd-post-actions {
    flex-direction: row;
    justify-content: flex-end;
    margin-top: 1rem;
  }

  .mbd-stats-cards {
    grid-template-columns: 1fr;
  }

  .mbd-tabs {
    overflow-x: auto;
    white-space: nowrap;
  }
}

/* WordPress Editor Overrides */
.wp-editor-container {
  border: 1px solid var(--gray-300);
  border-radius: var(--border-radius);
}

.wp-editor-tools {
  padding: 0.5rem;
  background: var(--gray-100);
  border-bottom: 1px solid var(--gray-300);
}

.wp-editor-area {
  border: none !important;
  padding: 1rem !important;
}

/* Custom select2 style for categories */
.select2-container--default .select2-selection--multiple {
  border: 1px solid var(--gray-300) !important;
  border-radius: var(--border-radius) !important;
  min-height: 42px !important;
}

.select2-container--default
  .select2-selection--multiple
  .select2-selection__choice {
  background: var(--primary) !important;
  border: none !important;
  border-radius: 9999px !important;
  color: white !important;
  padding: 0.25rem 0.5rem !important;
  font-size: 0.75rem !important;
}
