/**
 * ProRank Design System - Reset & Base Styles
 * 
 * Browser resets, WordPress overrides, and base page structure.
 * These styles ensure a consistent starting point across all pages.
 * 
 * @module core/reset
 * @since 3.0.0
 */

/* ============================================
   UNIVERSAL RESET
   Apply box-sizing globally for predictable layouts
   ============================================ */

* {
  box-sizing: border-box;
}

/* ============================================
   BASE PAGE STRUCTURE
   Foundation styles for ProRank admin pages
   ============================================ */

.prorank-page {
  margin: 0;
  width: 100%;
  max-width: 100%;
  overflow-x: visible; /* Allow header to extend full width */
  box-sizing: border-box;
  padding: 0;
  background: transparent !important; /* Override WP admin background */
  position: relative;
}

/* Ensure WordPress wrap container doesn't add unwanted spacing */
.wrap {
  margin: 0 !important;
  padding: 0 !important;
}

/* Remove WordPress admin padding from content area */
#wpbody-content {
  padding-bottom: 0;
}

#wpbody-content > .wrap {
  margin: 0 !important;
  padding: 0 !important;
}

.prorank-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 20px;
  animation: fadeIn 0.3s ease;
  background: transparent !important; /* Override WP admin background */
}

/* ============================================
   WORDPRESS ADMIN OVERRIDES
   Hide default WordPress elements that conflict with ProRank UI
   ============================================ */

/* Hide default WordPress page titles */
.toplevel_page_prorank-seo .wrap > h1:first-child,
.prorank-seo_page_prorank-dashboard .wrap > h1:first-child,
.prorank-seo_page_prorank-on-page-seo .wrap > h1:first-child,
.prorank-seo_page_prorank-performance .wrap > h1:first-child,
.prorank-seo_page_prorank-technical-seo .wrap > h1:first-child,
.prorank-seo_page_prorank-analytics .wrap > h1:first-child,
.prorank-seo_page_prorank-ai-tools .wrap > h1:first-child,
.prorank-seo_page_prorank-ecommerce-seo .wrap > h1:first-child,
.prorank-seo_page_prorank-agency-hub .wrap > h1:first-child,
.prorank-seo_page_prorank-local-seo .wrap > h1:first-child,
.prorank-seo_page_prorank-internal-linking .wrap > h1:first-child,
.prorank-seo_page_prorank-site-audit .wrap > h1:first-child,
.prorank-seo_page_prorank-support .wrap > h1:first-child,
.prorank-seo_page_prorank-import-export .wrap > h1:first-child,
.wrap > .wp-heading-inline,
#wpbody-content > .wrap > h1:first-child {
  display: none !important;
}

/* ============================================
   ANIMATION KEYFRAMES
   Base animations used throughout the system
   ============================================ */

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

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

@keyframes pulse {
  0%, 100% {
    opacity: 1;
  }
  50% {
    opacity: 0.5;
  }
}

@keyframes slideInRight {
  from {
    transform: translateX(100%);
    opacity: 0;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}

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

/* ============================================
   ACCESSIBILITY
   Base styles for screen readers and focus states
   ============================================ */

.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;
}

/* Focus visible for keyboard navigation */
:focus-visible {
  outline: 2px solid var(--prorank-primary);
  outline-offset: 2px;
}

/* Remove focus for mouse users */
:focus:not(:focus-visible) {
  outline: none;
}

/* ============================================
   PRINT STYLES
   Optimize for printing
   ============================================ */

@media print {
  .prorank-header,
  .prorank-tab-navigation,
  .prorank-toolbar,
  .prorank-btn,
  .prorank-modal {
    display: none !important;
  }
  
  .prorank-card {
    box-shadow: none;
    border: 1px solid #ddd;
    page-break-inside: avoid;
  }
}
