:root{
  /* balloon sizing (W x H = ratio ~ 1.36) */
  --balloon-w: 110px;
  --balloon-ratio: 1.36;      /* 100x136 baseline */
  --string-offset: 54px;      /* how far down the string starts from top of swatch */
  --palette-gap-x: 18px;
  --palette-gap-y: 12px;
}

body {
  margin: 0;
  box-sizing: border-box;
  /* font-family: sans-serif; */
      font-family: "Autour One", serif; 
      background-color: #c2c2c2;
      background-image: url("assets/pictures/asfalt-dark.png");
      /* This is mostly intended for prototyping; please download the pattern and re-host for production environments. Thank you! */
}
#main-header {
  text-align: center;
  padding: 20px 10px;
  background: #ffffffdd;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
  border-radius: 12px;
  margin-bottom: 20px;
}

#main-header h1 {
  font-size: 2rem;
  margin-bottom: 5px;
}

#main-header p {
  font-size: 1rem;
  color: #666;
}

#selected-palette {
  position: sticky !important;
  top: 60px; /* This tells it where to stick */
  z-index: 10;    /* This ensures it stays on top of other content */
  max-width: 85%;
  margin: auto;
  padding: 10px;
  background-color: #e8e8e8;
  background-image: url("https://www.transparenttextures.com/patterns/asfalt-light.png");
  border: 2px solid #ccc;
  border-radius: 10px;
 
  /* Flexbox settings */
  display: flex;
  flex-direction: column;
  gap: 15px;
 
  /* Sizing and Scrolling Fix */
  max-height: 30vh;
  min-height: 0;
}

/* Strong shadow when stuck */
#selected-palette.stuck {
  box-shadow: 16px 16px 15px rgba(0, 0, 0, 0.25);
  border: 1px solid rgb(0, 0, 0);
      border-radius: 7px;
}



#palette-colors {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  /* padding: 10px; */
 
  /* ✨ Scrolling Fix */
  overflow-y: auto; /* Change from 'visible' to 'auto' for vertical scroll */
  flex-grow: 1;     /* Allow this container to fill available space */
}


#clear-palette {
  margin-top: 20px;
  padding: 8px 12px;
  font-size: 0.9rem;
  background: #8ae7db;
  border: 1px solid #ccc;
  border-radius: 15px;
  cursor: pointer;
  margin: auto;

}

#color-families {
  display: flex;
  flex-direction: column;
  gap: 15px;
  font-family: "Autour One", serif;
 
}

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
footer {
  text-align: center;
  font-size: 0.9rem;
  color: #777;
  padding: 20px;
}

@media (max-width: 480px) {
  .color-name {
    font-size: 0.7rem;
  }

  #main-header h1 {
    font-size: 1.5rem;
  }
}
.color-family {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding-bottom: 20px;
  border-bottom: 1px solid #ccc;
  animation: fadeInUp 0.5s ease;
  font-family: "Autour One", serif;

}
.swatch-container {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px 20px; /* add horizontal AND vertical gaps */
}

.color-family h3 {
  text-align: center;
  margin: 10px 0 5px;
  font-size: 1rem;
  font-weight: bold;
}


.swatch-wrapper {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-evenly;
  /* width: 60px; */
  /* margin: 0 5px; */
  /* padding: 10px; */
  max-width: min-content;
  position: relative;
  overflow-wrap: break-word;
    transition: filter 0.3s ease;
  filter: drop-shadow(0 3px 4px rgba(0, 0, 0, 0.25));

}

.palette-header-row {
  display: flex;
  justify-content: space-between; /* Pushes title and buttons apart */
  align-items: center;           /* Vertically centers them */
  width: 100%;                   /* Makes the row fill the container */
  /* padding: 0 10px;               Adds some horizontal spacing */
  margin: auto;
}

/* Remove the default margins from your title */
#selected-palette h2 {
  margin: 0;
  font-size: 1.2rem;
}


.metallic-element[data-color="#FFD700"] {
  background: linear-gradient(to bottom, #B88606, #79550E);
  box-shadow:
    inset 0 0 0 0 rgba(255, 255, 255, 0.3),
    inset 0 0 0 1px rgba(0, 0, 0, 0.3),
    inset 0 0 10px rgba(0, 0, 0, 0.2);
}


  .color-swatch {
  width: 100px;
  height: 136px;
  position: relative;
  background: #ccc; /* fallback */
  transition: transform 0.3s ease;
  z-index: 1;
  background: radial-gradient(circle at 30% 30%, #fff5, transparent 60%), #ddd;

  -webkit-mask-image: url('images/balloon-mask.svg');
  -webkit-mask-size: contain;
  -webkit-mask-repeat: no-repeat;
  -webkit-mask-position: center;

  mask-image: url('images/balloon-mask.svg');
  mask-size: contain;
  mask-repeat: no-repeat;
  mask-position: center;
font-family: "Autour One", serif;

}

.color-shine.has-halo {
  filter: drop-shadow(0px 1px 2px rgba(0, 0, 0, 0.4));
}

.color-swatch:hover,
.color-swatch:active {
  transform: scale(1.2);
}


/* Adjust shine for chosen state if necessary */

.color-background {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  border: 2px solid rgba(0, 0, 0, 0.1); /* Light gray border */
  box-shadow: 1 1 1;
}
.color-shine {
  position: absolute;
  top: 45%;
  left: 45%;
  width: 70px;
  opacity: 0.6;
  z-index: 100; /* make this high enough */
  pointer-events: none;
  transform: translate(-50%, -50%);
  height: auto;
}

.color-name {
  font-size: 0.85rem;
  text-align: center;
  margin-top: 5px;
  word-break: keep-all;     /* Prevent breaking long words */
  /* white-space: nowrap;      Keep names on a single line */
  /* overflow: hidden;         /*Hide overflow text if necessary */
  text-overflow: ellipsis;  /* Add ... when text is too long */
  max-width: 100%;
  /* background-color: #e8e8e8; */
  z-index: 1;
}


@media (max-width: 600px) {

  .swatch-wrapper {
    width: 60px;
  }

  .color-name {
    font-size: 0.65rem;
    max-width: 50px;
    word-wrap: break-word;
  }

  #selected-palette h2 {
    font-size: 1.1rem;
  }
}

.color-name {
  transition: all 0.3s ease;
}

.color-name.highlighted-name {
  text-decoration:underline;
  font-weight: bold;
  color: #111;
}

@keyframes pop {
  0% { transform: scale(1); }
  50% { transform: scale(1.2); }
  100% { transform: scale(1); }
}

.color-background.pop {
  animation: pop 0.25s ease;
}

.chosen{
  z-index: 4;
}

.color-swatch.chosen {
  outline: 3px solid #333;
  outline-offset: 1px;
  width: 90px;    /* Keep these specific dimensions for chosen state */
  height: 126px; /* Keep these specific dimensions for chosen state */
  z-index: 10;
  /* IMPORTANT: Re-apply the complex shadow from the base .color-swatch,
     and add the extra glow/shadow you want for the chosen state.
     This ensures depth is maintained. */
  box-shadow:
    inset 2px 2px 6px rgba(255, 255, 255, 0.6), /* Retain inner highlight for depth */
    0 8px 16px rgba(0, 0, 0, 0.3),            /* Slightly larger/darker outer shadow for more pop */
    0 0 15px rgba(0, 0, 0, 0.4);              /* More pronounced glow for chosen state */
}

/* Shared metallic style */
.metallic {
  position: relative;
  border: 1px solid rgba(255, 255, 255, 0.3);
  /* box-shadow: inset 1px 1px 4px rgba(255, 255, 255, 0.6),
               0 2px 4px rgba(0, 0, 0, 0.3); */
  overflow: hidden;
}

/* Highlight overlay */
.metallic1::after {
  content: '';
  position: absolute;
  top: 15%;
  left: 15%;
  width: 70%;
  height: 70%;
  background: radial-gradient(circle at top left, rgba(255,255,255,0.3), transparent 70%);
  transform: rotate(-20deg);
  pointer-events: none;
  border-radius: 50%;
}

/* Specific chrome variants */
.chrome-gold {
  background: linear-gradient(145deg, #fefcea, #b69978, #a18b67, #806748);
}

.chrome-silver {
  background: linear-gradient(145deg, #e0e0e0, #a9a9a9, #808080, #e0e0e0);
}

.chrome-rosegold {
  background: linear-gradient(145deg, #fbe3dc, #e6b7a9, #d19387, #fbe3dc);
}

.chrome-champagne {
  background: linear-gradient(145deg, #fff2cc, #f2e6b6, #d9c08e, #fff2cc);
}

.chrome-blue {
  background: linear-gradient(145deg, #d0f0ff, #4d7995, #2d576f, #d0f0ff);
}

.chrome-purple {
  background: linear-gradient(145deg, #e0ccff, #b08be1, #915bc4, #e0ccff);
}

.chrome-green {
  background: linear-gradient(145deg, #e2ffe2, #457066, #5c877d, #e2ffe2);
}


@keyframes balloonFloat {
  0%, 100% { transform: translateY(0) rotate(-4deg); }
  50% { transform: translateY(-25px) rotate(4deg); }
}

.balloon-float {
  animation-name: balloonFloat;
  animation-timing-function: 4s ease-in-out;
  animation-iteration-count: infinite;
  transform-origin: bottom center;
  position: relative;
}

.color-background {
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
}
/* --- SVG Balloon String --- */
.balloon-string-svg {
  position: absolute;
  top: 82px; /* match .color-swatch height */
  left: 45%;
  transform: translateX(-50%);
  width: 20px;
  height: 40px;
  z-index: -4;
  pointer-events: none;
  overflow: visible;
  transform-origin: top center;
  animation: svgWiggle 2s ease-in-out infinite;
}


.balloon-float-group {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  animation-name: balloonFloat;
  animation-duration: 4s;
  animation-timing-function: ease-in-out;
  animation-iteration-count: infinite;
  transform-origin: bottom center;
}

.wiggle-path {
  stroke: #727171;
  stroke-width: 2;
  fill: none;
  stroke-linecap: round;
  stroke-dasharray: 1, 2;
}

@keyframes svgWiggle {
  0%, 100% {
    transform: translateX(-50%) rotate(0deg);
  }
  25% {
    transform: translateX(-50%) rotate(2deg);
  }
  50% {
    transform: translateX(-50%) rotate(-2.5deg);
  }
  75% {
    transform: translateX(-50%) rotate(1.5deg);
  }
}

#palette-controls {
  position: static;
  top: 10px;
  right: 10px;
  display: flex;
  align-items: center;
  gap: 10px;
  z-index: 200;
}
/* Toggle Switch Styling */
.switch {
  position: relative;
  display: inline-block;
  width: 40px;
  height: 20px;
}
.switch input {
  opacity: 0;
  width: 0;
  height: 0;
}
.slider {
  position: absolute;
  cursor: pointer;
  top: 0; left: 0;
  right: 0; bottom: 0;
  background-color: #ccc;
  transition: 0.4s;
  border-radius: 20px;
}
.slider:before {
  position: absolute;
  content: "";
  height: 14px;
  width: 14px;
  left: 3px;
  bottom: 3px;
  background-color: white;
  transition: 0.4s;
  border-radius: 50%;
}
input:checked + .slider {
  background-color: #4caf50;
}
input:checked + .slider:before {
  transform: translateX(20px);
}

/* --- NEW STYLES START HERE --- */
/* Styling for the new icon buttons in the palette header */
.palette-control-btn {
  font-size: 1rem;      /* Set a consistent icon size */
  padding: 0;           /* Remove padding to control size with width/height */
  border: 1px solid #ddd;
  background: #f0f0f0;
  border-radius: 6px;
  cursor: pointer;
  width: 32px;          /* Give the button a square shape */
  height: 32px;
  display: inline-flex; /* Use flexbox to center the icon */
  justify-content: center;
  align-items: center;
  transition: background-color 0.2s ease;
}

.palette-control-btn:hover {
  background-color: #e0e0e0;
}
/* --- NEW STYLES END HERE --- */

.palette-modal-backdrop {
  position: fixed;
  top: 0; left: 0;
  width: 100vw; height: 100vh;
  background: rgba(0, 0, 0, 0.4);
  display: none; /* Default is hidden */
  justify-content: center;
  align-items: center;
  z-index: 1000;
}

.palette-modal-backdrop .palette-modal {
  background: white;
  padding: 20px;
  border-radius: 12px;
  max-width: 90%;
  width: 400px;
  box-shadow: 0 5px 20px rgba(0, 0, 0, 0.3);
  text-align: center;
  display: block;
}

/* Styling for the share link input field inside the modal */
#share-link-input {
  display: block;
  width: 90%;
  padding: 8px;
  margin: 15px auto 0;
  border: 1px solid #ccc;
  border-radius: 4px;
  font-size: 0.9rem;
  text-align: center;
}

/* Styling for the copy button inside the modal */
#copy-link-button {
  margin-top: 15px;
  padding: 10px 20px;
  font-size: 1rem;
  font-weight: bold;
  background-color: #4CAF50; /* Green */
  color: white;
  border: none;
  border-radius: 5px;
  cursor: pointer;
  transition: background-color 0.3s ease;
}

#copy-link-button:hover {
  background-color: #45a049;
}

/* --- Zoom Overlay Feature --- */

#zoom-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background-color: rgba(0, 0, 0, 0.75); /* Dark, semi-transparent background */
  z-index: 1001; /* Ensure it's on top of everything */
 
  /* Use flexbox to center the content */
  display: flex;
  justify-content: center;
  align-items: center;
 
  /* Start hidden and transition opacity */
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
 
  cursor: zoom-out; /* Hint to the user how to close it */
}

/* The class we'll toggle with JavaScript to show the overlay */
#zoom-overlay.is-active {
  opacity: 1;
  visibility: visible;
}

/* The container for the zoomed-in palette balloons */
#zoomed-palette-content {
  width: 90vw;
  height: 80vh;
  padding: 20px;
 
  /* Looks like the original palette */
  background-color: #e8e8e8;
  background-image: url("https://www.transparenttextures.com/patterns/asfalt-light.png");
  border-radius: 15px;
 
  /* Allow scrolling if there are many balloons */
  overflow-y: auto;
 
  /* Arrange the cloned balloons */
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 20px;
 
  cursor: default; /* Use a normal cursor for the content itself */
}

/* Make the balloons and their names larger in the zoom view */
#zoomed-palette-content .swatch-wrapper {
  transform: scale(1.1);
}

/* --- Responsive Sizing for Selected Palette Balloons --- */

/* Add some spacing between the balloons in the top palette */
#palette-colors {
  gap: 15px;
}

/* Apply these styles ONLY on screens 768px or smaller (tablets and phones) */
@media (max-width: 768px) {

  /* Reduce the size of the balloon itself */
  #selected-palette .color-swatch {
    width: 70px;
    height: 95px;
  }

  /* Reposition the balloon string to match the new, smaller height */
  #selected-palette .balloon-string-svg {
    top: 60px; /* Adjust this value if the string looks detached */
  }

  /* Make the color name text smaller to fit */
  #selected-palette .color-name {
    font-size: 0.7rem;
  }

  /* Reduce the gap between balloons on mobile for a tighter fit */
  #palette-colors {
    gap: 10px;
  }
}

/* --- Responsive Sizing for Selected Palette Balloons --- */

/* Add some spacing between the balloons in the top palette */
#palette-colors {
  gap: 15px;
}

/* Apply these styles ONLY on screens 768px or smaller (tablets and phones) */
@media (max-width: 768px) {

  /* Reduce the size of the balloon itself */
  #selected-palette .color-swatch {
    width: 50px;
    height: 75px;
  }

  /* Reposition the balloon string to match the new, smaller height */
  #selected-palette .balloon-string-svg {
    top: 40px; /* Adjust this value if the string looks detached */
    height: 25px;
  }

  /* Make the color name text smaller to fit */
  #selected-palette .color-name {
    font-size: 0.7rem;
  }

  /* Reduce the gap between balloons on mobile for a tighter fit */
  #palette-colors {
    gap: 6px;
  }
}