:root {
  --input-w: min(400px, 90vw);
  --input-h: 56px;
  --radius: 10px;

  /* Layer boxes slightly larger than input to show borders */
  --frame-w: calc(var(--input-w) + 6px);
  --frame-h: calc(var(--input-h) + 6px);
  --frame2-w: calc(var(--input-w) + 10px);
  --frame2-h: calc(var(--input-h) + 10px);

  --bg: #121212;
}

/* Utility: for accessible label */
.visually-hidden {
  position: absolute !important;
  height: 1px; width: 1px;
  overflow: hidden;
  clip: rect(1px,1px,1px,1px);
  white-space: nowrap;
}

* { box-sizing: border-box; }

html, body {
  height: 100%;
  margin: 0;
  background: #0b0b0b;
  color: #fff;
  font-family: system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, sans-serif;
}

.grid {
  height: 100vh;
  width: 100vw;
  background-color: var(--bg);
  background-image: radial-gradient(#151515 1px, transparent 1px);
  background-size: 1rem 1rem;
  background-position: center center;
  position: fixed;
  inset: 0;
  z-index: -2;
  filter: blur(1px);
}

/* Root wrapper centered */
#poda {
  display: flex;
  align-items: center;
  justify-content: center;
  position: absolute;
  top: 45%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 100%;
  padding: 0 20px;
}

/* Positioning reference for layers */
#main {
  position: relative;
  width: var(--input-w);
  height: var(--input-h);
}

/* Input */
.input {
  background-color: #010201;
  border: none;
  width: var(--input-w);
  height: var(--input-h);
  border-radius: var(--radius);
  color: white;
  padding-inline: 59px 52px;
  font-size: 18px;
  position: relative;
  z-index: 3;
}

.input::placeholder {
  color: #c0b9c0;
}
.input:focus {
  outline: 2px solid #2b2752;
  outline-offset: 0;
}

/* Masks */
#input-mask {
  pointer-events: none;
  width: 100px;
  height: 20px;
  position: absolute;
  background: linear-gradient(90deg, transparent, black);
  top: 18px;
  left: 70px;
  z-index: 4;
}
#main:focus-within > #input-mask {
  display: none;
}

#pink-mask {
  pointer-events: none;
  width: 30px;
  height: 20px;
  position: absolute;
  background: #cf30aa;
  top: 10px;
  left: 5px;
  filter: blur(20px);
  opacity: 0.8;
  transition: opacity 0.4s ease;
  z-index: 2;
}
#main:hover > #pink-mask {
  opacity: 0;
}

/* Iconss */
#search-icon {
  position: absolute;
  left: 20px;
  top: 15px;
  z-index: 4;
}

#filter-icon {
  position: absolute;
  top: 8px;
  right: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 4;
  height: 40px;
  width: 38px;

  isolation: isolate;
  overflow: hidden;
  border-radius: 10px;
  background: linear-gradient(180deg, #161329, black, #1d1b4b);
  border: 1px solid transparent;
  cursor: pointer;
}
#filter-icon:focus-visible {
  outline: 2px solid #6356d8;
  outline-offset: 2px;
}

/* Filter border ring */
.filterBorder {
  height: 42px;
  width: 40px;
  position: absolute;
  top: 7px;
  right: 7px;
  border-radius: 10px;
  overflow: hidden;
  z-index: 3;
}
.filterBorder::before {
  content: "";
  text-align: center;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) rotate(90deg);
  position: absolute;
  width: 600px;
  height: 600px;
  background-repeat: no-repeat;
  background-position: 0 0;
  filter: brightness(1.35);
  background-image: conic-gradient(
    rgba(0, 0, 0, 0),
    #3d3a4f,
    rgba(0, 0, 0, 0) 50%,
    rgba(0, 0, 0, 0) 50%,
    #3d3a4f,
    rgba(0, 0, 0, 0) 100%
  );
  animation: rotate 4s linear infinite;
}

/* Layered gradient frames (behind input) */
.white,
.border,
.darkBorderBg,
.glow {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  overflow: hidden;
  border-radius: 12px;
  pointer-events: none;
  z-index: 1;
}

.white,
.border,
.darkBorderBg {
  width: var(--frame-w);
  height: var(--frame-h);
  filter: blur(3px);
  max-width: 314px;
  max-height: 70px;
}

.white {
  filter: blur(2px);
  max-width: 307px;
  max-height: 63px;
}
.white::before {
  content: "";
  position: absolute;
  inset: 0;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) rotate(83deg);
  width: 600px;
  height: 600px;
  background-repeat: no-repeat;
  background-position: 0 0;
  filter: brightness(1.4);
  background-image: conic-gradient(
    rgba(0, 0, 0, 0) 0%,
    #a099d8,
    rgba(0, 0, 0, 0) 8%,
    rgba(0, 0, 0, 0) 50%,
    #dfa2da,
    rgba(0, 0, 0, 0) 58%
  );
  transition: transform 2s ease;
}

.border {
  filter: blur(0.5px);
  max-width: 303px;
  max-height: 59px;
}
.border::before {
  content: "";
  position: absolute;
  inset: 0;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) rotate(70deg);
  width: 600px;
  height: 600px;
  filter: brightness(1.3);
  background-repeat: no-repeat;
  background-position: 0 0;
  background-image: conic-gradient(
    #1c191c,
    #402fb5 5%,
    #1c191c 14%,
    #1c191c 50%,
    #cf30aa 60%,
    #1c191c 64%
  );
  transition: transform 2s ease;
}

.darkBorderBg {
  max-width: 312px;
  max-height: 65px;
}
.darkBorderBg::before {
  content: "";
  position: absolute;
  inset: 0;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) rotate(82deg);
  width: 600px;
  height: 600px;
  background-repeat: no-repeat;
  background-position: 0 0;
  background-image: conic-gradient(
    rgba(0, 0, 0, 0),
    #18116a,
    rgba(0, 0, 0, 0) 10%,
    rgba(0, 0, 0, 0) 50%,
    #6e1b60,
    rgba(0, 0, 0, 0) 60%
  );
  transition: transform 2s ease;
}

/* Glow layer larger than frames */
.glow {
  width: var(--frame2-w);
  height: var(--frame2-h);
  filter: blur(30px);
  opacity: 0.4;
  max-width: 354px;
  max-height: 130px;
}
.glow::before {
  content: "";
  position: absolute;
  inset: 0;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) rotate(60deg);
  width: 999px;
  height: 999px;
  background-repeat: no-repeat;
  background-position: 0 0;
  background-image: conic-gradient(
    #000,
    #402fb5 5%,
    #000 38%,
    #000 50%,
    #cf30aa 60%,
    #000 87%
  );
  transition: transform 2s ease;
}

/* Interactions: hover */
#poda:hover > .darkBorderBg::before {
  transform: translate(-50%, -50%) rotate(262deg);
}
#poda:hover > .glow::before {
  transform: translate(-50%, -50%) rotate(240deg);
}
#poda:hover > .white::before {
  transform: translate(-50%, -50%) rotate(263deg);
}
#poda:hover > .border::before {
  transform: translate(-50%, -50%) rotate(250deg);
}

/* Interactions: focus within (keyboard focus on input) */
#poda:focus-within > .darkBorderBg::before {
  transform: translate(-50%, -50%) rotate(442deg);
  transition: transform 4s ease;
}
#poda:focus-within > .glow::before {
  transform: translate(-50%, -50%) rotate(420deg);
  transition: transform 4s ease;
}
#poda:focus-within > .white::before {
  transform: translate(-50%, -50%) rotate(443deg);
  transition: transform 4s ease;
}
#poda:focus-within > .border::before {
  transform: translate(-50%, -50%) rotate(430deg);
  transition: transform 4s ease;
}

/* Responsive Design */
@media (max-width: 768px) {
  :root {
    --input-w: min(350px, 85vw);
    --input-h: 52px;
  }
  
  #poda {
    top: 40%;
    padding: 0 15px;
  }
  
  .input {
    font-size: 16px;
    padding-inline: 50px 45px;
  }
  
  #filter-icon {
    height: 36px;
    width: 34px;
  }
  
  .filterBorder {
    height: 38px;
    width: 36px;
  }
}

@media (max-width: 480px) {
  :root {
    --input-w: min(320px, 90vw);
    --input-h: 48px;
  }
  
  #poda {
    top: 35%;
    padding: 0 10px;
  }
  
  .input {
    font-size: 14px;
    padding-inline: 45px 40px;
  }
  
  .input::placeholder {
    font-size: 13px;
  }
  
  #search-icon {
    left: 15px;
    top: 13px;
  }
  
  #search-icon svg {
    width: 20px;
    height: 20px;
  }
  
  #filter-icon {
    height: 32px;
    width: 30px;
    top: 8px;
    right: 8px;
  }
  
  #filter-icon svg {
    width: 22px;
    height: 22px;
  }
  
  .filterBorder {
    height: 34px;
    width: 32px;
    top: 7px;
    right: 7px;
  }
}

@media (max-width: 320px) {
  :root {
    --input-w: 95vw;
    --input-h: 44px;
  }
  
  #poda {
    top: 32%;
    padding: 0 5px;
  }
  
  .input {
    font-size: 13px;
    padding-inline: 40px 35px;
  }
  
  #search-icon {
    left: 12px;
    top: 12px;
  }
  
  #search-icon svg {
    width: 18px;
    height: 18px;
  }
  
  #filter-icon {
    height: 28px;
    width: 26px;
  }
  
  #filter-icon svg {
    width: 20px;
    height: 20px;
  }
  
  .filterBorder {
    height: 30px;
    width: 28px;
  }
}

/* Animations */
@keyframes rotate {
  100% {
    transform: translate(-50%, -50%) rotate(450deg);
  }
}
