<?php
/**
 * Plugin Name: Speedrun Course Overrides
 * Description: Brand and layout overrides for the speedrunning course MVP delivery.
 */

if (!defined('ABSPATH')) {
    exit;
}

add_filter('body_class', function ($classes) {
    $classes[] = 'speedrun-course-site';
    return $classes;
});

add_action('wp_enqueue_scripts', function () {
    if (is_admin()) {
        return;
    }

    wp_register_style('speedrun-course-overrides', false, [], null);
    wp_enqueue_style('speedrun-course-overrides');

    $css = <<<'CSS'
:root {
  --coach-primary: #7c5cff;
  --coach-secondary: #00e7ff;
  --coach-accent: #ff58c7;
  --coach-background: #070b17;
  --coach-surface: #10192b;
  --coach-surface-soft: rgba(16,25,43,.82);
  --coach-text: #f4f7ff;
  --coach-muted: #c3d0ea;
  --coach-copy: #dbe6ff;
  --coach-deep: #050814;
  --coach-deeper: #040610;
  --coach-border: rgba(124,92,255,.22);
  --coach-shadow: 0 24px 60px rgba(0,0,0,.32);
  --coach-shadow-lg: 0 42px 100px rgba(0,0,0,.46);
  --coach-shadow-card: 0 20px 48px rgba(0,0,0,.28);
  --coach-shadow-hover: 0 28px 72px rgba(0,0,0,.40);
  --coach-radius: 28px;
  --coach-radius-sm: 18px;
  --coach-spacing: 1.5rem;
  --color-button-secondary-bg: linear-gradient(135deg, #00e7ff 0%, #7c5cff 100%);
  --color-button-secondary-text: #04101d;
  --color-button-secondary-hover-bg: linear-gradient(135deg, #7c5cff 0%, #ff58c7 100%);
}
body.coaching-mvp-active.speedrun-course-site {
  background:
    radial-gradient(circle at 10% 10%, rgba(124,92,255,.24), transparent 26%),
    radial-gradient(circle at 86% 16%, rgba(0,231,255,.18), transparent 20%),
    radial-gradient(circle at 50% 80%, rgba(255,88,199,.12), transparent 28%),
    linear-gradient(180deg, #050812 0%, #091121 40%, #050812 100%);
  color: var(--coach-text);
}
body.coaching-mvp-active.speedrun-course-site header.wp-block-template-part {
  background: linear-gradient(180deg, rgba(6,10,22,.88), rgba(9,16,31,.78));
  border-bottom: 1px solid rgba(124,92,255,.18);
  box-shadow: 0 18px 42px rgba(0,0,0,.30);
}
body.coaching-mvp-active.speedrun-course-site .wp-block-site-title a,
body.coaching-mvp-active.speedrun-course-site .wp-block-navigation a,
body.coaching-mvp-active.speedrun-course-site .wp-block-navigation-item__content,
body.coaching-mvp-active.speedrun-course-site h1,
body.coaching-mvp-active.speedrun-course-site h2,
body.coaching-mvp-active.speedrun-course-site h3,
body.coaching-mvp-active.speedrun-course-site h4,
body.coaching-mvp-active.speedrun-course-site p,
body.coaching-mvp-active.speedrun-course-site li,
body.coaching-mvp-active.speedrun-course-site strong,
body.coaching-mvp-active.speedrun-course-site summary,
body.coaching-mvp-active.speedrun-course-site label {
  color: var(--coach-text);
}
body.coaching-mvp-active.speedrun-course-site p,
body.coaching-mvp-active.speedrun-course-site li,
body.coaching-mvp-active.speedrun-course-site figcaption,
body.coaching-mvp-active.speedrun-course-site blockquote,
body.coaching-mvp-active.speedrun-course-site .coach-faq-answer,
body.coaching-mvp-active.speedrun-course-site .coach-faq-answer p,
body.coaching-mvp-active.speedrun-course-site .coach-post-card p,
body.coaching-mvp-active.speedrun-course-site .coach-payment-grid .asp_product_description,
body.coaching-mvp-active.speedrun-course-site .coach-hero-support,
body.coaching-mvp-active.speedrun-course-site .speedrun-stat-row span,
body.coaching-mvp-active.speedrun-course-site .speedrun-admin-footer__inner span {
  color: var(--coach-copy);
}
body.coaching-mvp-active.speedrun-course-site .coach-muted,
body.coaching-mvp-active.speedrun-course-site .wp-block-post-date,
body.coaching-mvp-active.speedrun-course-site .wp-block-post-excerpt__excerpt {
  color: var(--coach-muted);
}
body.coaching-mvp-active.speedrun-course-site .coach-shell,
body.coaching-mvp-active.speedrun-course-site .coach-section,
body.coaching-mvp-active.speedrun-course-site .coach-hero,
body.coaching-mvp-active.speedrun-course-site .coach-mini-card,
body.coaching-mvp-active.speedrun-course-site .coach-panel,
body.coaching-mvp-active.speedrun-course-site .coach-process-card,
body.coaching-mvp-active.speedrun-course-site .coach-story-card,
body.coaching-mvp-active.speedrun-course-site .coach-quote-card,
body.coaching-mvp-active.speedrun-course-site .coach-faq-item,
body.coaching-mvp-active.speedrun-course-site .coach-post-card,
body.coaching-mvp-active.speedrun-course-site .coach-payment-note,
body.coaching-mvp-active.speedrun-course-site .coach-booking-layout > div:first-child,
body.coaching-mvp-active.speedrun-course-site .coach-booking-layout > div:last-child > * {
  background: linear-gradient(180deg, rgba(16,25,43,.94), rgba(10,16,28,.94));
  border-color: rgba(124,92,255,.16) !important;
  box-shadow: var(--coach-shadow-card);
}
body.coaching-mvp-active.speedrun-course-site .coach-eyebrow,
body.coaching-mvp-active.speedrun-course-site .coach-badge,
body.coaching-mvp-active.speedrun-course-site .speedrun-chip {
  color: #d9f8ff !important;
  background: rgba(0,231,255,.12) !important;
  border: 1px solid rgba(0,231,255,.24) !important;
  box-shadow: none !important;
}
body.coaching-mvp-active.speedrun-course-site .coach-badge.dark {
  background: rgba(124,92,255,.14) !important;
  border-color: rgba(124,92,255,.30) !important;
}
body.coaching-mvp-active.speedrun-course-site .wp-block-button__link,
body.coaching-mvp-active.speedrun-course-site .asp_product_buy_btn {
  border-radius: 14px !important;
  border: 1px solid rgba(255,255,255,.06) !important;
  box-shadow: 0 14px 30px rgba(0,0,0,.24);
}
body.coaching-mvp-active.speedrun-course-site .wp-block-button:not(.is-style-outline) .wp-block-button__link,
body.coaching-mvp-active.speedrun-course-site .asp_product_buy_btn {
  background: linear-gradient(135deg, #00e7ff 0%, #7c5cff 100%) !important;
  color: #04101d !important;
  font-weight: 700 !important;
}
body.coaching-mvp-active.speedrun-course-site .wp-block-button.is-style-outline .wp-block-button__link {
  background: rgba(255,255,255,.02) !important;
  color: var(--coach-text) !important;
  border-color: rgba(124,92,255,.24) !important;
}
body.coaching-mvp-active.speedrun-course-site .wp-block-button__link:hover,
body.coaching-mvp-active.speedrun-course-site .asp_product_buy_btn:hover,
body.coaching-mvp-active.speedrun-course-site .coach-inline-link:hover {
  filter: brightness(1.06);
}
body.coaching-mvp-active.speedrun-course-site .coach-inline-link {
  color: #86f7ff !important;
}
body.coaching-mvp-active.speedrun-course-site .speedrun-hero-card {
  position: relative;
  padding: clamp(1.4rem, 3vw, 2rem);
  border-radius: 28px;
  border: 1px solid rgba(124,92,255,.22);
  background:
    radial-gradient(circle at top right, rgba(0,231,255,.16), transparent 24%),
    linear-gradient(180deg, rgba(17,28,49,.98), rgba(8,13,24,.98));
  box-shadow: var(--coach-shadow-lg);
  overflow: hidden;
}
body.coaching-mvp-active.speedrun-course-site .speedrun-pulse {
  position: absolute;
  inset: auto -40px -40px auto;
  width: 180px;
  height: 180px;
  border-radius: 999px;
  background: radial-gradient(circle, rgba(255,88,199,.28), transparent 60%);
}
body.coaching-mvp-active.speedrun-course-site .speedrun-tier-list {
  margin: 1rem 0 0;
  padding-left: 1.1rem;
  display: grid;
  gap: .55rem;
}
body.coaching-mvp-active.speedrun-course-site .speedrun-tier-list li {
  color: #dbe6ff;
}
body.coaching-mvp-active.speedrun-course-site .speedrun-stat-row {
  display: grid;
  grid-template-columns: repeat(3, minmax(0,1fr));
  gap: .8rem;
  margin-top: 1.25rem;
}
body.coaching-mvp-active.speedrun-course-site .speedrun-stat-row div {
  padding: .9rem;
  border-radius: 18px;
  background: rgba(255,255,255,.03);
  border: 1px solid rgba(255,255,255,.06);
}
body.coaching-mvp-active.speedrun-course-site .speedrun-stat-row strong {
  display: block;
  font-size: 1.7rem;
  line-height: 1;
  color: #86f7ff;
}
body.coaching-mvp-active.speedrun-course-site .speedrun-stat-row span {
  display: block;
  margin-top: .28rem;
  color: var(--coach-muted);
  font-size: .92rem;
}
body.coaching-mvp-active.speedrun-course-site .speedrun-grid {
  display: grid;
  gap: 1rem;
}
body.coaching-mvp-active.speedrun-course-site .speedrun-grid-3 {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}
body.coaching-mvp-active.speedrun-course-site .speedrun-grid-2,
body.coaching-mvp-active.speedrun-course-site .speedrun-program-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}
body.coaching-mvp-active.speedrun-course-site .speedrun-bonus-strip {
  display: grid;
  gap: 1rem;
  grid-template-columns: repeat(3, minmax(0, 1fr));
}
body.coaching-mvp-active.speedrun-course-site .coach-cta-band,
body.coaching-mvp-active.speedrun-course-site .speedrun-final-cta {
  background: linear-gradient(135deg, rgba(124,92,255,.16), rgba(0,231,255,.10));
  border: 1px solid rgba(124,92,255,.22);
}
body.coaching-mvp-active.speedrun-course-site .coach-faq-item summary::after,
body.coaching-mvp-active.speedrun-course-site .coach-icon-dot {
  color: #86f7ff !important;
}
body.coaching-mvp-active.speedrun-course-site .coach-post-card,
body.coaching-mvp-active.speedrun-course-site .coach-testimonial-card {
  background: linear-gradient(180deg, rgba(17,28,49,.96), rgba(9,14,24,.96));
  border: 1px solid rgba(124,92,255,.16);
}
body.coaching-mvp-active.speedrun-course-site .coach-testimonial-meta,
body.coaching-mvp-active.speedrun-course-site .coach-quote-role {
  color: #86f7ff;
}
body.coaching-mvp-active.speedrun-course-site .coach-payment-grid,
body.coaching-mvp-active.speedrun-course-site .coach-payment-grid > .wp-block-group__inner-container {
  display: grid !important;
  grid-template-columns: repeat(3, minmax(0,1fr));
  gap: 1rem;
}
body.coaching-mvp-active.speedrun-course-site .coach-payment-grid .asp_product_item {
  margin: 0 !important;
  padding: 1.35rem !important;
  min-height: 100%;
  display: flex;
  flex-direction: column;
  gap: .8rem;
  border-radius: 24px !important;
  background: linear-gradient(180deg, rgba(17,28,49,.98), rgba(8,13,24,.98)) !important;
  border: 1px solid rgba(124,92,255,.18) !important;
  box-shadow: var(--coach-shadow-card) !important;
}
body.coaching-mvp-active.speedrun-course-site .coach-payment-grid .asp_product_item:nth-child(2) {
  border-color: rgba(0,231,255,.30) !important;
  box-shadow: 0 24px 60px rgba(0,231,255,.10) !important;
}
body.coaching-mvp-active.speedrun-course-site .coach-payment-grid .asp_product_name,
body.coaching-mvp-active.speedrun-course-site .coach-payment-grid .asp_price_amount {
  color: var(--coach-text) !important;
}
body.coaching-mvp-active.speedrun-course-site .coach-payment-grid .asp_product_description {
  color: var(--coach-copy) !important;
}
body.coaching-mvp-active.speedrun-course-site input,
body.coaching-mvp-active.speedrun-course-site textarea,
body.coaching-mvp-active.speedrun-course-site select {
  color: var(--coach-text);
  background: rgba(7,11,23,.78);
  border: 1px solid rgba(124,92,255,.24);
}
body.coaching-mvp-active.speedrun-course-site input::placeholder,
body.coaching-mvp-active.speedrun-course-site textarea::placeholder {
  color: var(--coach-muted);
}
body.coaching-mvp-active.speedrun-course-site .coach-payment-grid .asp_product_item_thumbnail,
body.coaching-mvp-active.speedrun-course-site .coach-payment-grid .asp_under_price_line,
body.coaching-mvp-active.speedrun-course-site .coach-payment-grid .asp_product_item > div[style*="clear:both"] {
  display: none !important;
}
body.coaching-mvp-active.speedrun-course-site .coach-payment-grid .asp_product_name {
  font-size: 1.3rem !important;
  font-weight: 700 !important;
}
body.coaching-mvp-active.speedrun-course-site .coach-payment-grid .asp_price_amount {
  font-size: 2.3rem !important;
  font-weight: 800 !important;
  letter-spacing: -.03em !important;
}
body.coaching-mvp-active.speedrun-course-site .speedrun-admin-footer {
  width: min(100%, 1280px);
  margin: 0 auto 2rem;
  padding: 0 20px;
}
body.coaching-mvp-active.speedrun-course-site .speedrun-admin-footer__inner {
  display: flex;
  gap: 1rem;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.1rem;
  border-radius: 18px;
  border: 1px solid rgba(124,92,255,.18);
  background: rgba(10,16,28,.92);
}
body.coaching-mvp-active.speedrun-course-site .speedrun-admin-footer__inner span {
  color: var(--coach-muted);
  font-size: .95rem;
}
body.coaching-mvp-active.speedrun-course-site .speedrun-admin-footer__inner a {
  color: #86f7ff;
  text-decoration: none;
  font-weight: 700;
}
@media (max-width: 900px) {
  body.coaching-mvp-active.speedrun-course-site .speedrun-grid-3,
  body.coaching-mvp-active.speedrun-course-site .speedrun-grid-2,
  body.coaching-mvp-active.speedrun-course-site .speedrun-bonus-strip,
  body.coaching-mvp-active.speedrun-course-site .coach-payment-grid,
  body.coaching-mvp-active.speedrun-course-site .coach-payment-grid > .wp-block-group__inner-container,
  body.coaching-mvp-active.speedrun-course-site .speedrun-stat-row {
    grid-template-columns: 1fr;
  }
  body.coaching-mvp-active.speedrun-course-site .speedrun-admin-footer__inner {
    flex-direction: column;
    align-items: flex-start;
  }
}
CSS;

    wp_add_inline_style('speedrun-course-overrides', $css);
}, 40);

add_action('wp_footer', function () {
    if (is_admin()) {
        return;
    }

    echo '<div class="speedrun-admin-footer"><div class="speedrun-admin-footer__inner"><span>Admin shortcut for updating pages, Stripe, and booking settings.</span><a href="/wp-admin/">Open WordPress Admin</a></div></div>';
}, 100);
