/* Theme Toggle System - Light/Dark Mode */

:root {
  /* Dark theme (default) - Main colors */
  --bg-primary: #121212;
  --bg-secondary: #002828;
  --bg-card: rgba(255, 255, 255, 0.04);
  --bg-card-hover: rgba(255, 255, 255, 0.08);
  --text-primary: #eafffb;
  --text-secondary: rgba(255, 255, 255, 0.86);
  --text-muted: rgba(255, 255, 255, 0.56);
  --border-color: rgba(255, 255, 255, 0.08);
  --border-color-hover: rgba(255, 255, 255, 0.12);
  --turq-1: #00ffd5;
  --turq-2: #00d8b4;
  --accent-glow: rgba(0, 255, 213, 0.14);
  --shadow-color: rgba(0, 0, 0, 0.4);
  --overlay-dark: rgba(0, 0, 0, 0.62);
  
  /* Transition for theme changes */
  --theme-transition: 0.3s ease;
}

/* Light theme */
[data-theme="light"] {
  --bg-primary: #eeeeee;
  --bg-secondary: #e5f5f3;
  --bg-card: rgba(0, 0, 0, 0.03);
  --bg-card-hover: rgba(0, 0, 0, 0.06);
  --text-primary: #000000;
  --text-secondary: #000000;
  --text-muted: rgba(0, 0, 0, 0.52);
  --border-color: rgba(0, 0, 0, 0.12);
  --border-color-hover: rgba(0, 0, 0, 0.18);
  --turq-1: #00b89d;
  --turq-2: #009880;
  --accent-glow: rgba(0, 184, 157, 0.2);
  --shadow-color: rgba(0, 0, 0, 0.12);
  --overlay-dark: rgba(255, 255, 255, 0.9);
}

/* Burger menu icon - black in light mode */
[data-theme="light"] #site-burger-toggle,
[data-theme="light"] #site-burger-toggle-mobile {
  color: #000000 !important;
}

[data-theme="light"] #site-burger-toggle svg path,
[data-theme="light"] #site-burger-toggle-mobile svg path {
  fill: #000000 !important;
}

/* Header background - match page background in light mode */
[data-theme="light"] .elementor-element-aec37cd {
  background-color: #eeeeee !important;
}

[data-theme="light"] .elementor-element-aec37cd .e-con-inner {
  background-color: #eeeeee !important;
}

/* About hero section - remove turquoise background in light mode */
[data-theme="light"] .about-hero {
  background: #eeeeee !important;
  color: #000000 !important;
}

[data-theme="light"] .about-hero h1,
[data-theme="light"] .about-hero p.lead {
  color: #000000 !important;
}

/* CTA section text - black in light mode */
[data-theme="light"] .cta-section-text {
  color: #000000 !important;
}

/* Services page description text - black in light mode */
[data-theme="light"] .service-description-text {
  color: #000000 !important;
}

/* Make Fashion Visuals intro paragraph (parallax-text) black in light mode */
[data-theme="light"] .fashion-visuals-section .parallax-text,
[data-theme="light"] .fashion-visuals-section .sub {
  color: #000000 !important;
}

/* Why MADPiXEL section - remove dark background in light mode */
[data-theme="light"] .simple-section-inner {
  background: transparent !important;
  box-shadow: none !important;
}

[data-theme="light"] .simple-section-inner h2,
[data-theme="light"] .simple-section-inner .intercalate-header {
  color: #000000 !important;
}

[data-theme="light"] .simple-section-inner p {
  color: #000000 !important;
}

/* Remove shadow boxes from Why MADPiXEL cards in light mode */
[data-theme="light"] .simple-section-inner .card {
  box-shadow: none !important;
}

/* Invert white icons to dark in light mode */
[data-theme="light"] .simple-section-inner .card-icon img {
  filter: invert(1) !important;
}

/* Benefits stats card - white background with dark text in dark mode */
.benefits-stats-inner {
  background: #ffffff !important;
  color: #000000 !important;
}

.benefits-stats-inner p {
  color: rgba(0, 0, 0, 0.72) !important;
}

.benefits-stats-inner .stat .value {
  color: #000000 !important;
}

.benefits-stats-inner .stat .label {
  color: rgba(0, 0, 0, 0.72) !important;
}

/* Light mode - black background with white text for benefits stats */
[data-theme="light"] .benefits-stats-inner {
  background: #000000 !important;
  color: #ffffff !important;
}

[data-theme="light"] .benefits-stats-inner p {
  color: rgba(255, 255, 255, 0.9) !important;
}

[data-theme="light"] .benefits-stats-inner .stat .value {
  color: #ffffff !important;
}

[data-theme="light"] .benefits-stats-inner .stat .label {
  color: rgba(255, 255, 255, 0.8) !important;
}

/* Theme toggle button */
.theme-toggle {
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: #fff;
  padding: 6px 12px;
  border-radius: 6px;
  font-family: "DM Sans", Sans-serif;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  margin-left: 8px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.theme-toggle:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.3);
  transform: translateY(-1px);
}

.theme-toggle:active {
  transform: translateY(0);
}

.theme-toggle:focus-visible {
  outline: 2px solid rgba(0, 230, 212, 0.5);
  outline-offset: 2px;
}

.theme-toggle svg {
  width: 14px;
  height: 14px;
  fill: currentColor;
}

[data-theme="light"] .theme-toggle {
  border-color: rgba(0, 0, 0, 0.2);
  color: #001818;
}

[data-theme="light"] .theme-toggle:hover {
  background: rgba(0, 0, 0, 0.05);
  border-color: rgba(0, 0, 0, 0.3);
}

@media (max-width: 767px) {
  .theme-toggle {
    padding: 8px 10px;
    font-size: 12px;
  }
}

/* Apply theme to body and major elements */
body,
html {
  background-color: var(--bg-primary) !important;
  color: var(--text-primary) !important;
  transition: background-color var(--theme-transition), color var(--theme-transition);
}

/* Update major sections */
.elementor,
.elementor-section,
main,
section:not(.mp-carousel) {
  background-color: var(--bg-primary) !important;
  color: var(--text-primary) !important;
  transition: background-color var(--theme-transition), color var(--theme-transition);
}

/* Carousel should have transparent background */
.mp-carousel,
.mp-carousel *,
.mpc-slide,
.mpc-track {
  background-color: transparent !important;
}

/* Make containers transparent but keep text styled */
.e-con:not(.cards):not(.card),
.elementor-element[data-settings*="background_background"]:not(.cards):not(.card) {
  background-color: transparent !important;
  background-image: none !important;
  color: var(--text-primary) !important;
  transition: color var(--theme-transition);
}

/* Hero mesh background - Dark mode - Override Elementor's external image */
.elementor-6861 .elementor-element.elementor-element-ffc3a2d:not(.elementor-motion-effects-element-type-background),
.elementor-6861 .elementor-element.elementor-element-ffc3a2d > .elementor-motion-effects-container > .elementor-motion-effects-layer {
  background-image: url("/public/mesh.avif") !important;
  background-position: 60% -100px !important;
  background-repeat: no-repeat !important;
  background-size: 100% auto !important;
}

/* Hero mesh background - Light mode with different image */
[data-theme="light"] .elementor-6861 .elementor-element.elementor-element-ffc3a2d:not(.elementor-motion-effects-element-type-background),
[data-theme="light"] .elementor-6861 .elementor-element.elementor-element-ffc3a2d > .elementor-motion-effects-container > .elementor-motion-effects-layer {
  background-image: url("/public/mesh%20WHITE.avif") !important;
  background-position: 60% -100px !important;
  background-repeat: no-repeat !important;
  background-size: 100% auto !important;
}

/* Cards and glassmorphism containers */
.contact-hero__card,
.booking-container,
.service-card,
.contact-hero__inner,
.about-card {
  background: var(--bg-card) !important;
  border-color: var(--border-color) !important;
  color: var(--text-primary) !important;
  transition: background var(--theme-transition), border-color var(--theme-transition), color var(--theme-transition);
}

/* How it works steps - white background in both light and dark mode */
.hiw-step {
  background: linear-gradient(180deg, rgba(255,255,255,0.9), #ffffff) !important;
  border-color: var(--border-color) !important;
  color: #071718 !important;
  transition: background var(--theme-transition), border-color var(--theme-transition), color var(--theme-transition);
}

.contact-hero__card:hover,
.booking-container:hover {
  background: var(--bg-card-hover) !important;
}

/* Text colors - without !important to allow overrides */
h1, h2, h3, h4, h5, h6,
.elementor-heading-title {
  color: var(--text-primary);
  transition: color var(--theme-transition);
}

/* Force text color in light mode for specific hero elements */
[data-theme="light"] h1,
[data-theme="light"] h2,
[data-theme="light"] h3,
[data-theme="light"] h4,
[data-theme="light"] h5,
[data-theme="light"] h6,
[data-theme="light"] .elementor-heading-title {
  color: #000000 !important;
}

p, li, span, div {
  color: var(--text-secondary);
  transition: color var(--theme-transition);
}

/* Links - keep teal accent */
a {
  color: var(--turq-1);
  transition: color var(--theme-transition);
}

a:hover {
  color: var(--turq-2);
}

/* Buttons keep gradient but adjust for light mode */
.btn-ghost {
  background: var(--bg-card) !important;
  color: var(--text-primary) !important;
  border-color: var(--border-color) !important;
  transition: all var(--theme-transition);
}

.btn-ghost:hover {
  background: var(--bg-card-hover) !important;
  border-color: var(--border-color-hover) !important;
}

/* Forms */
input,
textarea,
select {
  background: var(--bg-card) !important;
  color: var(--text-primary) !important;
  border-color: var(--border-color) !important;
  transition: all var(--theme-transition);
}

input::placeholder,
textarea::placeholder {
  color: var(--text-muted) !important;
}

input:focus,
textarea:focus,
select:focus {
  border-color: var(--turq-1) !important;
  outline-color: var(--turq-1) !important;
}

/* Light theme specific adjustments */
[data-theme="light"] .contact-hero::before,
[data-theme="light"] .bg-overlay {
  opacity: 0.5 !important;
  mix-blend-mode: soft-light !important;
}

[data-theme="light"] .booking-header {
  background: rgba(0, 184, 157, 0.1) !important;
}

[data-theme="light"] .booking-title,
[data-theme="light"] .booking-subtitle {
  color: var(--text-primary) !important;
  text-shadow: 0 1px 2px var(--shadow-color) !important;
}

/* Reduce neon glow intensity in light mode */
[data-theme="light"] .neon-turquoise-glow,
[data-theme="light"] #neon-bottom,
[data-theme="light"] #neon-bottom-parallax {
  opacity: 0.25 !important;
  filter: blur(80px) saturate(80%) !important;
}

[data-theme="light"] #neon-bottom::before,
[data-theme="light"] #neon-bottom::after {
  opacity: 0.3 !important;
}

/* Adjust shadows for light mode */
[data-theme="light"] .contact-hero,
[data-theme="light"] .booking-container,
[data-theme="light"] .hiw-step {
  box-shadow: 0 8px 32px var(--shadow-color) !important;
}

/* Restore original white background for how-it-works steps in light mode */
[data-theme="light"] .hiw-step {
  background: linear-gradient(180deg, rgba(255,255,255,0.9), #ffffff) !important;
}

[data-theme="light"] .hiw-step__title {
  color: #071718 !important;
}

[data-theme="light"] .hiw-step__text {
  color: #071718 !important;
}

/* How-it-works extra card text - black in light mode */
[data-theme="light"] .hiw-extra-text,
[data-theme="light"] .hiw-extra__card {
  color: #000000 !important;
}

[data-theme="light"] .hiw-extra-text h4,
[data-theme="light"] .hiw-extra__card h4 {
  color: #000000 !important;
}

[data-theme="light"] .hiw-extra-text p,
[data-theme="light"] .hiw-extra__card p {
  color: #000000 !important;
}

/* How-it-works intro section text - black in light mode */
[data-theme="light"] .hiw-intro-text {
  color: #000000 !important;
}

/* How-it-works comparison section text - black in light mode */
[data-theme="light"] .hiw-compare-text {
  color: #000000 !important;
}

[data-theme="light"] .hiw-compare__table {
  color: #000000 !important;
}

[data-theme="light"] .hiw-compare__row {
  color: #000000 !important;
}

[data-theme="light"] .hiw-compare__row .label,
[data-theme="light"] .hiw-compare__row .col {
  color: #000000 !important;
}

/* Improve contrast in light mode */
[data-theme="light"] .elementor-nav-menu a,
[data-theme="light"] .elementor-item {
  color: var(--text-primary) !important;
}

[data-theme="light"] .elementor-nav-menu a:hover,
[data-theme="light"] .elementor-item:hover {
  color: var(--turq-1) !important;
}

/* Footer in dark mode */
.site-footer {
  background: #000000 !important;
  color: var(--text-secondary) !important;
  position: relative !important;
  z-index: 200 !important;
}

/* Footer in light mode */
[data-theme="light"] .site-footer {
  background: #ffffff !important;
  color: #000000 !important;
}

[data-theme="light"] .site-footer a,
[data-theme="light"] .site-footer__copyright,
[data-theme="light"] .site-footer__madeby-text {
  color: #000000 !important;
}

/* Mobile menu overlay */
[data-theme="light"] #mobile-menu-overlay {
  background: rgba(255, 255, 255, 0.98) !important;
  color: var(--text-primary) !important;
  backdrop-filter: blur(20px) !important;
}

[data-theme="light"] #mobile-menu-overlay a {
  color: var(--text-primary) !important;
}

/* Minigame cards (services page) */
[data-theme="light"] .game-card {
  background: var(--bg-card) !important;
  border-color: var(--border-color) !important;
  box-shadow: 0 4px 16px var(--shadow-color) !important;
}

/* Keep images visible in both modes - but exclude slideshow images */
img:not(.hslide) {
  opacity: 1 !important;
}

[data-theme="light"] img:not(.hslide) {
  opacity: 0.98 !important;
}

/* Ensure text readability on all backgrounds */
[data-theme="light"] .lead,
[data-theme="light"] .contact-row,
[data-theme="light"] .contact-list {
  color: var(--text-secondary) !important;
}

/* Force hero and main content to black in light mode */
[data-theme="light"] .elementor-widget-text-editor,
[data-theme="light"] .elementor-widget-text-editor p,
[data-theme="light"] .elementor-widget-text-editor li,
[data-theme="light"] .elementor-widget-heading .elementor-heading-title,
[data-theme="light"] .subheading-dmsans-600,
[data-theme="light"] .hero-blur-shell,
[data-theme="light"] .hero-blur-shell p,
[data-theme="light"] .section-content,
[data-theme="light"] .foundations-copy-container p {
  color: #000000 !important;
}

/* Specific hero element overrides to beat any later rules */
[data-theme="light"] .elementor-element-3e2da68 .subheading-dmsans-600,
[data-theme="light"] .elementor-element-3e2da68 .elementor-widget-container p,
[data-theme="light"] .elementor-element-5502f64 .subheading-dmsans-600,
[data-theme="light"] .elementor-element-5502f64 .elementor-widget-container p,
[data-theme="light"] .elementor-element-1970eec .elementor-widget-container p,
[data-theme="light"] .elementor-element-1970eec .elementor-widget-container p b {
  color: #000000 !important;
  text-shadow: none !important;
  -webkit-text-fill-color: #000000 !important;
}

/* Force ALL headings to black site-wide in light mode */
[data-theme="light"] h1,
[data-theme="light"] h2,
[data-theme="light"] h3,
[data-theme="light"] h4,
[data-theme="light"] h5,
[data-theme="light"] h6,
[data-theme="light"] .elementor-heading-title,
[data-theme="light"] .elementor-widget-heading .elementor-heading-title,
[data-theme="light"] .badge-showcase,
[data-theme="light"] .popup,
[data-theme="light"] .popup-showcase {
  color: #000000 !important;
  text-shadow: none !important;
}

/* Also ensure buttons inside hero are legible */
[data-theme="light"] .hero-cta-block a,
[data-theme="light"] .hero-cta-block .subheading-dmsans-600 {
  color: #000000 !important;
}

/* Force both CTA buttons to have black text in both modes */
.elementor-element-1c46488 .elementor-button-link,
.elementor-element-1c46488 .elementor-button-text,
.elementor-element-3b18261 .elementor-button-link,
.elementor-element-3b18261 .elementor-button-text {
  color: #000000 !important;
  -webkit-text-fill-color: #000000 !important;
}

/* Specific text containers background in light mode */
[data-theme="light"] .elementor-element-9157cd1,
[data-theme="light"] .elementor-element-5c8d971,
[data-theme="light"] .elementor-element-1970eec {
  background-color: #A3F7E3 !important; /* Slightly greener turquoise */
  border-radius: 16px !important;
  padding: 30px !important;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05) !important;
}