/* ==========================================================================
   Base Styles
========================================================================== */

html,
body {
  margin: 0;
  padding: 0;
  height: 100%;
  font-family: sans-serif;
  overflow: hidden;
}

svg {
  position: absolute;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
}

/* ==========================================================================
   Typography
========================================================================== */

h1 {
  color: #ffffff;
  font-family: 'Cabinet Grotesk', sans-serif;
  font-optical-sizing: auto;
  font-size: 2rem;
  font-weight: 400;
  line-height: 88%;
}

.page-title {
  background: none;
  left: 50%;
  margin: 0;
  padding: 10px 16px;
  position: absolute;
  top: 20px;
  transform: translateX(-50%);
  z-index: 10;
}

/* ==========================================================================
   Controls Layout
========================================================================== */

.controls-bar {
  background: #f7f7f7;
  border-radius: 4px;
  bottom: 20px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  display: flex;
  justify-content: center;
  left: 50%;
  padding: 16px 24px;
  position: absolute;
  transform: translateX(-50%);
  z-index: 10;
}

.controls {
  align-items: flex-end;
  display: flex;
  flex-wrap: nowrap;
  gap: 1.25rem;
  justify-content: center;
}

.control-group {
  align-items: flex-start;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.control-group label {
  align-items: center;
  color: #f64a4d;
  display: flex;
  font-family: 'Satoshi', sans-serif;
  font-size: 1rem;
  font-weight: 600;
  gap: 0.6rem;
  margin-bottom: 0.5rem;
}

/* ==========================================================================
   Sliders
========================================================================== */

.slider-row {
  align-items: center;
  display: flex;
  gap: 0.5rem;
}

.slider-value {
  align-items: center;
  background-color: #ffe7dd;
  border: none;
  border-radius: 6px;
  box-sizing: border-box;
  color: #f64a4d;
  display: flex;
  font-family: 'Satoshi', sans-serif;
  font-size: 1rem;
  font-weight: 500;
  height: 30px;
  justify-content: center;
  outline: none;
  text-align: center;
  width: 30px;
}

input[type="range"] {
  -webkit-appearance: none;
  background: transparent;
  cursor: pointer;
  height: 24px;
  width: 150px;
}

input[type="range"]::-webkit-slider-runnable-track {
  background: #f64a4d;
  border-radius: 6px;
  height: 2px;
}

input[type="range"]::-moz-range-track {
  background: #f64a4d;
  border-radius: 6px;
  height: 2px;
}

input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  background: #f64a4d;
  border-radius: 50%;
  height: 12px;
  margin-top: -5px;
  transition: background 0.2s ease;
  width: 12px;
}

input[type="range"]::-moz-range-thumb {
  background: #f64a4d;
  border: none;
  border-radius: 50%;
  height: 12px;
  transition: background 0.2s ease;
  width: 12px;
}

input[type="range"]:hover::-webkit-slider-thumb,
input[type="range"]:hover::-moz-range-thumb {
  background: #f64a4d;
}

/* ==========================================================================
   Color Inputs
========================================================================== */

.color-group {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin: 0;
}

.color-inputs {
  align-items: flex-end;
  display: flex;
  gap: 0.5rem;
}

input[type="color"] {
  -webkit-appearance: none;
  appearance: none;
  background-color: transparent;
  border: none !important;
  border-radius: 6px;
  box-sizing: border-box;
  cursor: pointer;
  height: 30px;
  margin: 0;
  outline: none !important;
  padding: 0;
  width: 30px;
}

input[type="color"]::-webkit-color-swatch-wrapper {
  border: none;
  border-radius: 6px;
  padding: 0;
}

input[type="color"]::-webkit-color-swatch {
  border: none;
  border-radius: 6px;
}

input[type="color"]::-moz-color-swatch {
  border: none;
  border-radius: 6px;
}

input[type="text"] {
  background-color: #ffe7dd;
  border: none;
  border-radius: 6px;
  box-sizing: border-box;
  color: #f64a4d;
  font-family: 'Satoshi', sans-serif;
  font-size: 1rem;
  font-weight: 500;
  height: 30px;
  outline: none;
  padding: 5px;
  text-align: center;
  width: 80px;
}

/* ==========================================================================
   Info Tooltip
========================================================================== */

.info-icon {
  align-items: center;
  color: #f64a4d;
  cursor: pointer;
  display: inline-flex;
  height: 16px;
  justify-content: center;
  position: relative;
  width: 16px;
}

.info-icon svg {
  display: block;
  height: 100%;
  width: 100%;
}

.info-icon::after {
  background: #f64a4d;
  border-radius: 4px;
  bottom: 125%;
  color: #ffffff;
  content: attr(data-tooltip);
  font-size: 0.8rem;
  font-weight: 500;
  left: 0;
  opacity: 0;
  padding: 6px 8px;
  pointer-events: none;
  position: absolute;
  transform: translateX(0);
  transition: opacity 0.2s ease;
  white-space: nowrap;
  z-index: 10;
}

.info-icon:hover::after {
  opacity: 1;
}

/* ==========================================================================
   Buttons
========================================================================== */

.control-buttons {
  display: flex;
  gap: 0.5rem;
  margin-top: 0;
}

button {
  background: #f64a4d;
  border: none;
  border-radius: 6px;
  color: #ffffff;
  cursor: pointer;
  font-family: 'Satoshi', sans-serif;
  font-size: 0.85rem;
  font-weight: 500;
  min-width: 90px;
  padding: 6px 10px;
}

button:hover {
  background: #f64a4d;
}

/* ==========================================================================
   Links
========================================================================== */

.link {
  position: absolute;
  bottom: 20px;
  right: 24px;
  font-family: 'Satoshi', sans-serif;
  font-size: 0.85rem;
  font-weight: 500;
  color: #ffffff;
  text-decoration: none;
  z-index: 10;
  width: auto;
  padding: 8px 12px;
  border-radius: 20px;
  background-color: #f64a4d;
}

.link:hover {
  text-decoration: none;
}

/* ==========================================================================
   Responsive Adjustments
========================================================================== */

@media (max-width: 600px) {
  .controls-bar {
    position: fixed;
    bottom: 0;
    left: 0;
    transform: none;
    width: 100%;
    height: 40vh;
    padding: 16px;
    padding-top: 30px;
    box-sizing: border-box;
    border-radius: 12px 12px 0 0;
    background: #f7f7f7;
    z-index: 10;
    display: flex;
    flex-direction: column;
  }

  .controls {
    flex: 1;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    align-items: stretch;
    justify-content: flex-start;
  }

  .control-group {
    width: 100%;
  }

  .slider-row,
  .color-inputs,
  .control-buttons {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.5rem;
    width: 100%;
  }

  input[type="range"] {
    -webkit-appearance: none;
    appearance: none;
    background: transparent;
    cursor: pointer;
    height: 24px;
    width: 100%;
    flex: 1;
  }

  .info-icon::after {
    bottom: auto;
    top: 100%;
    left: 150%;
    right: auto;
    transform: translateY(-50%);
  }

  .control-buttons {
    justify-content: flex-start;
  }

  .control-buttons button {
    flex: 1;
    min-width: 0;
  }

  .link {
    display: none;
  }

  .page-title {
    top: 20px;
    font-size: 1.6rem;
    padding: 8px 12px;
    white-space: nowrap;
  }

  svg {
    height: 60vh;
  }
}