/* Import Google Font - Poppins */
@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@400;500;600;700&display=swap');
*{
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: 'Poppins', sans-serif;
}
body{
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  min-height: 100vh;
  background: linear-gradient(270deg, #4D59FB, #6C63FF, #4D59FB);
  background-size: 600% 600%;
  animation: gradientBG 8s ease infinite;
}

@keyframes gradientBG {
  0% {background-position:0% 50%}
  50% {background-position:100% 50%}
  100% {background-position:0% 50%}
}
::selection{
  color: #fff;
  background: #4D59FB;
}
.wrapper{
  width: 420px;
  border-radius: 18px;
  background: #fff;
  padding: 32px 32px 60px;
  box-shadow: 7px 7px 20px rgba(0, 0, 0, 0.05);
  opacity: 1;
  transform: none;
  animation: none;
  position: relative;
  z-index: 2;
}

@keyframes fadeInUp {
  to {
    opacity: 1;
    transform: none;
  }
}
.wrapper header{
  font-size: 28px;
  font-weight: 500;
  text-align: center;
  color: #4D59FB;
}

  body.light {
    background: linear-gradient(270deg, #f5f7ff, #e3e6ff, #f5f7ff);
  }

  body.dark {
    background: linear-gradient(270deg, #23243a, #2c2d4b, #23243a);
  }
.theme-toggle {
  position: absolute;
  top: 18px;
  right: 28px;
  background: rgba(255,255,255,0.9);
  border: none;
  border-radius: 50%;
  width: 38px;
  height: 38px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 2px 8px #4D59FB22;
  transition: background 0.3s;
  z-index: 10;
}
.theme-toggle:hover {
  background: #4D59FB22;
}
.theme-toggle .material-icons {
  font-size: 22px;
  color: #4D59FB;
  transition: color 0.3s;
}
body.dark .theme-toggle .material-icons {
  color: #fff;
}

  body::before {
    content: "";
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    z-index: 0;
    pointer-events: none;
    background-image:
      linear-gradient(transparent 23px, #ffffff33 24px),
      linear-gradient(90deg, transparent 23px, #ffffff33 24px);
    background-size: 24px 24px;
    opacity: 0.5;
    animation: gridMove 6s linear infinite;
  }

  @keyframes gridMove {
    0% { background-position: 0 0, 0 0; }
    100% { background-position: 24px 24px, 24px 24px; }
}

.wrapper header{
  font-size: 28px;
  font-weight: 500;
  text-align: center;
  color: #4D59FB;
  text-shadow: 0 0 12px #6C63FF, 0 0 2px #fff;
  letter-spacing: 1px;
  animation: glow 2s ease-in-out infinite alternate;
}

@keyframes glow {
  from {
    text-shadow: 0 0 12px #6C63FF, 0 0 2px #fff;
  }
  to {
    text-shadow: 0 0 24px #4D59FB, 0 0 8px #fff;
  }
}
.wrapper .search{
  position: relative;
  margin: 35px 0 18px;
}
.search input{
  height: 53px;
  width: 100%;
  outline: none;
  font-size: 16px;
  border-radius: 5px;
  padding: 0 42px;
  border: 1px solid #999;
  transition: box-shadow 0.3s;
}
.search input:focus{
  padding: 0 41px;
  border: 2px solid #4D59FB;
  box-shadow: 0 0 8px #4D59FB44;
}
.search input::placeholder{
  color: #B8B8B8;
}
.search :where(i, span){
  position: absolute;
  top: 50%;
  color: #999;
  transform: translateY(-50%);
}
.search i{
  left: 18px;
  pointer-events: none;
  font-size: 16px;
  transition: color 0.3s, box-shadow 0.3s;
}
.search i.ripple {
  animation: ripple 0.5s linear;
}

@keyframes ripple {
  0% { box-shadow: 0 0 0 0 #4D59FB44; }
  70% { box-shadow: 0 0 0 12px #4D59FB22; }
  100% { box-shadow: 0 0 0 0 #4D59FB00; }
}
.search input:focus ~ i{
  color: #4D59FB;
}
.search span{
  right: 15px;
  cursor: pointer;
  font-size: 18px;
  display: none;
}
.search input:valid ~ span{
  display: block;
}
.wrapper .info-text{
  font-size: 13px;
  color: #9A9A9A;
  margin: -3px 0 -10px;
}
.wrapper.active .info-text{
  display: none;
}
.info-text span{
  font-weight: 500;
}
.wrapper ul{
  height: 0;
  opacity: 0;
  padding-right: 1px;
  overflow-y: hidden;
  transition: all 0.2s ease;
}
.wrapper.active ul{
  opacity: 1;
  height: 303px;
}
.wrapper ul li{
  display: flex;
  list-style: none;
  margin-bottom: 14px;
  align-items: center;
  padding-bottom: 17px;
  border-bottom: 1px solid #D9D9D9;
  justify-content: space-between;
  transition: background 0.2s;
}
.wrapper ul li:hover {
  background: #f5f7ff;
}
ul li:last-child{
  margin-bottom: 0;
  border-bottom: 0;
  padding-bottom: 0;
}
ul .word p{
  font-size: 22px;
  font-weight: 500;
}
ul .word span{
  font-size: 12px;
  color: #989898;
}
ul .word i{
  color: #999;
  font-size: 15px;
  cursor: pointer;
}
ul .content{
  max-height: 215px;
  overflow-y: auto;
}
ul .content::-webkit-scrollbar{
  width: 0px;
}
.content li .details{
  padding-left: 10px;
  border-radius: 4px 0 0 4px;
  border-left: 3px solid #4D59FB;
}
.content li p{
  font-size: 17px;
  font-weight: 500;
}
.content li span{
  font-size: 15px;
  color: #7E7E7E;
}
.content .synonyms .list{
  display: flex;
  flex-wrap: wrap;
}
.content .synonyms span{
  cursor: pointer;
  margin-right: 5px;
  text-decoration: underline;
}

/* Footer below the card */
footer{
  color: #ffffff;
  font-size: 14px;
}
footer a{
  color: #ffffff;
  text-decoration: none;
  border-bottom: 1px dotted #ffffffaa;
}
footer a:hover{
  text-decoration: underline;
}