/**
 * Layout & Page Structure - Based on Original ProRank Unified Design
 * 
 * Premium page layout with the signature header design
 * From the original prorank-unified.css design
 * 
 * @since 3.0.0
 */

/* ============================================
   PAGE WRAPPER & BASE
   ============================================ */

.prorank-page,
.prorank-admin-page {
  --prorank-shell-navy: #0f172a;
  --prorank-shell-ink: #111f36;
  --prorank-shell-blue: #1a355f;
  --prorank-shell-sky: #24497a;
  --prorank-shell-orange: #ff6b35;
  --prorank-shell-amber: #ffd166;
  --prorank-shell-surface: #ffffff;
  --prorank-shell-surface-muted: #f8fafc;
  --prorank-shell-border: rgba(226, 232, 240, 0.92);
  margin: 0;
  padding: 0;
  width: 100%;
  max-width: 100%;
  overflow-x: hidden;
  box-sizing: border-box;
  background:
    linear-gradient(180deg, #f4f7fb 0%, #ffffff 220px),
    radial-gradient(circle at top left, rgba(255, 189, 105, 0.14), transparent 18%) !important;
  position: relative;
  min-height: 100vh;
}

/* Hide WordPress default 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;
}

/* ============================================
   PREMIUM WAVE ANIMATION FOR HEADER
   ============================================ */

@keyframes waveFlow {
  0% {
    transform: translateX(-100%);
  }
  100% {
    transform: translateX(400%);
  }
}

@keyframes orangePulse {
  0%, 100% {
    opacity: 1;
    filter: brightness(1);
  }
  50% {
    opacity: 1;
    filter: brightness(1.3);
  }
}

@keyframes glowPulse {
  0%, 100% {
    box-shadow: 0 2px 15px rgba(255, 107, 53, 0.5);
  }
  50% {
    box-shadow: 0 2px 25px rgba(255, 165, 0, 0.8);
  }
}

/* ============================================
   UNIVERSAL BEAUTIFUL HEADER - SIGNATURE DESIGN
   ============================================ */

/* Premium blue gradient header with orange accent bar */
.prorank-header,
.wrap .prorank-header,
.prorank-page .prorank-header,
.prorank-admin-page .prorank-header,
.seo-simulator-header,
[class*="prorank"] .prorank-header,
body.wp-admin .prorank-header,
#wpbody .prorank-header,
#wpbody-content .prorank-header {
  background:
    radial-gradient(circle at 92% 12%, rgba(255, 144, 69, 0.34), rgba(0, 0, 0, 0) 26%),
    radial-gradient(circle at 8% 88%, rgba(255, 209, 102, 0.18), rgba(0, 0, 0, 0) 20%),
    linear-gradient(135deg, var(--prorank-shell-navy) 0%, var(--prorank-shell-blue) 56%, var(--prorank-shell-sky) 100%) !important;
  color: #f8fafc !important;
  padding: 52px 30px 82px 30px !important;
  margin: 0 !important;
  border: none !important;
  border-radius: 0 !important;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.08),
    0 28px 58px -36px rgba(15, 23, 42, 0.86) !important;
  width: 100% !important;
  box-sizing: border-box !important;
  position: relative !important;
  overflow: hidden !important;
}

/* Orange accent bar - visible element */
.prorank-header-accent-bar {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  width: 100%;
  height: 5px;
  background: linear-gradient(90deg, #ff6b35 0%, #ff8c42 24%, #ffd166 52%, #ff8c42 78%, #ff6b35 100%);
  z-index: 10;
  box-shadow: 0 0 24px rgba(255, 140, 66, 0.35);
  animation: none;
}

/* Wave effect - moving highlight */
.prorank-header-wave {
  position: absolute;
  top: 0;
  right: 18%;
  width: 220px;
  height: 5px;
  background: linear-gradient(90deg, rgba(255, 255, 255, 0) 0%, rgba(255, 248, 220, 0.82) 48%, rgba(255, 255, 255, 0) 100%);
  opacity: 0.8;
  animation: none;
  z-index: 11;
}

/* Orange accent bar with glow animation (fallback via ::before) */
.prorank-header::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg, rgba(255, 255, 255, 0.18) 0%, rgba(255, 255, 255, 0.42) 50%, rgba(255, 255, 255, 0.18) 100%);
  z-index: 1;
  animation: none;
}

.prorank-header::after {
  content: '';
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.04) 1px, transparent 1px);
  background-size: 22px 22px;
  mask-image: linear-gradient(180deg, rgba(255, 255, 255, 0.5), transparent 78%);
  opacity: 0.22;
  pointer-events: none;
}

/* Header content - white text on blue */
.prorank-header h1,
.prorank-header h2 {
  margin: 0 0 8px 0;
  font-size: clamp(34px, 3vw, 48px);
  font-weight: 800;
  color: #f8fafc !important;
  letter-spacing: -0.04em;
  line-height: 1.02;
  text-shadow: 0 14px 32px rgba(2, 6, 23, 0.28);
  position: relative;
  padding-bottom: 0;
  max-width: 760px;
}

.prorank-header p {
  margin: 0;
  max-width: 760px;
  opacity: 1;
  font-size: 16px;
  line-height: 1.7;
  color: rgba(226, 232, 240, 0.94) !important;
}

.prorank-header-content {
  max-width: 1400px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 28px;
  align-items: end;
  padding: 0;
  position: relative;
  z-index: 2;
}

.prorank-header-left {
  min-width: 0;
}

/* Header badge chips */
.prorank-header-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 18px;
}

.prorank-header-badge {
  display: inline-flex;
  align-items: center;
  padding: 8px 12px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #f8fafc;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.16);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06);
  white-space: nowrap;
}

.prorank-header-badge--accent {
  background: rgba(255, 107, 53, 0.18);
  border-color: rgba(255, 153, 51, 0.42);
  color: #fff2db;
}

.prorank-header-badge--success {
  background: rgba(22, 163, 74, 0.18);
  border-color: rgba(74, 222, 128, 0.34);
  color: #dcfce7;
}

/* Header Stats Cards - Glassmorphism on blue background */
.prorank-header-stats {
  display: flex;
  gap: 16px;
}

.prorank-header-stat {
  background: rgba(255, 255, 255, 0.15);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.2);
  padding: 12px 16px;
  border-radius: 10px;
  text-align: center;
  min-width: 120px;
}

.prorank-header-stat-value {
  font-size: 22px;
  font-weight: 700;
  color: white !important;
  display: block;
  margin-bottom: 4px;
}

.prorank-header-stat-label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: rgba(255, 255, 255, 0.85) !important;
}

.prorank-header-right {
  display: flex;
  justify-content: flex-end;
  align-items: stretch;
  min-width: min(100%, 360px);
}

.prorank-header-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  align-items: center;
  gap: 10px;
  min-height: 76px;
  padding: 14px 16px;
  border-radius: 24px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.16);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.06),
    0 18px 34px -24px rgba(2, 6, 23, 0.58);
}

.prorank-header-actions > * {
  position: relative;
  z-index: 1;
}

/* ============================================
   CONTENT CONTAINER
   ============================================ */

.prorank-content {
  max-width: 100%;
  margin: -34px 0 0;
  padding: 0 20px 52px;
  animation: fadeIn 0.3s ease;
  position: relative;
  box-sizing: border-box;
  z-index: 3;
}

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

/* Fade in animation */
@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ============================================
   ADMIN CONTENT WRAPPER
   ============================================ */

.prorank-admin-content {
  width: 100%;
  max-width: 100%;
  overflow-x: hidden;
  box-sizing: border-box;
}

/* ============================================
   SECTIONS & GROUPS
   ============================================ */

.prorank-section {
  margin-bottom: 32px;
}

.prorank-section-header {
  background: linear-gradient(135deg, #f3f4f6 0%, #e5e7eb 100%);
  margin: -20px -20px 32px;
  padding: 32px 40px;
  position: relative;
  overflow: hidden;
  border-bottom: 2px solid #e5e7eb;
}

.prorank-section-header::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(90deg, transparent, #ff6b35, transparent);
  animation: shimmer 3s infinite;
}

@keyframes shimmer {
  0% {
    transform: translateX(-100%);
  }
  100% {
    transform: translateX(100%);
  }
}

.prorank-section-title {
  color: #1f2937;
  font-size: 28px;
  font-weight: 600;
  margin: 0 0 8px;
}

.prorank-section-description {
  color: #6b7280;
  font-size: 16px;
  margin: 0;
}

/* ============================================
   GRID LAYOUTS
   ============================================ */

.prorank-grid {
  display: grid;
  gap: 24px;
}

.prorank-grid-2 {
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
}

.prorank-grid-3 {
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
}

.prorank-grid-4 {
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
}

/* ============================================
   FLEX LAYOUTS
   ============================================ */

.prorank-flex {
  display: flex;
  gap: 24px;
}

.prorank-flex-center {
  align-items: center;
  justify-content: center;
}

.prorank-flex-between {
  justify-content: space-between;
  align-items: center;
}

.prorank-flex-wrap {
  flex-wrap: wrap;
}

/* ============================================
   SPACING UTILITIES
   ============================================ */

.prorank-mt-0 { margin-top: 0; }
.prorank-mt-1 { margin-top: 8px; }
.prorank-mt-2 { margin-top: 16px; }
.prorank-mt-3 { margin-top: 24px; }
.prorank-mt-4 { margin-top: 32px; }
.prorank-mt-5 { margin-top: 48px; }

.prorank-mb-0 { margin-bottom: 0; }
.prorank-mb-1 { margin-bottom: 8px; }
.prorank-mb-2 { margin-bottom: 16px; }
.prorank-mb-3 { margin-bottom: 24px; }
.prorank-mb-4 { margin-bottom: 32px; }
.prorank-mb-5 { margin-bottom: 48px; }

.prorank-p-0 { padding: 0; }
.prorank-p-1 { padding: 8px; }
.prorank-p-2 { padding: 16px; }
.prorank-p-3 { padding: 24px; }
.prorank-p-4 { padding: 32px; }
.prorank-p-5 { padding: 48px; }

/* ============================================
   RESPONSIVE DESIGN
   ============================================ */

@media (max-width: 1024px) {
  .prorank-header-content {
    grid-template-columns: 1fr;
    gap: 24px;
  }
  
  .prorank-header-stats {
    justify-content: center;
  }

  .prorank-header-right,
  .prorank-header-actions {
    width: 100%;
  }

  .prorank-header-actions {
    justify-content: flex-start;
  }
}

@media (max-width: 768px) {
  .prorank-header {
    padding: 34px 20px 64px;
  }
  
  .prorank-header h1 {
    font-size: 30px;
  }
  
  .prorank-header p {
    font-size: 14px;
  }
  
  .prorank-content {
    margin-top: -24px;
    padding: 0 15px 34px;
  }
  
  .prorank-grid-2,
  .prorank-grid-3,
  .prorank-grid-4 {
    grid-template-columns: 1fr;
  }
  
  .prorank-header-stats {
    flex-direction: column;
    width: 100%;
  }
  
  .prorank-header-stat {
    width: 100%;
  }

  .prorank-header-actions {
    border-radius: 20px;
    min-height: 0;
  }
}

@media (max-width: 480px) {
  .prorank-header h1 {
    font-size: 24px;
  }
  
  .prorank-section-header {
    margin: -15px -15px 24px;
    padding: 24px 20px;
  }
  
  .prorank-section-title {
    font-size: 22px;
  }
}
