/*
 https://color-ramp.com styles
 Created by Ricardo Zea - Sr. Web/Product Designer
 https://ricardozea.design
 Originally created on: 6/10/2025
*/

:root {
  --knob-light-mode-color: #000000; /* Default fallback for light mode knob */
  --knob-dark-mode-color: #FFFFFF;  /* Default fallback for dark mode knob */
  --switch-bg-light-mode-color: #EEEEEE; /* Default for light mode switch BG */
  --switch-bg-dark-mode-color: #333333;   /* Default for dark mode switch BG */
  --help-icon-color: #333333; /* Default for help icon */
  --help-icon-bg-color: rgba(255, 255, 255, 0.7); /* Default for help icon background */
  --help-icon-hover-bg-color: #555555; /* Default for help icon hover background */
  --help-icon-hover-color: #FFFFFF; /* Default for help icon hover color */
  --modal-bg-color: #fefefe; /* Default for modal background */
  --modal-text-color: #333333; /* Default for modal text */
  --modal-close-btn-color: var(--dark-gray); /* Default for modal close button */
  --input-bg-color: #FFFFFF; /* Default for input background */
  --input-text-color: #333333; /* Default for input text */
  --link-color: var(--primary-color);
  --link-hover-color: var(--hover-color);
  /* Theme and other global variables */
  --bg-color: #1a1a1a;
  --text-color: #fff;
  --border-color: #dee2e6;
  --primary-color: #0d6efd;
  --hover-color: #4e94fe;
  --light-gray: #e9ecef;
  --dark-gray: #495057;
}

*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  text-wrap: pretty;
}

body {
  margin: 0;
  padding: 20px;
  font-family: 'Atkinson Hyperlegible Next', sans-serif;
  font-size: clamp(14px, 1rem + 0.25vw, 50px);
  font-weight: 100;
  color: var(--text-color);
  line-height: 1.5;
  background-color: var(--bg-color);
  overflow-x: hidden; /* Prevent horizontal scroll from animations */
}

a, a:visited {
  color: var(--link-color);
  transition: color 0.2s ease;
}
a:hover, a:active, a:focus {
  color: var(--link-hover-color);
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  position: relative; /* Added for toast positioning context */
}

header {
  text-align: center;
  margin-bottom: 2rem;
}

header ul {
  max-width: 800px;
  margin: 0 auto;
  text-align: left;
}

.h1-container {
  position: relative;
  margin: 1.5rem 0 0;
}

.brand-icon-container {
  display: flex;
  height: 38px;
  margin-right: 10px;
}

h1 {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: clamp(1.8rem, 2rem + 2vw, 8rem);
  font-weight: 800;
  letter-spacing: -2px;
  line-height: 1;
  text-align: center;
  /* Color will be set by JavaScript based on Light Ramp 200 scale */
  color: #333; /* Fallback color */
}

p, label, ul {
  text-shadow: 0px 2px 0px black;
  margin-bottom: 1em;
}

label {
  margin-bottom: 0;
}

/* Container for color input */

.input-container {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 15px;
  flex-wrap: wrap;
  margin-bottom: 2rem;
}

.input-container label {
  width: 100%;
  text-align: center;
}

@media (min-width: 680px) {
  .input-container label {
    width: auto;
  }
}


.color-input {
  padding: 10px 15px;
  border: 1px solid var(--border-color);
  border-radius: 4px;
  font-size: clamp(0.9rem, 0.8rem + 0.5vw, 1.1rem);
  width: fit-content;
  text-align: center;
  transition: border-color 0.3s ease, box-shadow 0.3s ease;
  background-color: var(--input-bg-color);
  color: var(--input-text-color);
}

.color-preview {
  width: 40px;
  height: 40px;
  border-radius: 4px;
  border: 1px solid var(--border-color);
}

.ramp-container {
  display: flex;
  flex-direction: column;
  gap: 30px;
  margin-bottom: 40px;
}

.ramp-title {
  font-size: clamp(1rem, 0.9rem + 0.5vw, 1.25rem);
  font-weight: 600;
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  gap: 10px;
  color: #000;
}

.ramp {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  justify-content: space-between;
  width: 100%;
}

.light-mode-container {
  background-color: rgba(255, 255, 255, 0.7);
}

.dark-mode-container {
  background-color: rgba(0, 0, 0, 0.7);
}
.light-mode-container, .dark-mode-container {
  padding: 20px;
  border-radius: 8px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 1);
  backdrop-filter: blur(3px);
  min-height: auto;
}


.dark-mode-container .ramp-title {
  color: white;
}

.swatch {
  flex: 1;
  border-radius: 6px;
  overflow: hidden;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
  transition: transform 0.2s;
  position: relative;
  min-height: 160px; /* Approx height of a shade box with text */
  min-width: 80px; /* Ensure some minimum width */
}

.swatch:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

@media (max-width: 768px) {
  .swatch {
    min-width: 70px;
  }
}

.color-box {
  height: 100%;
}

.box-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  padding: 10px;
  text-align: center;
  width: 100%;
  height: 100%;
}

.color-name {
  font-weight: bold;
  font-size: 16px;
}

.accessibility-badge {
  display: inline-block;
  background-color: rgba(255, 255, 255, 0.7);
  border: 1px solid #aaa;
  color: #000;
  font-size: 10px;
  padding: 2px 4px;
  border-radius: 3px;
  font-weight: bold;
  width: fit-content;
}

.fail-shade {
  outline: 2px solid #7E0F00;
}

.fail-shade .accessibility-badge {
  background-color: #7E0F00;
  border-color: rgba(255, 255, 255, 0.2);
  color: #fff;
}

/* Accessibility notification banner */
.accessibility-banner {
  display: none; /* hidden until a failure is detected */
  margin-bottom: 1rem;
  padding: 0.75rem 1rem;
  border: 1px solid #fa6d5a;
  border-radius: 4px;
  background-color: #7E0F00;
  color: #fff;
  font-size: 1.1rem;
  text-align: center;
}
.accessibility-banner a,
.accessibility-banner a:visited {
  color: #fff;
  text-decoration: underline;
  font-weight: bold;
}

.accessibility-banner a:hover {
  color: #f5b0a6;
  text-decoration: none;
}

/* Smooth scrolling when clicking banner link */
html {
  scroll-behavior: smooth;
}

.color-hex {
  font-family: monospace;
  font-size: 10px;
  cursor: pointer;
  transition: opacity 0.2s;
}

.color-hsl-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  cursor: pointer;
  transition: opacity 0.2s;
  margin: 2px 0;
}

.color-hsl-label {
  font-size: 9px;
  font-weight: 700;
  margin-bottom: 1px;
  text-transform: uppercase;
}

.color-hsl-values {
  font-family: monospace;
  font-size: 10px;
}

.color-hex:hover, .color-hsl-values:hover {
  text-decoration: underline;
}

.contrast-ratio {
  font-size: 10px;
  font-family: monospace;
  margin-top: 2px;
}

.tailwind-scale {
  font-weight: bold;
  font-size: 14px;
}

.color-hex {
  font-family: monospace;
  cursor: pointer;
}

#toast {
  position: absolute; /* Changed from fixed */
  /* top, left, and transform are now set by JavaScript */
  background-color: rgba(0, 0, 0, 0.8);
  color: white;
  padding: 8px 16px;
  border-radius: 4px;
  font-size: 14px;
  opacity: 0;
  transition: opacity 0.3s, top 0.1s, left 0.1s; /* Added transition for top/left */
  z-index: 1000;
  pointer-events: none; /* Prevent toast from intercepting clicks */
}

#toast.show {
  opacity: 1;
}

footer {
  text-align: center;
  margin-top: 40px;
  font-size: 14px;
  padding-bottom: 20px;
}

footer .brand-icon-container {
  display: inline-flex;
  height: 20px;
  align-items: center;
  gap: 5px;
  margin: 10px 0 0;
}

footer .brand-icon-container img {
  height: 100%;
}


/* Toggle Switch Styles */
.toggle-container {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  margin: 25px 0; /* Increased margin for better spacing */
  text-shadow: 0px 2px 0px black;
}

.toggle-label {
  width: 100%;
  margin-bottom: 10px;
  text-align: center;
  font-weight: 400;
  font-size: clamp(0.85rem, 0.75rem + 0.5vw, 1rem);
}

@media (min-width: 768px) {
  .toggle-label {
    width: auto;
    margin: 0 10px 0 0;
  }
}

.visually-hidden-original-checkbox {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
  pointer-events: none;
}

.icon-container {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  background: var(--help-icon-bg-color);
  border-radius: 100%;
  color: var(--help-icon-color);
  transition: 0.3s ease;
}

.icon-container svg {
  stroke: rgba(0, 0, 0, 0.8);
}


.icon-container:hover,
.icon-container:active,
.icon-container:focus {
  background-color: var(--help-icon-hover-bg-color);
  transform: scale(1.2) translateY(-2px);
  box-shadow: inset 0 0 0 1px rgba(255,255,255,0.3);
}

.icon-container:hover .lucide-circle-help,
.icon-container:active .lucide-circle-help,
.icon-container:focus .lucide-circle-help {
  stroke: var(--help-icon-hover-color);
}

.default-badge {
  display: inline-block;
  background-color: #008000;
  color: white;
  font-size: 10px;
  padding: 2px 6px;
  border-radius: 3px;
  margin-left: 8px;
  vertical-align: middle;
}

.base-indicator {
  position: absolute;
  top: 5px;
  right: 5px;
  font-size: 12px;
  font-weight: bold;
}

.base-swatch {
  position: relative;
}

.base-swatch::after {
  content: '';
  position: absolute;
  top: 5px;
  right: 5px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background-color: white;
  box-shadow: 0 0 0 2px rgba(0, 0, 0, 0.8);
}

/* Modal Styles */
.modal-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(4px);
  z-index: 1040;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.2s ease-out, visibility 0s 0.2s linear;
}

.modal-backdrop.active {
  opacity: 1;
  visibility: visible;
  transition: opacity 0.2s ease-out;
}

.modal {
  position: fixed;
  top: 50%;
  left: 50%;
  padding: 50px;
  border-radius: 12px;
  box-shadow: 0 10px 50px black;
  z-index: 1050;
  opacity: 0;
  visibility: hidden;
  width: 90%;
  max-width: 700px;
  color: var(--modal-text-color);
  background-color: var(--modal-bg-color);
  transition: opacity 0.3s ease-out, transform 0.3s ease-out, visibility 0s 0.3s linear;
  transform: translate(-50%, -70%); /* Start slightly above for fade-in effect */
}

.modal.active {
  opacity: 1;
  transform: translate(-50%, -50%); /* End at center */
  visibility: visible;
  transition: opacity 0.3s ease-out, transform 0.3s ease-out;
}

.modal h2 {
  margin-top: 0;
  margin-bottom: 20px;
  font-size: clamp(1.2rem, 1rem + 1vw, 1.5rem);
}

.modal p {
  line-height: 1.5;
  font-size: clamp(0.9rem, 0.8rem + 0.5vw, 1.1rem);
}

.modal p:last-child {
  margin-bottom: 0;
}

.modal-close-btn {
  position: absolute;
  top: 15px;
  right: 15px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 5px;
  line-height: 1;
  color: var(--modal-close-btn-color);
  opacity: 0.7;
  transition: opacity 0.2s ease;
}

.modal-close-btn:hover {
  opacity: 1;
}

.modal-close-btn svg { /* Style the Lucide icon */
  width: 20px;
  height: 20px;
}

body.modal-open {
  overflow: hidden;
}

/* Styles for Default Ramp Mode Toggle Switch */
.switch-label {
  cursor: pointer;
  user-select: none;
  margin: 0 8px; /* Spacing around the switch */
  vertical-align: middle;
}

.switch {
  position: relative;
  display: inline-block;
  width: 50px;
  height: 26px;
  vertical-align: middle; /* Align with text labels */
}

.switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: var(--switch-bg-light-mode-color); /* Default off color */
  transition: .4s;
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.8);
}

input:focus + .slider {
  outline: white 1px solid;
}

.slider:before {
  position: absolute;
  content: "";
  height: 20px;
  width: 20px;
  left: 3px;
  bottom: 3px;
  background-color: var(--knob-light-mode-color); /* Knob color for light mode */
  transition: .4s;
}

.slider.round {
  border-radius: 26px; /* Height of the switch */
}

.slider.round:before {
  border-radius: 50%; /* Make knob round */
}

/* Dark Mode selected */
input:checked + .slider {
  background-color: var(--switch-bg-dark-mode-color); /* On color */
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.7);
}

input:checked + .slider:before {
  background-color: var(--knob-dark-mode-color); /* Knob color for dark mode */
  transform: translateX(24px); /* (Switch width - knob width - 2*knob_margin_left) */
}

/* End of Styles for Default Ramp Mode Toggle Switch */

#background-canvas {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  z-index: -1; /* Ensure it's behind other content */
  display: block;
}

/* Web3Forms Contact Form Styles */
#contact-form h3 {
  margin-bottom: 1rem;
  line-height: 1.2;
  text-wrap: pretty;
}

#contact-form input,
#contact-form textarea {
  width: 100%;
  padding: 10px;
  margin-bottom: 1rem;
  border: 1px solid var(--border-color, #dee2e6);
  border-radius: 4px;
  font-size: 1em;
  background-color: var(--input-bg-color, #FFFFFF);
  color: var(--input-text-color, #333333);
  font-family: 'Atkinson Hyperlegible Next', sans-serif;
}

#contact-form [id*="color"] {
  opacity: 0.5;
  cursor: not-allowed;
  pointer-events: none;
}

#contact-form textarea {
  min-height: 100px;
  resize: vertical;
}

#contact-form .button-report-color-form {
  background-color: rgba(0, 0, 0, 0.4);
  color: white;
  padding: 12px 20px;
  border: 1px solid rgba(255, 255, 255, 0.5);
  border-radius: 4px;
  font-size: 1em;
  font-weight: bold;
  cursor: pointer;
  transition: background-color 0.3s ease;
  display: block;
  width: 100%;
  margin-top: 1rem;
}

/*
  Dark red: #7E0F00;
  Light red: #c21c06;
*/

#contact-form .button-report-color-form:hover {
  background-color: rgba(0, 0, 0, 0.9);
  border-color: rgba(255, 255, 255, 0.7);
}

#contact-form .disclaimer {
  display: block;
  margin-top: 1em;
  text-align: center;
  font-size: 0.8rem;
  color: inherit;

}

/* Ensure honeypot is truly hidden */
#contact-form input[name="botcheck"] {
  display: none !important;
}

.side-by-side label {
  width: 100%;
}

@media (min-width: 750px) {
  .side-by-side {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
  }
}

  /* README Content Styles */
#readme-content {
  margin-top: 3rem;
  padding: 2rem;
  background-color: rgba(0, 0, 0, 0.7);
  border-radius: 8px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 1);
  backdrop-filter: blur(3px);
  color: #FFFFFF; /* Default text color for paragraphs */
}

#readme-content h2:first-child {
  margin-top: 0;
}

#readme-content h2,
#readme-content h3 {
  margin-top: 1.5em;
  margin-bottom: 0.75em;
  font-weight: 700;
  line-height: 1.2;
}

#readme-content h2 {
  font-size: clamp(1.5rem, 1.2rem + 1vw, 2rem);
  border-bottom: 1px solid rgba(255, 255, 255, 0.2);
  padding-bottom: 0.3em;
}

#readme-content h3 {
  font-size: clamp(1.2rem, 1rem + 0.5vw, 1.5rem);
}

#readme-content p,
#readme-content li {
  font-size: clamp(0.9rem, 0.85rem + 0.25vw, 1rem);
  margin-bottom: 1em;
  color: #FFFFFF; /* Ensure paragraphs and list items are white */
  text-shadow: 0px 1px 1px black;
}

#readme-content ul,
#readme-content ol {
  padding-left: 25px;
  margin-bottom: 1em;
}

#readme-content li {
  margin-bottom: 0.5em;
}

#readme-content strong {
  font-weight: 700;
  color: #E0E0E0;
}

#readme-content em {
  font-style: italic;
  color: #D0D0D0;
}

#readme-content pre {
  background-color: rgba(0, 0, 0, 0.5);
  padding: 15px;
  border-radius: 5px;
  overflow-x: auto;
  font-family: 'Courier New', Courier, monospace;
  font-size: 0.85em;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

#readme-content code {
  font-family: 'Courier New', Courier, monospace;
}

#readme-content pre code {
  background-color: transparent;
  padding: 0;
  border: none;
}

#readme-content a {
  color: #82caff;
  text-decoration: none;
  transition: color 0.2s ease;
}

#readme-content a:hover {
  color: #a9dfff;
  text-decoration: underline;
}

.dev-banner {
  background-color: #000000;
  color: #FFFFFF;
  text-align: center;
  padding: 5px 10px;
  font-size: 0.8em;
  position: fixed;
  top: 10px;
  left: 0;
  z-index: 9999;
}