/* 1. Register the progress variable */
@property --progress {
  syntax: "<number>";
  initial-value: 0;
  inherits: true;
}

/* 2. Menu Logic & Variables */
:root {
  --circle-size: 50px;
  --progress: 0;
  --event-color: blue;
  --main-color: #40E0D0;
  --main-color-light: #d8f0e2;
  --secondary-color: #ffada1;
  --secondary-color-light: #ffc7ba;
  --accent-color: #fedec7;
  --accent-color-light:#fef1de;
  --make-white:#fefdf8;
  --make-black:darkslategray;
  --bg-error: #f8d7da;
  --text-error: #721c24;
  --border-radius: 8px;
  --transition: all 0.3s ease;
}

:root:has(input:checked) {
  --progress: 1;
}

/* Fallback hook for browsers that do not support :has() */
:root.menu-open {
  --progress: 1;
}

/* 3. Global Container Overrides */
.lgbake-top, 
.lgbake-bar, 
.lgbake-right {
  overflow: visible !important;
}

/* 4. Positioning the List */
.lgbake-right ul {
  list-style: none;
  margin: 0;
  padding: 0;
  position: relative;
  width: var(--circle-size); /* Match button width for perfect centering */
  height: var(--circle-size);
  display: flex;
  align-items: center;
  justify-content: center;
  
}

/* The Main Toggle Button */
.unfold {
  position: relative;
  z-index: 110;
  width: var(--circle-size);
  height: var(--circle-size);
  background-color: var(--secondary-color);
  border-radius: 50%;
  display: grid;
  place-items: center;
  transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  box-shadow: 0 4px 10px rgba(0,0,0,0.15);
}

.unfold:has(input:checked) {
  transform: rotate(90deg);
}

/* Fallback hook for browsers that do not support :has() */
.unfold.menu-open {
  transform: rotate(90deg);
}

.unfold svg {
  width: 24px;
  fill: white;
}

.unfold input {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
  z-index: 111;
}

/* 5. The Animated Icons (Straight Down) */
.circle {
  position: absolute;
  /* Reset positioning to ensure they start exactly behind the button */
  top: 0;
  left: 0;
  right: 0;
  margin: auto;
  width: var(--circle-size);
  height: var(--circle-size);
  background-color: #ffffff;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 1.2rem;
  box-shadow: 0 4px 15px rgba(0,0,0,0.2);
  z-index: 105;
  transition: 
    --progress 600ms cubic-bezier(0.34, 1.56, 0.64, 1), 
    opacity 300ms, 
    background-color 0.2s;
  text-decoration: none;

  /* Vertical movement only */
  /* Starting offset (60px) + distance per item (55px) */
  --y-calc: calc(var(--progress) * (var(--i) * 55px + 60px));

  transform: translateY(var(--y-calc));
  opacity: var(--progress);
  pointer-events: none;
}

:root:has(input:checked) .circle {
  pointer-events: auto;
}

/* Fallback hook for browsers that do not support :has() */
:root.menu-open .circle {
  pointer-events: auto;
}

.circle:hover {
  background-color: var(--secondary-color-light);
  cursor: pointer;
}

/* 7. Tooltip Logic */
.circle {
  position: absolute;
  /* ... existing properties ... */
}

/* Create the Tooltip Box */
.circle::after {
  content: attr(data-tooltip); /* Pulls text from data-tooltip="Text" in HTML */
  position: absolute;
  
  /* Position to the left of the icon */
  right: 120%; 
  top: 50%;
  transform: translateY(-50%) translateX(10px);
  
  /* Styling */
  background-color: #333;
  color: #fff;
  padding: 6px 12px;
  border-radius: 6px;
  font-size: 0.85rem;
  font-family: sans-serif; /* Cleaner for small UI text */
  white-space: nowrap;
  letter-spacing: normal; /* Resets your H1-H6 letter spacing if inherited */
  box-shadow: 0 2px 8px rgba(0,0,0,0.2);
  
  /* Hidden state */
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, transform 0.3s ease;
  pointer-events: none;
  z-index: 200;
}

/* Tooltip Arrow (Optional but looks pro) */
.circle::before {
  content: "";
  position: absolute;
  right: 105%;
  top: 50%;
  transform: translateY(-50%);
  border-width: 5px;
  border-style: solid;
  border-color: transparent transparent transparent #333;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease;
  z-index: 200;
}

/* Show Tooltip on Hover */
.circle:hover::after,
.circle:hover::before {
  opacity: 1;
  visibility: visible;
  transform: translateY(-50%) translateX(0);
}