/* ================================
   Momuto Design System
   Dark-first, minimalist, glass-morphism
   Sharp geometry, no border-radius
   ================================ */

/* Font imports */
@import url('https://fonts.googleapis.com/css2?family=Jost:wght@400;500;700;900&display=swap');

/* General styles */
body {
  margin: 0;
  padding: 0;
  font-family: 'Jost', sans-serif;
  background-color: #050505;
  color: #ffffff;
  overflow-y: auto;
  overflow-x: hidden;
}

/* ================================
   Sport Selection Screen
   ================================ */
.momuto-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 40px 20px;
  max-width: 100%;
  min-height: 100vh;
  margin: 0 auto;
  box-sizing: border-box;
  background: radial-gradient(circle at 50% 30%, #1a1a1a 0%, #050505 70%);
}

.momuto-logo {
  filter: brightness(0) invert(1);
  width: 120px;
  margin: 0 auto 10px;
  display: block;
}

/* Inner-page logo (pages 2-3) — rendered without .momuto-logo class */
img[src*="b5b288"] {
  filter: brightness(0) invert(1) !important;
}

.momuto-title {
  margin: 10px 0 40px;
  font-family: 'Jost', sans-serif;
  font-size: clamp(1.3rem, 5vw, 2.2rem);
  font-weight: 700;
  color: #ffffff;
  text-align: center;
  letter-spacing: -0.02em;
  line-height: 1.1;
  text-transform: uppercase;
}

.momuto-sport-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  max-width: 500px;
  width: 100%;
  margin: 0 auto;
  padding: 10px;
  justify-content: center;
}

.momuto-sport-button {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  color: #a1a1aa;
  padding: 16px 20px;
  font-family: 'Jost', sans-serif;
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  cursor: pointer;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 0;
  background: rgba(255, 255, 255, 0.03);
  transition: all 300ms ease;
  text-align: center;
  width: 100%;
}

.momuto-sport-button:hover {
  background: rgba(255, 255, 255, 0.08) !important;
  color: #ffffff;
  border-color: rgba(255, 255, 255, 0.2);
  transform: translateY(-2px);
  box-shadow: 0 5px 15px rgba(10, 10, 10, 0.4);
}

.momuto-sport-button:active {
  transform: scale(0.98);
}

.momuto-button-icon {
  width: 20px;
  height: 20px;
  filter: brightness(0) invert(1);
  transition: all 300ms ease;
}

/* ================================
   Loading Screen
   ================================ */
.momuto-loading-container {
  display: flex;
  justify-content: center;
  align-items: center;
  height: 100vh;
  flex-direction: column;
  font-family: 'Jost', sans-serif;
  background: #050505;
}

.momuto-loading-text {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: #a1a1aa;
  margin-bottom: 24px;
}

.momuto-loader {
  width: 40px;
  height: 40px;
  border: 2px solid rgba(255, 255, 255, 0.08);
  border-top: 2px solid #e63946;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

/* ================================
   3D Configurator Specific Fixes
   ================================ */

/* Page-level dark background for all configurator views */
div[style*="display: flex; flex-direction: column; height: 100vh"] {
  background-color: #050505 !important;
  background: radial-gradient(circle at 50% 30%, #1a1a1a 0%, #050505 70%) !important;
}

/* 1. Enhanced Button Styling (Desktop and Mobile) */

/* Improve desktop button styling */
div[style*="position: absolute; bottom"] {
  z-index: 100 !important;
}

/* Improve desktop button container spacing */
div[style*="position: absolute; bottom: 30px; left"] {
  left: 30px !important;
}

div[style*="position: absolute; bottom: 30px; right"] {
  right: 30px !important;
}

/* Style buttons consistently across the app */
.button {
  cursor: pointer !important;
  background-color: #ffffff !important;
  color: #000000 !important;
  padding: 12px 32px !important;
  border-radius: 0 !important;
  font-family: 'Jost', sans-serif !important;
  font-weight: 700 !important;
  font-size: 0.8rem !important;
  text-transform: uppercase !important;
  letter-spacing: 0.05em !important;
  display: flex !important;
  justify-content: center !important;
  align-items: center !important;
  box-shadow: none !important;
  transition: all 200ms ease !important;
  border: none !important;
}

.button:hover {
  background-color: #e63946 !important;
  color: #ffffff !important;
}

.button:active {
  transform: scale(0.98) !important;
}

/* Button text must stay black on white bg */
.button p {
  color: #000000 !important;
}

.button:hover p {
  color: #ffffff !important;
}

/* Button arrow icons — invert to match button text */
.button img {
  filter: brightness(0) !important;
  transition: filter 200ms ease !important;
}

.button:hover img {
  filter: brightness(0) invert(1) !important;
}

/* ================================
   Improved Layout and Spacing
   ================================ */

/* Improve color selection page spacing */
div[style*="display: flex; flex-direction: column; gap: 2px; justify-content: center"] {
  gap: 15px !important;
  height: auto !important;
  padding-top: 10px !important;
  padding-bottom: 10px !important;
}

/* ================================
   Dark Theme — Override all inline black text to white
   ================================ */
p[style*="color: rgb(0, 0, 0)"] {
  color: #ffffff !important;
  font-family: 'Jost', sans-serif !important;
}

/* Title text (e.g. "FÚTBOL", "ELIGE TUS COLORES") */
p[style*="font-size: 20px; font-weight: bold; color: rgb(0, 0, 0)"] {
  color: #ffffff !important;
  text-transform: uppercase !important;
  letter-spacing: -0.02em !important;
}

/* Body text on welcome page */
p[style*="font-size: 14px; font-weight: bold; color: rgb(0, 0, 0); width: 80%;"] {
  color: #a1a1aa !important;
  margin: 5px 0 10px !important;
  width: 90% !important;
  font-weight: 500 !important;
}

/* Labels (COLOR PRIMARIO, COLOR SECUNDARIO) */
p[style*="font-size: 12px; font-weight: bold; color: rgb(0, 0, 0);"] {
  color: #a1a1aa !important;
  text-transform: uppercase !important;
  letter-spacing: 0.1em !important;
  font-size: 0.7rem !important;
  margin: 0 0 10px !important;
}

/* ================================
   Color Picker Popup Fix - Consistent for Both Primary and Secondary
   ================================ */

/* Prevent horizontal scrolling on the page */
html, body {
  max-width: 100%;
  overflow-x: hidden !important;
}

/* Target all color picker popups */
div[style*="position: absolute"][style*="display: grid"],
div[style*="position: absolute;"][style*="display: grid"] {
  position: fixed !important;
  top: 50% !important;
  left: 50% !important;
  transform: translate(-50%, -50%) !important;
  z-index: 9999 !important;
  max-width: 80% !important;
  max-height: 70vh !important;
  overflow-y: auto !important;

  /* Layout */
  grid-template-columns: repeat(4, 1fr) !important;

  /* Dark styling */
  background-color: #1a1a1a !important;
  border: 1px solid rgba(255, 255, 255, 0.1) !important;
  border-radius: 0 !important;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.7) !important;
  padding: 10px !important;
}

/* Create a backdrop for all color pickers */
div[style*="position: relative"] div[style*="position: absolute"][style*="display: grid"]::before {
  content: "" !important;
  position: fixed !important;
  top: 0 !important;
  left: 0 !important;
  right: 0 !important;
  bottom: 0 !important;
  background-color: rgba(0, 0, 0, 0.7) !important;
  z-index: -1 !important;
}

/* Apply specific styles to the selected color circles */
div[style*="width: 60px; height: 60px; border-radius: 50%; background-color"] {
  z-index: 1 !important;
}

/* Make sure the color cells are fully visible and consistent */
div[style*="position: absolute"][style*="display: grid"] > div {
  width: 35px !important;
  height: 35px !important;
  margin: 5px !important;
  border-radius: 50% !important;
  border: 1px solid rgba(255, 255, 255, 0.15) !important;
}

/* Fix for page content to prevent overflow */
div[style*="display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center"],
div[style*="display: flex; flex-direction: column; gap: 2px; justify-content: center"] {
  width: 100% !important;
  max-width: 100% !important;
  box-sizing: border-box !important;
  overflow: hidden !important;
}

/* Ensure the title is at the top and not overlapped */
div[style*="display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; background-color: white"] > p:first-child {
  z-index: 5 !important;
  position: relative !important;
  color: #ffffff !important;
}

/* Card title spacing */
p[style*="font-size: 20px; font-weight: bold; color: rgb(0, 0, 0);"] {
  margin-bottom: 25px !important;
  color: #ffffff !important;
  text-transform: uppercase !important;
}

/* Fix the selected color circles positions and spacing */
div[style*="position: relative"] {
  display: flex !important;
  justify-content: center !important;
  width: 100% !important;
  margin: 0 auto !important;
}

/* Selected color circles */
div[style*="width: 60px; height: 60px; border-radius: 50%;"] {
  margin: 10px auto !important;
  border: 2px solid rgba(255, 255, 255, 0.15) !important;
}

/* Center color palette bar — dark theme */
div[style*="background-color: white; border-radius: 10px; padding: 10px; height: 40px"] {
  background-color: rgba(255, 255, 255, 0.06) !important;
  border: 1px solid rgba(255, 255, 255, 0.08) !important;
  border-radius: 0 !important;
  max-width: 90% !important;
  margin: 15px auto !important;
  overflow: hidden !important;
}

/* Main content card — dark glass panel */
div[style*="display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; background-color: white"] {
  background-color: rgba(255, 255, 255, 0.03) !important;
  border: 1px solid rgba(255, 255, 255, 0.08) !important;
  border-radius: 0 !important;
  padding: 20px 15px 25px !important;
  display: flex !important;
  flex-direction: column !important;
  justify-content: space-between !important;
  min-height: 450px !important;
}

/* Balance vertical spacing */
div[style*="display: flex; flex-direction: column; gap: 2px; justify-content: center; align-items: center; height: 100%;"] {
  justify-content: space-between !important;
  height: auto !important;
}

/* ================================
   Mobile Specific Adjustments
   ================================ */
@media screen and (max-width: 767px) {
  /* Target the button containers using the exact structure from the code */
  div[style*="position: absolute; bottom"] {
    position: fixed !important;
    bottom: 20px !important;
    z-index: 1000 !important;
  }

  /* Position the back button container (left side) */
  div[style*="position: absolute; bottom"][style*="left"] {
    left: 10px !important;
  }

  /* Position the next button container (right side) */
  div[style*="position: absolute; bottom"][style*="right"] {
    right: 10px !important;
  }

  /* Make the buttons smaller on mobile */
  .button {
    padding: 10px 24px !important;
    font-size: 0.75rem !important;
  }

  /* Add bottom padding to the body to ensure content isn't hidden */
  body {
    padding-bottom: 70px !important;
  }

  /* Fix centering issues on mobile sport selection screen */
  .momuto-sport-grid {
    padding: 10px 0;
    margin-left: auto;
    margin-right: auto;
    width: 90%;
  }

  /* Color picker for mobile - ensure 4 colors per row */
  div[style*="position: absolute"][style*="display: grid"] {
    grid-template-columns: repeat(4, 1fr) !important;
    max-width: 200px !important;
    max-height: 60vh !important;
  }

  /* Main card size on mobile */
  div[style*="display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; background-color: white"] {
    width: 92% !important;
    background-color: rgba(255, 255, 255, 0.03) !important;
    border: 1px solid rgba(255, 255, 255, 0.08) !important;
    border-radius: 0 !important;
  }
}

/* ================================
   Welcome Screen and Card Pages — Dark Theme
   ================================ */
/* Dark glass cards */
div[style*="display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; background-color: white"],
div[style*="background-color: white; border-radius: 10px; box-shadow:"] {
  background-color: rgba(255, 255, 255, 0.03) !important;
  border: 1px solid rgba(255, 255, 255, 0.08) !important;
  border-radius: 0 !important;
  box-shadow: none !important;
  padding: 20px 15px !important;
  margin: 10px auto !important;
  width: 90% !important;
  max-width: 500px !important;
  overflow: hidden !important;
}

/* Welcome text spacing */
p[style*="font-size: 20px; font-weight: bold; color: rgb(0, 0, 0);"],
p[style*="font-weight: bold; margin-bottom:"] {
  margin-top: 10px !important;
  margin-bottom: 15px !important;
  color: #ffffff !important;
}

/* ================================
   Additional Improvements
   ================================ */

/* Target main content container — dark background + scroll fix */
div[style*="display: flex; flex-direction: column; height: 100vh"] {
  background-color: #050505 !important;
  background: radial-gradient(circle at 50% 30%, #1a1a1a 0%, #050505 70%) !important;
  overflow-y: auto !important;
  overflow-x: hidden !important;
}

/* Improve button spacing on larger screens */
@media screen and (min-width: 768px) {
  /* Increase button size and improve style on desktop */
  .button {
    padding: 14px 32px !important;
    font-size: 0.85rem !important;
    min-width: 120px !important;
  }

  /* Position back button with proper spacing */
  div[style*="position: absolute; bottom"][style*="left"] {
    left: 40px !important;
    bottom: 40px !important;
  }

  /* Position next button with proper spacing */
  div[style*="position: absolute; bottom"][style*="right"] {
    right: 40px !important;
    bottom: 40px !important;
  }

  /* Ensure consistent button alignment */
  div[style*="position: absolute; bottom"] .button {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
  }

  /* Improve button text readability */
  .button p {
    margin: 0 !important;
    padding: 0 !important;
    font-weight: 700 !important;
    color: inherit !important;
  }

  /* Fix spacing for button icons */
  .button img {
    margin-left: 8px !important;
  }

  /* Color picker for desktop - 5 colors per row */
  div[style*="position: absolute"][style*="display: grid"] {
    grid-template-columns: repeat(5, 1fr) !important;
    max-width: 300px !important;
  }

  /* Improve sport selection screen proportions on desktop */
  .momuto-container {
    max-width: 800px;
    padding: 40px;
  }

  .momuto-sport-grid {
    max-width: 700px;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
    margin: 40px auto;
  }

  .momuto-sport-button {
    padding: 20px 24px;
    font-size: 0.85rem;
  }

  .momuto-button-icon {
    width: 24px;
    height: 24px;
  }

  .momuto-logo {
    width: 140px;
    margin: 0 auto 10px;
  }

  .momuto-title {
    font-size: clamp(1.5rem, 5vw, 2.2rem);
    margin: 10px 0 50px;
  }
}

/* For screens wider than 1200px (large desktops) */
@media screen and (min-width: 1200px) {
  /* Further increase spacing for better desktop experience */
  div[style*="position: absolute; bottom"][style*="left"] {
    left: 60px !important;
    bottom: 50px !important;
  }

  div[style*="position: absolute; bottom"][style*="right"] {
    right: 60px !important;
    bottom: 50px !important;
  }

  /* Make sport selection screen more proportional to screen size */
  .momuto-container {
    max-width: 1000px;
  }

  .momuto-sport-grid {
    max-width: 900px;
  }

  .momuto-logo {
    width: 150px;
  }

  .momuto-title {
    font-size: clamp(1.5rem, 6vw, 2.8rem);
  }
}


/* ================================================================
   3D CONFIGURATOR TOOL — Momuto Dark Theme
   Overrides the bundled styled-component colors to match
   the Momuto design system (dark-first, glass-morphism, sharp)
   ================================================================ */

/* --------------------------------
   1. Canvas / 3D Viewport Background
   The app renders a fixed full-viewport div with #f5f7fa.
   Override it to a clean dark tone.
   -------------------------------- */
div[style*="position: fixed"][style*="width: 100vw"][style*="height: 100vh"] {
  background-color: #0a0a0a !important;
}

/* Also catch the canvas element itself */
canvas {
  background-color: #0a0a0a !important;
}

/* --------------------------------
   2. Top Navigation Bar
   Styled-component: fixed, full width, bg #606060
   -------------------------------- */

/* Desktop top bar */
.MuiAppBar-root {
  background-color: #0d0d0d !important;
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.06) !important;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06) !important;
  font-family: 'Jost', sans-serif !important;
}

/* Mobile top bar — styled-component with bg #606060 */
div[style*="position: fixed"][style*="width: 100vw"][style*="flex-direction: row"][style*="justify-content: space-between"] {
  background-color: #0d0d0d !important;
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.06) !important;
}

/* Top bar buttons (save, share, etc.) */
.MuiAppBar-root button,
.MuiAppBar-root .MuiIconButton-root {
  color: #a1a1aa !important;
  transition: color 200ms ease !important;
}

.MuiAppBar-root button:hover,
.MuiAppBar-root .MuiIconButton-root:hover {
  color: #ffffff !important;
  background-color: rgba(255, 255, 255, 0.06) !important;
}

/* --------------------------------
   3. Left & Right Side Toolbars (Desktop)
   Styled-components: bg #606060, border #3c3c3c
   -------------------------------- */

/* Left toolbar */
div[style*="position: fixed"][style*="background-color: rgb(96, 96, 96)"][style*="border-right"] {
  background-color: #0d0d0d !important;
  border-right-color: rgba(255, 255, 255, 0.06) !important;
}

/* Right toolbar */
div[style*="position: fixed"][style*="background-color: rgb(96, 96, 96)"][style*="border-left"] {
  background-color: #0d0d0d !important;
  border-left-color: rgba(255, 255, 255, 0.06) !important;
}

/* Toolbar icon buttons */
div[style*="background-color: rgb(96, 96, 96)"] button,
div[style*="background-color: rgb(96, 96, 96)"] .MuiIconButton-root {
  color: #a1a1aa !important;
  transition: all 200ms ease !important;
}

div[style*="background-color: rgb(96, 96, 96)"] button:hover,
div[style*="background-color: rgb(96, 96, 96)"] .MuiIconButton-root:hover {
  color: #ffffff !important;
  background-color: rgba(255, 255, 255, 0.08) !important;
}

/* --------------------------------
   4. Bottom Bar (Mobile & Desktop)
   Styled-component: bg #3c3c3c
   -------------------------------- */

/* Mobile bottom bar */
div[style*="position: fixed"][style*="background-color: rgb(60, 60, 60)"] {
  background-color: #0d0d0d !important;
  box-shadow: 0 -1px 0 rgba(255, 255, 255, 0.06) !important;
  border-top: 1px solid rgba(255, 255, 255, 0.06) !important;
}

/* Bottom bar buttons */
div[style*="background-color: rgb(60, 60, 60)"] button {
  color: #a1a1aa !important;
  border-color: rgba(255, 255, 255, 0.12) !important;
  font-family: 'Jost', sans-serif !important;
}

div[style*="background-color: rgb(60, 60, 60)"] button:hover {
  color: #ffffff !important;
}

/* --------------------------------
   5. Tool Panels (Design, Pattern, Gradient, Number, Text, Logo)
   Styled-components: bg #606060 or rgba(60,60,60,1)
   These open as absolute-positioned overlays inside the tool area
   -------------------------------- */

/* Tool panels that overlay the 3D viewport */
div[style*="position: absolute"][style*="background: rgb(96, 96, 96)"],
div[style*="position: absolute"][style*="background-color: rgb(96, 96, 96)"] {
  background: #111111 !important;
  background-color: #111111 !important;
  border-right: 1px solid rgba(255, 255, 255, 0.06) !important;
}

/* Left panel (design tools, wider panel) */
div[style*="position: fixed"][style*="background-color: rgba(60, 60, 60"] {
  background-color: #111111 !important;
  border-right-color: rgba(255, 255, 255, 0.06) !important;
}

/* Design toolbar area */
div[style*="background-color: rgb(96, 96, 96)"][style*="height:"] {
  background-color: #111111 !important;
}

/* --------------------------------
   6. Design/Pattern List Items
   Styled-components: transparent bg, hover/active #3c3c3c
   -------------------------------- */

/* List items in design/pattern selection */
.MuiImageList-root li,
ul li[style*="cursor: pointer"] {
  border-radius: 0 !important;
  transition: background-color 200ms ease !important;
}

.MuiImageList-root li:hover,
.MuiImageList-root li.active {
  background-color: rgba(255, 255, 255, 0.08) !important;
}

/* Grid-style design selection buttons */
.MuiButton-root[style*="background-color: rgb(224, 224, 224)"],
button[style*="background-color: rgb(224, 224, 224)"] {
  background-color: rgba(255, 255, 255, 0.06) !important;
  color: #a1a1aa !important;
  border-color: rgba(255, 255, 255, 0.08) !important;
  font-family: 'Jost', sans-serif !important;
}

.MuiButton-root[style*="background-color: rgb(224, 224, 224)"]:hover,
button[style*="background-color: rgb(224, 224, 224)"]:hover {
  background-color: rgba(255, 255, 255, 0.12) !important;
  color: #ffffff !important;
}

/* Pattern/design item cards — hover #c1c1c1 override */
button[style*="background-color: rgb(193, 193, 193)"],
div[style*="background-color: rgb(193, 193, 193)"] {
  background-color: rgba(255, 255, 255, 0.12) !important;
}

/* --------------------------------
   7. MUI Dialog / Modal Overrides
   Used for tool option panels, confirmations, etc.
   -------------------------------- */

.MuiDialog-paper,
.MuiPaper-root.MuiDialog-paper {
  background-color: #111111 !important;
  background-image: none !important;
  color: #ffffff !important;
  border: 1px solid rgba(255, 255, 255, 0.08) !important;
  border-radius: 0 !important;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.8) !important;
  font-family: 'Jost', sans-serif !important;
}

.MuiDialogTitle-root {
  color: #ffffff !important;
  font-family: 'Jost', sans-serif !important;
  font-weight: 700 !important;
  text-transform: uppercase !important;
  letter-spacing: 0.02em !important;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06) !important;
}

.MuiDialogContent-root {
  color: #a1a1aa !important;
  font-family: 'Jost', sans-serif !important;
}

.MuiDialogActions-root {
  border-top: 1px solid rgba(255, 255, 255, 0.06) !important;
}

/* Dialog backdrop */
.MuiModal-backdrop,
.MuiBackdrop-root {
  background-color: rgba(0, 0, 0, 0.75) !important;
}

/* Dialog buttons — Momuto style */
.MuiDialogActions-root .MuiButton-root,
.MuiDialog-paper .MuiButton-root {
  background-color: #ffffff !important;
  color: #000000 !important;
  border-radius: 0 !important;
  font-family: 'Jost', sans-serif !important;
  font-weight: 700 !important;
  text-transform: uppercase !important;
  letter-spacing: 0.05em !important;
  box-shadow: none !important;
  transition: all 200ms ease !important;
}

.MuiDialogActions-root .MuiButton-root:hover,
.MuiDialog-paper .MuiButton-root:hover {
  background-color: #e63946 !important;
  color: #ffffff !important;
}

/* Text-only buttons in dialogs */
.MuiDialog-paper .MuiButton-text {
  background-color: transparent !important;
  color: #a1a1aa !important;
}

.MuiDialog-paper .MuiButton-text:hover {
  background-color: rgba(255, 255, 255, 0.06) !important;
  color: #ffffff !important;
}

/* --------------------------------
   8. MUI Paper (General)
   Used as container for many sub-panels
   -------------------------------- */

.MuiPaper-root {
  background-color: #111111 !important;
  background-image: none !important;
  color: #ffffff !important;
  border-radius: 0 !important;
}

/* Elevated paper surfaces */
.MuiPaper-elevation {
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5) !important;
}

/* --------------------------------
   9. MUI Buttons (General)
   Override default MUI button styles
   -------------------------------- */

/* Contained buttons */
.MuiButton-contained,
.MuiButton-containedPrimary {
  background-color: #ffffff !important;
  color: #000000 !important;
  border-radius: 0 !important;
  font-family: 'Jost', sans-serif !important;
  font-weight: 700 !important;
  text-transform: uppercase !important;
  letter-spacing: 0.05em !important;
  box-shadow: none !important;
}

.MuiButton-contained:hover,
.MuiButton-containedPrimary:hover {
  background-color: #e63946 !important;
  color: #ffffff !important;
  box-shadow: none !important;
}

/* Outlined buttons */
.MuiButton-outlined {
  border-color: rgba(255, 255, 255, 0.15) !important;
  color: #a1a1aa !important;
  border-radius: 0 !important;
  font-family: 'Jost', sans-serif !important;
  font-weight: 700 !important;
  text-transform: uppercase !important;
}

.MuiButton-outlined:hover {
  border-color: #ffffff !important;
  color: #ffffff !important;
  background-color: rgba(255, 255, 255, 0.06) !important;
}

/* Text buttons */
.MuiButton-text {
  color: #a1a1aa !important;
  font-family: 'Jost', sans-serif !important;
}

.MuiButton-text:hover {
  color: #ffffff !important;
  background-color: rgba(255, 255, 255, 0.06) !important;
}

/* Icon buttons */
.MuiIconButton-root {
  color: #a1a1aa !important;
  transition: all 200ms ease !important;
}

.MuiIconButton-root:hover {
  color: #ffffff !important;
  background-color: rgba(255, 255, 255, 0.08) !important;
}

/* --------------------------------
   10. MUI Tabs
   Step indicator / navigation tabs
   -------------------------------- */

.MuiTabs-root {
  background-color: transparent !important;
  font-family: 'Jost', sans-serif !important;
}

.MuiTab-root {
  color: #a1a1aa !important;
  font-family: 'Jost', sans-serif !important;
  font-weight: 700 !important;
  text-transform: uppercase !important;
  letter-spacing: 0.05em !important;
  transition: color 200ms ease !important;
}

.MuiTab-root:hover {
  color: #ffffff !important;
}

.MuiTab-root.Mui-selected {
  color: #ffffff !important;
}

/* Tab indicator line */
.MuiTabs-indicator {
  background-color: #e63946 !important;
}

/* --------------------------------
   11. Form Controls (Inputs, Sliders, Switches)
   -------------------------------- */

/* Text inputs */
.MuiInputBase-root,
.MuiOutlinedInput-root {
  color: #ffffff !important;
  font-family: 'Jost', sans-serif !important;
}

.MuiOutlinedInput-notchedOutline {
  border-color: rgba(255, 255, 255, 0.12) !important;
}

.MuiOutlinedInput-root:hover .MuiOutlinedInput-notchedOutline {
  border-color: rgba(255, 255, 255, 0.3) !important;
}

.MuiOutlinedInput-root.Mui-focused .MuiOutlinedInput-notchedOutline {
  border-color: #e63946 !important;
}

/* Input labels */
.MuiInputLabel-root,
.MuiFormLabel-root {
  color: #a1a1aa !important;
  font-family: 'Jost', sans-serif !important;
}

.MuiFormLabel-root.Mui-focused {
  color: #e63946 !important;
}

/* Sliders */
.MuiSlider-root {
  color: #e63946 !important;
}

.MuiSlider-rail {
  background-color: rgba(255, 255, 255, 0.12) !important;
}

.MuiSlider-track {
  background-color: #e63946 !important;
  border-color: #e63946 !important;
}

.MuiSlider-thumb {
  background-color: #ffffff !important;
  border: 2px solid #e63946 !important;
}

.MuiSlider-thumb:hover,
.MuiSlider-thumb.Mui-focusVisible {
  box-shadow: 0 0 0 6px rgba(230, 57, 70, 0.2) !important;
}

/* Switches — already partially dark in the bundle */
.MuiSwitch-track {
  background-color: rgba(255, 255, 255, 0.15) !important;
}

.MuiSwitch-switchBase.Mui-checked + .MuiSwitch-track {
  background-color: #e63946 !important;
  opacity: 1 !important;
}

.MuiSwitch-thumb {
  background-color: #ffffff !important;
}

/* --------------------------------
   12. Typography & Text
   Force Jost font and appropriate colors throughout
   -------------------------------- */

/* All MUI typography */
.MuiTypography-root {
  font-family: 'Jost', sans-serif !important;
  color: #ffffff !important;
}

/* Secondary/body text */
.MuiTypography-body2,
.MuiTypography-caption {
  color: #a1a1aa !important;
}

/* Styled-component text that uses #e0e0e0 */
span[style*="color: rgb(224, 224, 224)"],
p[style*="color: rgb(224, 224, 224)"],
div[style*="color: rgb(224, 224, 224)"] {
  color: #a1a1aa !important;
  font-family: 'Jost', sans-serif !important;
}

/* Text with #333 color (from dialogs/buttons) */
span[style*="color: rgb(51, 51, 51)"],
p[style*="color: rgb(51, 51, 51)"],
div[style*="color: rgb(51, 51, 51)"],
button[style*="color: rgb(51, 51, 51)"] {
  color: #ffffff !important;
}

/* Labels and small text in tool panels */
label {
  color: #a1a1aa !important;
  font-family: 'Jost', sans-serif !important;
}

/* --------------------------------
   13. Styled-Component Color Overrides
   Target elements rendered with specific inline bg colors
   -------------------------------- */

/* #606060 backgrounds (toolbars, panels) */
div[style*="background-color: rgb(96, 96, 96)"],
div[style*="background: rgb(96, 96, 96)"] {
  background-color: #0d0d0d !important;
  background: #0d0d0d !important;
}

/* #3c3c3c backgrounds (bottom bar, active items, borders) */
div[style*="background-color: rgb(60, 60, 60)"],
div[style*="background: rgb(60, 60, 60)"] {
  background-color: #0d0d0d !important;
  background: #0d0d0d !important;
}

/* rgba(60,60,60,1) backgrounds */
div[style*="background-color: rgba(60, 60, 60"] {
  background-color: #111111 !important;
}

/* #535353 backgrounds — require layout property to spare swatches */
div[style*="background-color: rgb(83, 83, 83)"][style*="display"],
div[style*="background-color: rgb(83, 83, 83)"][style*="position"],
div[style*="background: rgb(83, 83, 83)"][style*="display"],
div[style*="background: rgb(83, 83, 83)"][style*="position"] {
  background-color: rgba(255, 255, 255, 0.06) !important;
  background: rgba(255, 255, 255, 0.06) !important;
}

/* #f5f7fa canvas background */
div[style*="background-color: rgb(245, 247, 250)"] {
  background-color: #0a0a0a !important;
}

/* White backgrounds that leak through — require layout property
   so color-picker swatches (plain divs with only bg-color) are spared */
div[style*="background-color: rgb(255, 255, 255)"][style*="display"],
div[style*="background-color: rgb(255, 255, 255)"][style*="position"],
div[style*="background: rgb(255, 255, 255)"][style*="display"],
div[style*="background: rgb(255, 255, 255)"][style*="position"] {
  background-color: #111111 !important;
  background: #111111 !important;
}

/* #f2f2f2 hover backgrounds */
button[style*="background-color: rgb(242, 242, 242)"]:hover,
div[style*="background-color: rgb(242, 242, 242)"][style*="display"] {
  background-color: rgba(255, 255, 255, 0.08) !important;
}

/* #f1f1f1 hover backgrounds */
button[style*="background-color: rgb(241, 241, 241)"],
div[style*="background-color: rgb(241, 241, 241)"][style*="display"] {
  background-color: rgba(255, 255, 255, 0.08) !important;
}

/* --------------------------------
   14. Borders — Replace solid gray borders with glass-morphism
   -------------------------------- */

/* Replace #3c3c3c borders */
div[style*="border-right: 0.3em solid rgb(60, 60, 60)"],
*[style*="border-right: 0.3em solid rgb(60, 60, 60)"] {
  border-right: 1px solid rgba(255, 255, 255, 0.06) !important;
}

div[style*="border-left: 0.3em solid rgb(60, 60, 60)"],
*[style*="border-left: 0.3em solid rgb(60, 60, 60)"] {
  border-left: 1px solid rgba(255, 255, 255, 0.06) !important;
}

/* Replace #e5e5e5 borders */
*[style*="border-color: rgb(229, 229, 229)"] {
  border-color: rgba(255, 255, 255, 0.1) !important;
}

/* Replace #e9e9e9 borders */
*[style*="border-color: rgb(233, 233, 233)"] {
  border-color: rgba(255, 255, 255, 0.08) !important;
}

/* --------------------------------
   15. Specific Panel Elements
   -------------------------------- */

/* Fixed-position utility button (top right area, e.g. undo/redo) */
div[style*="position: fixed"][style*="right: 8em"][style*="top: 5em"] button {
  background-color: rgba(255, 255, 255, 0.06) !important;
  color: #a1a1aa !important;
  border-color: rgba(255, 255, 255, 0.08) !important;
}

div[style*="position: fixed"][style*="right: 8em"][style*="top: 5em"] button:hover {
  background-color: rgba(255, 255, 255, 0.12) !important;
  color: #ffffff !important;
}

/* Tool panel text/labels (styled-components with color: #e0e0e0) */
input[style*="color: rgb(224, 224, 224)"],
input[style*="border-bottom"] {
  color: #ffffff !important;
  border-bottom-color: rgba(255, 255, 255, 0.15) !important;
  font-family: 'Jost', sans-serif !important;
}

/* Fieldsets in tool panels */
fieldset {
  border-color: rgba(255, 255, 255, 0.08) !important;
}

/* Panel divider lines (#333) */
div[style*="background-color: rgb(51, 51, 51)"][style*="height: 0.1em"],
div[style*="background-color:#333"] {
  background-color: rgba(255, 255, 255, 0.08) !important;
}

/* --------------------------------
   15b. Font Preview Images — Invert for Dark Theme
   Font name PNGs are black-on-transparent; invert to white
   -------------------------------- */

img[src*="fonts/names"] {
  filter: invert(1) !important;
}

/* --------------------------------
   16. MUI Popover / Menu
   Used for dropdown menus
   -------------------------------- */

.MuiPopover-paper,
.MuiMenu-paper {
  background-color: #111111 !important;
  color: #ffffff !important;
  border: 1px solid rgba(255, 255, 255, 0.08) !important;
  border-radius: 0 !important;
}

.MuiMenuItem-root {
  color: #a1a1aa !important;
  font-family: 'Jost', sans-serif !important;
}

.MuiMenuItem-root:hover {
  background-color: rgba(255, 255, 255, 0.06) !important;
  color: #ffffff !important;
}

.MuiMenuItem-root.Mui-selected {
  background-color: rgba(255, 255, 255, 0.08) !important;
  color: #ffffff !important;
}

/* --------------------------------
   17. Scrollbar Styling
   -------------------------------- */

::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

::-webkit-scrollbar-track {
  background: #0a0a0a;
}

::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.15);
  border-radius: 0;
}

::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.25);
}

/* --------------------------------
   18. Selection / Highlight
   -------------------------------- */

::selection {
  background: rgba(230, 57, 70, 0.3);
  color: #ffffff;
}

/* --------------------------------
   19. Tooltip
   -------------------------------- */

.MuiTooltip-tooltip {
  background-color: #1a1a1a !important;
  color: #ffffff !important;
  font-family: 'Jost', sans-serif !important;
  font-size: 0.7rem !important;
  border: 1px solid rgba(255, 255, 255, 0.08) !important;
  border-radius: 0 !important;
}

/* --------------------------------
   20. Checkbox / Radio
   -------------------------------- */

.MuiCheckbox-root,
.MuiRadio-root {
  color: rgba(255, 255, 255, 0.3) !important;
}

.MuiCheckbox-root.Mui-checked,
.MuiRadio-root.Mui-checked {
  color: #e63946 !important;
}

/* ================================
   3D Tool — Mobile Overrides
   ================================ */

@media screen and (max-width: 767px) {
  /* Mobile top bar dark override */
  div[style*="position: fixed"][style*="width: 100vw"][style*="background-color: rgb(96, 96, 96)"] {
    background-color: #0d0d0d !important;
    box-shadow: 0 1px 0 rgba(255, 255, 255, 0.06) !important;
  }

  /* Mobile bottom bar dark override */
  div[style*="position: fixed"][style*="background-color: rgb(60, 60, 60)"][style*="overflow-x: auto"] {
    background-color: #0d0d0d !important;
    box-shadow: 0 -1px 0 rgba(255, 255, 255, 0.06) !important;
  }

  /* Ensure tool panels are dark on mobile */
  div[style*="background-color: rgb(96, 96, 96)"] {
    background-color: #0d0d0d !important;
  }
}

/* ================================
   3D Tool — Desktop Overrides
   ================================ */

@media screen and (min-width: 768px) {
  /* Ensure all #606060 panels are properly dark on desktop */
  div[style*="position: fixed"][style*="background-color: rgb(96, 96, 96)"] {
    background-color: #0d0d0d !important;
  }
}
