/* ===== BASE ===== */
/* Screen reader only utility */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* Base element styles */
body {
  margin: 0;
  padding: 2rem;
  box-sizing: border-box;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
    Oxygen, Ubuntu, Cantarell, "Open Sans", "Helvetica Neue", sans-serif;
  font-size: 16px;
  line-height: 1.5;
  background: #8e2de2; /* fallback for old browsers */
  background: -webkit-linear-gradient(
    to right,
    #4a00e0,
    #8e2de2
  ); /* Chrome 10-25, Safari 5.1-6 */
  background: linear-gradient(
    to right,
    #4a00e0,
    #8e2de2
  ); /* W3C, IE 10+/ Edge, Firefox 16+, Chrome 26+, Opera 12+, Safari 7+ */
}

/* Form element base styles */
input[type="range"] {
  -webkit-appearance: none;
  width: 100%;
}

input[type="range"]:focus {
  outline: none;
}

input[type="range"] {
  appearance: none;
}

input[type="range"]::-webkit-slider-runnable-track {
  width: 100%;
  height: 1px;
  background: black;
  border-radius: 1rem;
}

input[type="range"]::-webkit-slider-thumb {
  border: 1px solid #000000;
  height: 1.5rem;
  width: 1.5rem;
  border-radius: 50%;
  background: #ffffff;
  -webkit-appearance: none;
  margin-top: -12px;
}
input[type="range"]::-webkit-slider-thumb:hover {
  cursor: grab;
}
input[type="range"]::-webkit-slider-thumb:active {
  cursor: grabbing;
}

input[type="range"]:focus::-webkit-slider-runnable-track {
  background: black;
}

input[type="range"]::-moz-range-track {
  width: 100%;
  height: 1px;
  background: black;
  border-radius: 1rem;
}

input[type="range"]::-moz-range-thumb {
  border: 1px solid #000000;
  height: 1.5rem;
  width: 1.5rem;
  border-radius: 50%;
  background: #ffffff;
}

input[type="range"]::-ms-track {
  width: 100%;
  height: 1px;
  background: transparent;
  border-color: transparent;
  border-width: 16px 0;
  color: transparent;
}

input[type="range"]::-ms-fill-lower {
  background: black;
  border-radius: 1rem;
}

input[type="range"]::-ms-fill-upper {
  background: black;
  border-radius: 1rem;
}

input[type="range"]::-ms-thumb {
  border: 1px solid #000000;
  height: 1.5rem;
  width: 1.5rem;
  border-radius: 50%;
  background: #ffffff;
}

input[type="range"]:focus::-ms-fill-lower {
  background: black;
}

input[type="range"]:focus::-ms-fill-upper {
  background: black;
}

/* ===== LAYOUT ===== */
.l-stage {
  background-color: white;
  border-radius: 1rem;
  box-shadow: 0px 8px 48px rgba(0, 0, 0, 0.25),
    24px 24px 32px rgba(0, 0, 0, 0.16), 0px 4px 4px rgba(0, 0, 0, 0.25);
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  flex-direction: row;
  overflow: hidden;
  animation-name: slide-in, slide-open;
  animation-timing-function: ease-in-out, ease-in-out;
  animation-duration: 1s, 1s;
  animation-delay: 1s, 2s;
  animation-fill-mode: backwards, backwards;
}

.l-preview {
  background: repeating-conic-gradient(#f4f4f4 0 25%, #fff 0 50%) 50% / 20px
    20px;
  padding: 1.5rem;
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 512px;
  aspect-ratio: 1/1;
}

.l-controls {
  padding: 3rem;
  display: flex;
  flex-direction: column;
  gap: 3rem;
  flex: 1;
}

.l-footer {
  text-align: center;
  padding: 2rem;
  color: white;
}

/* ===== MODULE ===== */
/* Logo module */
.logo {
  margin: 2rem;
  display: block;
  text-align: center;
  animation-name: slide-up;
  animation-duration: 1s;
  animation-timing-function: ease-in-out;
  animation-delay: 1s;
  animation-fill-mode: backwards;
}

/* Control group module */
.control-group {
  display: grid;
  width: 100%;
  grid-template-columns: 120px 1fr;
  align-items: center;
  animation-name: slide-left;
  animation-duration: 1s;
  animation-delay: 3s;
  animation-fill-mode: backwards;
}

/* Staggered animation delays for control groups */
.control-group:nth-child(2) {
  animation-delay: 3s;
}
.control-group:nth-child(3) {
  animation-delay: 3.2s;
}
.control-group:nth-child(4) {
  animation-delay: 3.4s;
}
.control-group:nth-child(5) {
  animation-delay: 3.6s;
}
.control-group:nth-child(6) {
  animation-delay: 3.8s;
}

.control-label {
  font-weight: 600;
  margin: 0;
}

/* Privacy module */
.privacy {
  display: flex;
  flex-direction: row;
  gap: 1.5rem;
  justify-content: space-between;
  align-items: center;
  padding: 0.5rem 2rem;
  background: black;
  border-radius: 4px;
  color: white;
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 1000;
}
.top-button {
  position: fixed;
  top: 8px;
  right: 8px;
  z-index: 2;
  background-color: #ffffff;
  color: #000000;
  padding: 0.5rem 1rem;
  border-radius: 4px;
  text-decoration: none;
  font-size: 12px;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 400;
  height: 32px;
  justify-content: center;
  border: solid 1px #000000;
  border-radius: 4px;
  transition: background-color 0.2s ease;
}
.top-button:hover {
  background-color: #f4f4f4;
}
.top-button:active {
  background-color: #eee;
}
.top-button:focus {
  outline: 2px solid #4a00e0;
  outline-offset: 2px;
}
.top-button svg {
  width: 16px;
  height: 16px;
}
.privacy p {
  margin: 0;
  font-size: 12px;
}
.privacy .button {
  font-size: 12px;
  flex: 0;
  color: white;
  background: transparent;
  border: solid 1px white;
}
.privacy .button:hover {
  background-color: #333;
}
.privacy .actions {
  display: flex;
  gap: 0.5rem;
}

/* Button group module */
.button-group {
  display: flex;
  gap: 1rem;
  border: solid 1px #000000;
  border-radius: 4px;
}

.button-group input[type="radio"] {
  display: none;
}

.button-group input[type="radio"]:checked + label {
  background: #000000;
  color: #ffffff;
}

.button-group label {
  padding: 0.5rem 1rem;
  flex: 1;
  text-align: center;
}

/* Color picker module */
.color-picker {
  display: flex;
  gap: 0.5rem;
}

.clr-field {
  display: flex;
  justify-content: flex-end;
  border: solid 1px #000000;
  border-radius: 4px;
  overflow: hidden;
  flex: 1;
}

.clr-field input {
  border: none;
  padding: 0.5rem 1rem;
  flex: 1;
  text-align: center;
  box-sizing: border-box;
}

.clr-field button {
  border-left: solid 1px #000000;
  box-sizing: border-box;
  width: 1rem;
}

#clr-swatches div {
  justify-content: flex-start;
}

/* Button module */
.controls-actions {
  display: flex;
  gap: 0.5rem;
}

.button {
  display: flex;
  flex: 1;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.5rem 1.5rem;
  border-radius: 4px;
  border: solid 1px #000000;
  background: #ffffff;
  color: #000000;
  font-weight: 600;
  cursor: pointer;
  transition: background-color 0.2s ease;
}

/* Stroke settings module */
.stroke-settings {
  display: grid;
  width: 100%;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

/* Footer content module */
.footer-content p {
  margin: 0.5rem 0;
}

.footer-description {
  opacity: 0.8;
  font-size: 0.9rem;
  max-width: 600px;
  margin: 0.5rem auto;
}

.footer-nav {
  margin-top: 1rem;
  text-align: center;
}

.footer-nav a {
  color: #ffffff;
  text-decoration: none;
  font-size: 0.9rem;
  opacity: 0.8;
  transition: opacity 0.2s ease;
}

.footer-nav a:hover {
  opacity: 1;
  text-decoration: underline;
}

/* ===== PRIVACY POLICY PAGE ===== */
.privacy-policy {
  max-width: 800px;
  margin: 0 auto;
  padding: 2rem;
  background: rgba(255, 255, 255, 0.95);
  border-radius: 12px;
  margin-bottom: 2rem;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
}

.privacy-policy h1 {
  color: #4a00e0;
  font-size: 2.5rem;
  margin-bottom: 0.5rem;
  text-align: center;
}

.privacy-policy .last-updated {
  text-align: center;
  color: #666;
  font-size: 0.9rem;
  margin-bottom: 2rem;
  font-style: italic;
}

.privacy-policy section {
  margin-bottom: 2rem;
}

.privacy-policy h2 {
  color: #4a00e0;
  font-size: 1.5rem;
  margin-bottom: 1rem;
  margin-top: 2rem;
  border-bottom: 2px solid #8e2de2;
  padding-bottom: 0.5rem;
}

.privacy-policy h3 {
  color: #666;
  font-size: 1.2rem;
  margin-bottom: 0.8rem;
  margin-top: 1.5rem;
}

.privacy-policy p {
  line-height: 1.6;
  margin-bottom: 1rem;
  color: #333;
}

.privacy-policy ul {
  margin-left: 1.5rem;
  margin-bottom: 1rem;
}

.privacy-policy li {
  margin-bottom: 0.5rem;
  line-height: 1.5;
  color: #333;
}

.privacy-policy strong {
  color: #4a00e0;
  font-weight: 600;
}

.privacy-policy a {
  color: #8e2de2;
  text-decoration: none;
  transition: color 0.2s ease;
}

.privacy-policy a:hover {
  color: #4a00e0;
  text-decoration: underline;
}

/* Header navigation for privacy page */
.header-content {
  display: flex;
  justify-content: space-between;
  align-items: center;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 2rem;
}

.nav-link {
  color: #ffffff;
  text-decoration: none;
  font-size: 1rem;
  padding: 0.5rem 1rem;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.1);
  transition: background 0.2s ease;
}

.nav-link:hover {
  background: rgba(255, 255, 255, 0.2);
  text-decoration: none;
}

/* ===== STATE ===== */
.is-dotted {
  border-top: 1px dashed #ccc;
  padding-top: 3rem;
}

.button:hover {
  background: #f4f4f4;
}

.button:active {
  background: #eee;
}

.button:focus {
  outline: 2px solid #4a00e0;
  outline-offset: 2px;
}

/* ===== RESPONSIVE ===== */
/* Mobile responsive overrides */
@media (max-width: 768px) {
  .l-stage {
    flex-direction: column;
  }

  .l-preview {
    min-height: 300px;
  }

  .l-controls {
    padding: 2rem;
  }

  .logo {
    margin: 1rem;
  }

  .logo svg {
    width: 150px;
    height: auto;
  }
}
