/* 
 * MyPost2 Admin CSS - Shared Components
 * Modern, responsive design for WordPress admin
 */

/* ==== WORDPRESS ADMIN INTEGRATION ==== */

@import url('https://fonts.googleapis.com/css?family=Dashicons');

:root {
  /* MyPost2 Color Palette */
  --mp2-primary: #0073aa;
  --mp2-primary-hover: #005a87;
  --mp2-secondary: #00a32a;
  --mp2-secondary-hover: #008a20;
  --mp2-accent: #8b5cf6;
  --mp2-accent-hover: #7c3aed;
  --mp2-warning: #f39c12;
  --mp2-warning-hover: #e67e22;
  --mp2-danger: #d63638;
  --mp2-danger-hover: #b32d2e;
  
  /* Neutrals */
  --mp2-gray-50: #f8f9fa;
  --mp2-gray-100: #f1f3f4;
  --mp2-gray-200: #e1e4e8;
  --mp2-gray-300: #d1d5db;
  --mp2-gray-400: #9ca3af;
  --mp2-gray-500: #6b7280;
  --mp2-gray-600: #4b5563;
  --mp2-gray-700: #374151;
  --mp2-gray-800: #1f2937;
  --mp2-gray-900: #111827;
  
  /* Status Colors */
  --mp2-success: #d1e7dd;
  --mp2-success-text: #0a3622;
  --mp2-info: #e7f3ff;
  --mp2-info-text: #0073aa;
  --mp2-warning-bg: #fff3cd;
  --mp2-warning-text: #856404;
  --mp2-error: #f8d7da;
  --mp2-error-text: #721c24;
  
  /* Spacing */
  --mp2-space-xs: 0.25rem;
  --mp2-space-sm: 0.5rem;
  --mp2-space-md: 1rem;
  --mp2-space-lg: 1.5rem;
  --mp2-space-xl: 1rem;
  --mp2-space-2xl: 3rem;
  
  /* Border Radius */
  --mp2-radius-sm: 0.25rem;
  --mp2-radius-md: 0.375rem;
  --mp2-radius-lg: 0.5rem;
  --mp2-radius-xl: 0.75rem;
  
  /* Shadows */
  --mp2-shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
  --mp2-shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
  --mp2-shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
  
  /* Typography */
  --mp2-font-size-xs: 0.75rem;
  --mp2-font-size-sm: 0.875rem;
  --mp2-font-size-base: 1rem;
  --mp2-font-size-lg: 1.125rem;
  --mp2-font-size-xl: 1.25rem;
  --mp2-font-size-2xl: 1.5rem;
  --mp2-font-size-3xl: 2rem;
}

/* Override WordPress core body background on MyPost2 pages */
body.toplevel_page_mypost2-dashboard,
body.mypost2_page_mypost2-browseposts,
body.mypost2_page_mypost2-pool,
body.mypost2_page_mypost2-analytics,
body.mypost2_page_mypost2-reposts,
body.mypost2_page_mypost2-billing,
body.mypost2_page_mypost2-shortlinks,
body.mypost2_page_mypost2-settings {
    /*background: linear-gradient(to right, #ffffff 0%, #9ca3af 100%) !important;*/
}

/* Ensure gradient appears on all MyPost2 pages */
body[class*="mypost2"] #wpbody-content,
body.toplevel_page_mypost2 #wpbody-content {
    /*background: linear-gradient(to right, #ffffff 0%, #9ca3af 100%) !important;*/
    min-height: 100vh;
}

/* ==== LAYOUT COMPONENTS ==== */

.mp2-analytics-header h1 {
  font-size: var(--mp2-font-size-3xl);
  font-weight: 700;
  color: var(--mp2-gray-800);
  margin: 0 0 var(--mp2-space-sm) 0;
}

/* ==== SECTIONS ==== */

.mp2-section {
  background: rgba(255, 255, 255, 0.85); /* Changed to semi-transparent */
  margin: var(--mp2-space-lg) 0;
  border-radius: var(--mp2-radius-lg);
  box-shadow: var(--mp2-shadow-sm);
  border: 0px solid var(--mp2-gray-200);
  overflow: hidden;
  backdrop-filter: blur(2px); /* Optional: adds frosted glass effect */
}

/* Add this for header transparency */
.mp2-section h2 {
  background: rgba(255, 255, 255, 0.85); /* Semi-transparent navajowhite */
}

.mp2-section h2 {
  background: linear-gradient(135deg, #0489cc 0%, #72cbf7 100%);
  padding: var(--mp2-space-md);
  margin: 0;
  border-bottom: 0px solid var(--mp2-gray-200);
  font-size: var(--mp2-font-size-xl);
  font-weight: 700;
  color: var(--mp2-gray-800);
}

.mp2-section-content {
  padding: var(--mp2-space-lg);
}

.mp2-section-content p {
  margin: 0 0 var(--mp2-space-md) 0;
  line-height: 1.6;
}

.mp2-section-content p:last-child {
  margin-bottom: 0;
}

/* Filter form styling */
.mp2-section-content form {
  display: flex;
  gap: 15px;
  align-items: end;
  flex-wrap: wrap;
}

.mp2-section-content form > div {
  display: flex;
  flex-direction: column;
}

.mp2-section-content form label {
  font-weight: 600;
  margin-bottom: 5px;
  color: var(--mp2-gray-700);
}

.mp2-section-content form select,
.mp2-section-content form input[type="text"] {
  padding: 5px;
  min-width: 150px;
  padding-right: 25px;
  border: 1px solid var(--mp2-gray-300);
  border-radius: var(--mp2-radius-md);
}

/* Table container */
.mp2-table-container {
  margin: 0;
  overflow-x: auto;
}

/* Override WordPress table styles */
.wp-list-table.mp2-table {
  border-collapse: collapse;
  width: 100%;
  margin: 0;
  background: white;
}

.wp-list-table.mp2-table th,
.wp-list-table.mp2-table td {
  border: none;
  border-bottom: 1px solid var(--mp2-gray-100);
  padding: var(--mp2-space-md);
}

.wp-list-table.mp2-table thead th {
  background: var(--mp2-gray-200) !important;
  color: var(--mp2-gray-700) !important;
  font-weight: 600 !important;
  border-bottom: 2px solid var(--mp2-gray-200) !important;
}

.wp-list-table.mp2-table tbody tr:hover {
  background: var(--mp2-gray-50) !important;
}

.wp-list-table.mp2-table tbody tr:last-child td {
  border-bottom: none;
}

/* No data message */
.mp2-no-data {
  text-align: center;
  padding: var(--mp2-space-2xl);
  color: var(--mp2-gray-500);
}

.mp2-no-data h3 {
  margin: 0 0 var(--mp2-space-md) 0;
  color: var(--mp2-gray-700);
}

.mp2-no-data p {
  margin: 0 0 var(--mp2-space-sm) 0;
}

/* Category color helpers */
.mp2-category-badge {
  background: #f1f1f1;
  color: #333;
  padding: 4px 8px;
  border-radius: 4px;
  font-size: 11px;
  margin-right: 3px;
  font-weight: normal;
  display: inline-block;
}


.mp2-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 var(--mp2-space-md);
}

/* Browse Posts specific styles */
.mp2-browse-header {
  margin-bottom: var(--mp2-space-lg);
}

.mp2-browse-header h1 {
  font-size: var(--mp2-font-size-3xl);
  font-weight: 700;
  color: var(--mp2-gray-800);
  margin: 0 0 var(--mp2-space-sm) 0;
}

.mp2-browse-header p {
  font-size: var(--mp2-font-size-lg);
  font-style: italic;
  font-weight: 700;
  color: var(--mp2-gray-700);
  margin: 0;
}

/* Pool status styling */
.mp2-pool-status {
  background: var(--mp2-success);
  border: 1px solid #c3e6cb;
  border-radius: var(--mp2-radius-lg);
  padding: var(--mp2-space-lg);
  margin: var(--mp2-space-lg) 0;
}

.mp2-pool-status h2 {
  color: var(--mp2-success-text);
  margin: 0 0 var(--mp2-space-md) 0;
  font-size: var(--mp2-font-size-xl);
}

.mp2-pool-status p {
  color: var(--mp2-success-text);
  margin: 0;
  font-size: var(--mp2-font-size-lg);
}

.mp2-pool-count {
  font-size: 1.5rem;
  color: #00a32a;
  font-weight: bold;
}

.mp2-grid {
  display: grid;
  gap: var(--mp2-space-lg);
}

.mp2-grid-2 {
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
}

.mp2-grid-3 {
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
}

.mp2-grid-4 {
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
}

.mp2-flex {
  display: flex;
  gap: var(--mp2-space-md);
}

.mp2-flex-wrap {
  flex-wrap: wrap;
}

.mp2-flex-center {
  align-items: center;
  justify-content: center;
}

.mp2-flex-between {
  align-items: center;
  justify-content: space-between;
}

/* Overview stats specific styling */
.mp2-overview-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: var(--mp2-space-lg);
  margin: var(--mp2-space-xl) 0;
}

.mp2-stat-card {
  background: white;
  padding: var(--mp2-space-lg);
  border-radius: var(--mp2-radius-lg);
  box-shadow: var(--mp2-shadow-sm);
  text-align: center;
  border: 1px solid var(--mp2-gray-200);
  transition: all 0.2s ease;
}

.mp2-stat-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--mp2-shadow-md);
}

.mp2-stat-card h3 {
  font-size: var(--mp2-font-size-2xl);
  font-weight: 700;
  margin: 0 0 var(--mp2-space-sm) 0;
  color: var(--mp2-primary);
}

.mp2-stat-card p {
  margin: 0;
  color: var(--mp2-gray-600);
  font-weight: 600;
}

.mp2-existing-reposts-table tbody tr {
    height: 45px;
}

.mp2-existing-reposts-table tbody td {
    padding: 0px 10px;
    vertical-align: middle;
}

/* ==== BUTTONS ==== */

.mp2-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: var(--mp2-space-sm) var(--mp2-space-md);
  border: none;
  border-radius: var(--mp2-radius-md);
  font-size: var(--mp2-font-size-sm);
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  transition: all 0.2s ease;
  line-height: 1;
}

.mp2-btn:hover {
  transform: translateY(-1px);
  box-shadow: var(--mp2-shadow-sm);
}

.mp2-btn:active {
  transform: translateY(0);
}

.mp2-btn-primary {
  background: var(--mp2-primary);
  color: white;
}

.mp2-btn-primary:hover {
  background: var(--mp2-primary-hover);
  color: white;
}

.mp2-btn-secondary {
  background: var(--mp2-secondary);
  color: white;
}

.mp2-btn-secondary:hover {
  background: var(--mp2-secondary-hover);
  color: white;
}

.mp2-btn-accent {
  background: var(--mp2-accent);
  color: white;
}

.mp2-btn-accent:hover {
  background: var(--mp2-accent-hover);
  color: white;
}

.mp2-btn-outline {
  background: transparent;
  color: var(--mp2-primary);
  border: 1px solid var(--mp2-primary);
}

.mp2-btn-outline:hover {
  background: var(--mp2-primary);
  color: white;
}

.mp2-btn-small {
  padding: var(--mp2-space-xs) var(--mp2-space-sm);
  font-size: var(--mp2-font-size-xs);
}

.mp2-btn-large {
  padding: var(--mp2-space-md) var(--mp2-space-xl);
  font-size: var(--mp2-font-size-lg);
}

/* ==== FORM ELEMENTS ==== */

.mp2-form-group {
  margin-bottom: var(--mp2-space-lg);
}

.mp2-label {
  display: block;
  font-weight: 600;
  color: var(--mp2-gray-700);
  margin-bottom: var(--mp2-space-sm);
}

.mp2-input {
  width: 100%;
  padding: var(--mp2-space-sm) var(--mp2-space-md);
  border: 1px solid var(--mp2-gray-300);
  border-radius: var(--mp2-radius-md);
  font-size: var(--mp2-font-size-sm);
  transition: border-color 0.2s ease;
}

.mp2-input:focus {
  outline: none;
  border-color: var(--mp2-primary);
  box-shadow: 0 0 0 3px rgb(0 115 170 / 0.1);
}

.mp2-select {
  width: 100%;
  padding: var(--mp2-space-sm) var(--mp2-space-md);
  border: 1px solid var(--mp2-gray-300);
  border-radius: var(--mp2-radius-md);
  font-size: var(--mp2-font-size-sm);
  background: white;
  cursor: pointer;
}

.mp2-select:focus {
  outline: none;
  border-color: var(--mp2-primary);
  box-shadow: 0 0 0 3px rgb(0 115 170 / 0.1);
}

/* ==== TABLES ==== */

.mp2-table {
  width: 100%;
  border-collapse: collapse;
  background: white;
  border-radius: var(--mp2-radius-lg);
  overflow: hidden;
  box-shadow: var(--mp2-shadow-sm);
}

.mp2-table thead {
  background: var(--mp2-gray-50);
}

.mp2-table th {
  padding: var(--mp2-space-md);
  text-align: left;
  font-weight: 600;
  color: var(--mp2-gray-700);
  border-bottom: 1px solid var(--mp2-gray-200);
  font-size: var(--mp2-font-size-sm);
}

.mp2-table td {
  padding: var(--mp2-space-md);
  border-bottom: 1px solid var(--mp2-gray-100);
  font-size: var(--mp2-font-size-sm);
}

.mp2-table tbody tr:hover {
  background: var(--mp2-gray-50);
}

.mp2-table tbody tr:last-child td {
  border-bottom: none;
}

/* ==== SELECTIVE BULK ACTIONS ==== */

/* Checkbox column styling */
.mp2-checkbox-col {
  width: 40px;
  text-align: center;
  padding: var(--mp2-space-sm) !important;
}

/* Custom checkbox styling */
.mp2-checkbox {
  width: 18px;
  height: 18px;
  cursor: pointer;
  accent-color: var(--mp2-primary);
  margin: 0;
}

/* Mobile-optimized checkboxes */
@media (max-width: 768px) {
  .mp2-checkbox {
    width: 22px;
    height: 22px;
    transform: scale(1.2);
  }
  
  .mp2-checkbox-col {
    width: 50px;
    padding: var(--mp2-space-md) !important;
  }
}

/* Selected row highlighting */
.mp2-table tbody tr.mp2-selected {
  background: rgba(0, 115, 170, 0.1) !important;
  border-left: 3px solid var(--mp2-primary);
}

.mp2-table tbody tr.mp2-selected:hover {
  background: rgba(0, 115, 170, 0.15) !important;
}

/* Selection counter and controls */
.mp2-selection-controls {
  background: var(--mp2-info);
  border: 1px solid var(--mp2-primary);
  border-radius: var(--mp2-radius-md);
  padding: var(--mp2-space-md);
  margin: var(--mp2-space-md) 0;
  display: none; /* Hidden by default, shown when items selected */
  align-items: center;
  gap: var(--mp2-space-md);
  flex-wrap: wrap;
}

.mp2-selection-controls.mp2-active {
  display: flex;
}

.mp2-selection-info {
  font-weight: 600;
  color: var(--mp2-primary);
  flex: 1;
  min-width: 200px;
}

.mp2-selection-actions {
  display: flex;
  gap: var(--mp2-space-sm);
  flex-wrap: wrap;
}

/* Enhanced bulk action buttons */
.mp2-bulk-btn {
  background: var(--mp2-secondary);
  color: white;
  border: none;
  padding: var(--mp2-space-sm) var(--mp2-space-md);
  border-radius: var(--mp2-radius-md);
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
  font-size: var(--mp2-font-size-sm);
}

.mp2-bulk-btn:hover {
  background: var(--mp2-secondary-hover);
  transform: translateY(-1px);
}

.mp2-bulk-btn:disabled {
  background: var(--mp2-gray-400);
  cursor: not-allowed;
  transform: none;
}

.mp2-bulk-btn-secondary {
  background: var(--mp2-gray-500);
}

.mp2-bulk-btn-secondary:hover {
  background: var(--mp2-gray-600);
}

/* Select all controls in header */
.mp2-select-all-controls {
  display: flex;
  align-items: center;
  gap: var(--mp2-space-xs);
  font-size: var(--mp2-font-size-xs);
  color: var(--mp2-gray-600);
}

/* Mobile selection controls */
@media (max-width: 768px) {
  .mp2-selection-controls {
    flex-direction: column;
    align-items: stretch;
    text-align: center;
  }
  
  .mp2-selection-info {
    min-width: auto;
    margin-bottom: var(--mp2-space-sm);
  }
  
  .mp2-selection-actions {
    justify-content: center;
  }
  
  .mp2-bulk-btn {
    padding: 12px 16px;
    font-size: 16px;
    min-height: 44px;
  }
}

/* Checkbox accessibility */
.mp2-checkbox:focus {
  outline: 2px solid var(--mp2-primary);
  outline-offset: 2px;
}

/* Loading state for selected rows */
.mp2-table tbody tr.mp2-selected.mp2-table-loading {
  background: rgba(0, 115, 170, 0.05) !important;
}

/* ==== BADGES & TAGS ==== */

.mp2-badge {
  display: inline-flex;
  align-items: center;
  padding: var(--mp2-space-xs) var(--mp2-space-sm);
  border-radius: var(--mp2-radius-sm);
  font-size: var(--mp2-font-size-xs);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.025em;
}

.mp2-badge-primary {
  background: var(--mp2-primary);
  color: white;
}

.mp2-badge-secondary {
  background: var(--mp2-secondary);
  color: white;
}

.mp2-badge-warning {
  background: var(--mp2-warning);
  color: white;
}

.mp2-badge-danger {
  background: var(--mp2-danger);
  color: white;
}

.mp2-badge-gray {
  background: var(--mp2-gray-200);
  color: var(--mp2-gray-700);
}

/* ==== ALERTS & NOTICES ==== */

.mp2-alert {
  padding: var(--mp2-space-md);
  border-radius: var(--mp2-radius-lg);
  border-left: 4px solid;
  margin: var(--mp2-space-lg) 0;
}

.mp2-alert h3 {
  margin: 0 0 var(--mp2-space-sm) 0;
  font-size: var(--mp2-font-size-lg);
  font-weight: 600;
}

.mp2-alert p {
  margin: 0;
  font-size: var(--mp2-font-size-sm);
}

.mp2-alert-success {
  background: var(--mp2-success);
  color: var(--mp2-success-text);
  border-left-color: var(--mp2-secondary);
}

.mp2-alert-info {
  background: var(--mp2-info);
  color: var(--mp2-info-text);
  border-left-color: var(--mp2-primary);
}

.mp2-alert-warning {
  background: var(--mp2-warning-bg);
  color: var(--mp2-warning-text);
  border-left-color: var(--mp2-warning);
}

.mp2-alert-error {
  background: var(--mp2-error);
  color: var(--mp2-error-text);
  border-left-color: var(--mp2-danger);
}

/* ==== MODALS ==== */

.mp2-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  z-index: 9999;
  display: none;
  align-items: center;
  justify-content: center;
  padding: var(--mp2-space-lg);
}

.mp2-modal.active {
  display: flex;
}

.mp2-modal-content {
  background: white;
  border-radius: var(--mp2-radius-lg);
  width: 100%;
  max-width: 500px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: var(--mp2-shadow-lg);
  animation: modalSlideIn 0.3s ease;
}

@keyframes modalSlideIn {
  from {
    opacity: 0;
    transform: scale(0.9) translateY(-20px);
  }
  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

.mp2-modal-header {
  padding: var(--mp2-space-lg);
  border-bottom: 1px solid var(--mp2-gray-200);
}

.mp2-modal-header h2 {
  margin: 0;
  font-size: var(--mp2-font-size-xl);
  color: var(--mp2-gray-800);
}

.mp2-modal-body {
  padding: var(--mp2-space-lg);
}

.mp2-modal-footer {
  padding: var(--mp2-space-lg);
  border-top: 1px solid var(--mp2-gray-200);
  display: flex;
  gap: var(--mp2-space-md);
  justify-content: flex-end;
}

/* ==== LOADING STATES ==== */

.mp2-loading-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(255, 255, 255, 0.2);
  z-index: 9998;
  display: flex;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(2px);
}

.mp2-loading-spinner {
  width: 80px;
  height: 80px;
  border: 10px solid var(--mp2-gray-200);
  border-top: 10px solid #a80818;
  border-radius: 50%;
  animation: mp2-spin 1s linear infinite;
}

.mp2-loading-content {
  text-align: center;
  color: var(--mp2-gray-700);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.mp2-loading-text {
  margin-top: var(--mp2-space-md);
  background: white;
  padding: 12px 20px; /* 🆕 Add this for larger background */
  border-radius: 6px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
  font-weight: 600;
  font-size: var(--mp2-font-size-xl);
  text-align: center;
  color: #000 !important;
}

@keyframes mp2-spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}


.mp2-table-loading {
  opacity: 0.5;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.mp2-button-loading {
  opacity: 0.7;
  pointer-events: none;
  position: relative;
}

.mp2-button-loading::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 16px;
  height: 16px;
  margin: -8px 0 0 -8px;
  border: 2px solid transparent;
  border-top: 2px solid currentColor;
  border-radius: 50%;
  animation: mp2-spin 1s linear infinite;
}

/* Page-specific loading states */
.mp2-page-loading {
  position: relative;
}

.mp2-page-loading::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(255, 255, 255, 0.8);
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* ==== ADDITIONAL RESPONSIVE & LAYOUT STYLES ==== */

/* Enhanced Mobile Responsiveness */
@media (max-width: 768px) {
  /* Filter forms - better mobile layout */
  .mp2-section-content form {
    flex-direction: column;
    align-items: stretch;
    gap: var(--mp2-space-md);
  }
  
  .mp2-section-content form > div {
    width: 100%;
  }
  
  .mp2-section-content form select,
  .mp2-section-content form input[type="text"] {
    min-width: 100%;
    padding: 12px; /* Larger touch targets */
  }
  
  /* Section spacing */
  .mp2-section-content {
    padding: var(--mp2-space-md);
  }
  
  /* Stat cards - mobile responsive */
  .mp2-overview-stats {
    grid-template-columns: 1fr;
    gap: var(--mp2-space-md);
  }
  
  .mp2-stat-card {
    padding: var(--mp2-space-md);
  }
  
  /* Mobile table improvements */
  .wp-list-table.mp2-table {
    font-size: 14px;
  }
  
  .wp-list-table.mp2-table th,
  .wp-list-table.mp2-table td {
    padding: var(--mp2-space-sm);
  }
  
  /* Mobile buttons */
  .button, .mp2-btn {
    padding: 12px 16px !important;
    font-size: 16px !important;
    min-height: 44px !important;
  }
  
  /* Mobile modal adjustments */
  .mp2-modal {
    padding: var(--mp2-space-md);
  }
  
  .mp2-modal-content {
    max-height: 95vh;
  }
  
  .mp2-modal-header,
  .mp2-modal-body,
  .mp2-modal-footer {
    padding: var(--mp2-space-md);
  }
}

/* Tablet adjustments */
@media (max-width: 1024px) and (min-width: 769px) {
  .mp2-overview-stats {
    grid-template-columns: repeat(2, 1fr);
  }
  
  .mp2-section-content form {
    gap: var(--mp2-space-sm);
  }
}

/* Large screen enhancements */
@media (min-width: 1200px) {
  .mp2-container {
    max-width: 1400px;
  }
}

/* ==== JAVASCRIPT SUCCESS POPUPS ==== */

.mp2-success-popup {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--mp2-space-lg);
}

.mp2-success-popup-content {
  background: white;
  border-radius: var(--mp2-radius-lg);
  padding: var(--mp2-space-xl);
  max-width: 500px;
  width: 100%;
  text-align: center;
  box-shadow: var(--mp2-shadow-lg);
  animation: successSlideIn 0.4s ease;
}

@keyframes successSlideIn {
  from {
    opacity: 0;
    transform: scale(0.8) translateY(-30px);
  }
  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

.mp2-success-popup h2 {
  color: var(--mp2-secondary);
  margin: 0 0 var(--mp2-space-md) 0;
  font-size: var(--mp2-font-size-2xl);
}

.mp2-success-popup p {
  margin: 0 0 var(--mp2-space-lg) 0;
  color: var(--mp2-gray-700);
  font-size: var(--mp2-font-size-lg);
}

.mp2-success-popup .button {
  margin: 0 var(--mp2-space-sm);
  font-size: var(--mp2-font-size-base);
  padding: var(--mp2-space-md) var(--mp2-space-lg);
}

/* Mobile success popup adjustments */
@media (max-width: 768px) {
  .mp2-success-popup {
    padding: var(--mp2-space-md);
    align-items: flex-start;
    padding-top: 20vh;
  }
  
  .mp2-success-popup-content {
    padding: var(--mp2-space-lg);
  }
  
  .mp2-success-popup h2 {
    font-size: var(--mp2-font-size-xl);
  }
  
  .mp2-success-popup p {
    font-size: var(--mp2-font-size-base) !important;
    line-height: 1.6 !important;
  }
  
  .mp2-success-popup .button {
    padding: 15px 20px !important;
    font-size: 16px !important;
    min-height: 50px !important;
    width: 100% !important;
    margin-bottom: var(--mp2-space-sm) !important;
  }
  
  .mp2-success-popup > div > div:last-child {
    flex-direction: column !important;
    gap: var(--mp2-space-md) !important;
  }
}

/* Extra small screens */
@media (max-width: 480px) {
  .mp2-analytics-header h1,
  .mp2-browse-header h1 {
    font-size: var(--mp2-font-size-2xl);
  }
  
  .mp2-analytics-header p,
  .mp2-browse-header p {
    font-size: var(--mp2-font-size-base);
  }
  
  .mp2-stat-card {
    padding: var(--mp2-space-md);
  }
  
  .mp2-stat-card h3 {
    font-size: var(--mp2-font-size-xl);
  }
  
  /* Even larger touch targets for very small screens */
  .button, .mp2-btn {
    padding: 15px 20px !important;
    min-height: 50px !important;
  }
  
  /* Mobile table - stack important info */
  .wp-list-table.mp2-table {
    font-size: 14px;
  }
  
  .wp-list-table.mp2-table th:nth-child(3),
  .wp-list-table.mp2-table td:nth-child(3),
  .wp-list-table.mp2-table th:nth-child(4),
  .wp-list-table.mp2-table td:nth-child(4) {
    display: none; /* Hide less important columns on very small screens */
  }
}

/* Landscape mobile improvements */
@media (max-width: 768px) and (orientation: landscape) {
  .mp2-loading-overlay {
    align-items: flex-start;
    padding-top: 10vh;
  }
  
  .mp2-success-popup {
    align-items: flex-start !important;
    padding-top: 5vh !important;
  }
}

/* Touch-specific improvements */
@media (hover: none) and (pointer: coarse) {
  /* Better touch feedback */
  .button:hover,
  .mp2-btn:hover {
    transform: scale(0.98);
    transition: transform 0.1s ease;
  }
  
  .wp-list-table.mp2-table tbody tr:hover {
    background: var(--mp2-gray-100) !important;
  }
  
  /* Larger tap areas for table actions */
  .add-to-pool-btn,
  .remove-from-pool-btn,
  .create-repost-btn {
    min-height: 44px;
    padding: 12px 16px;
  }
}

/* Mobile body class enhancements */
.mp2-mobile .mp2-section-content {
  padding: var(--mp2-space-md);
}

.mp2-mobile .mp2-section h2 {
  padding: var(--mp2-space-md);
  font-size: var(--mp2-font-size-lg);
}

.mp2-mobile .button,
.mp2-mobile .mp2-btn {
  min-height: 44px;
  padding: 12px 16px;
  font-size: 16px;
}

/* Prevent zoom on input focus (iOS) */
input[type="text"],
input[type="email"],
input[type="search"],
select,
textarea {
  font-size: 16px;
}

/* High DPI screen adjustments */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
  .mp2-loading-spinner {
    border-width: 3px;
  }
  
  .mp2-section {
    border-width: 1px;
  }
}

/* Filter button styling */
.mp2-filter-actions {
  display: flex;
  gap: var(--mp2-space-sm);
  align-items: center;
  flex-wrap: wrap;
  margin-top: var(--mp2-space-md);
}

/* Pagination styling */
.mp2-pagination {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: var(--mp2-space-lg);
  padding-top: var(--mp2-space-lg);
  border-top: 1px solid var(--mp2-gray-200);
}

.mp2-pagination-info {
  color: var(--mp2-gray-600);
  font-weight: 600;
}

.mp2-pagination-controls {
  display: flex;
  gap: var(--mp2-space-sm);
  align-items: center;
}

/* Bulk actions styling */
.mp2-bulk-actions {
  background: var(--mp2-gray-50);
  padding: var(--mp2-space-md);
  border-radius: var(--mp2-radius-md);
  margin: var(--mp2-space-md) 0;
  border: 1px solid var(--mp2-gray-200);
}

.mp2-bulk-actions strong {
  color: var(--mp2-gray-700);
  margin-right: var(--mp2-space-md);
}

/* Success states */
.mp2-success-text {
  color: #00a32a;
  font-weight: bold;
}

.mp2-pool-since {
  color: #666;
  font-size: var(--mp2-font-size-xs);
}

/* ==== UTILITIES ==== */

.mp2-text-center {
  text-align: center;
}

.mp2-text-right {
  text-align: right;
}

.mp2-text-muted {
  color: var(--mp2-gray-500);
}

.mp2-text-small {
  font-size: var(--mp2-font-size-sm);
}

.mp2-text-xs {
  font-size: var(--mp2-font-size-xs);
}

.mp2-font-bold {
  font-weight: 700;
}

.mp2-font-semibold {
  font-weight: 600;
}

.mp2-mb-0 { margin-bottom: 0; }
.mp2-mb-1 { margin-bottom: var(--mp2-space-xs); }
.mp2-mb-2 { margin-bottom: var(--mp2-space-sm); }
.mp2-mb-3 { margin-bottom: var(--mp2-space-md); }
.mp2-mb-4 { margin-bottom: var(--mp2-space-lg); }

.mp2-mt-0 { margin-top: 0; }
.mp2-mt-1 { margin-top: var(--mp2-space-xs); }
.mp2-mt-2 { margin-top: var(--mp2-space-sm); }
.mp2-mt-3 { margin-top: var(--mp2-space-md); }
.mp2-mt-4 { margin-top: var(--mp2-space-lg); }

.mp2-p-0 { padding: 0; }
.mp2-p-1 { padding: var(--mp2-space-xs); }
.mp2-p-2 { padding: var(--mp2-space-sm); }
.mp2-p-3 { padding: var(--mp2-space-md); }
.mp2-p-4 { padding: var(--mp2-space-lg); }

.mp2-hidden {
  display: none;
}

.mp2-sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
/* ===== GRADIENT BOTTOM FIX ===== */
#wpfooter {
    background: transparent !important;
    position: relative;
    z-index: 1;
}

.clear {
    background: transparent !important;
}

#wpbody-content {
    min-height: calc(100vh - 32px);
    padding-bottom: 20px;
}

/* Fix for admin notice area */
#wpbody {
    background: transparent;
}

.wrap {
    position: relative;
    z-index: 2;
}

/* Fix for reposts table in reposts */
.mp2-existing-reposts-table {
    width: 100%;
    table-layout: fixed;
}

.mp2-existing-reposts-table th,
.mp2-existing-reposts-table td {
    padding: 10px;
    text-align: left;
    border-bottom: 1px solid #ddd;
}

.mp2-existing-reposts-table .mp2-col-title {
    width: 30%; /* Repost Title */
}

.mp2-existing-reposts-table .mp2-col-original {
    width: 30%; /* Original Post */
}

.mp2-existing-reposts-table .mp2-col-type {
    width: 5%; /* Type */
}

.mp2-existing-reposts-table .mp2-col-performance {
    width: 5%; /* Repost URL */
}

.mp2-existing-reposts-table .mp2-col-performance-status {
    width: 5%; /* Status */
}

.mp2-existing-reposts-table .mp2-col-activity {
    width: 10%; /* Created */
}

.mp2-existing-reposts-table .mp2-col-events {
    width: 5%; /* Clicks */
}

.mp2-existing-reposts-table .mp2-col-actions {
    width: 10%; /* Actions */
}

.mp2-boosted-icon {
    color: #00a32a !important;
    background: transparent !important;
    border: none !important;
}
