/* 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;
}

:root {
  --primary: #2596ff;
  --secondary: #6C757D;
  --light: #F8F8F8;
  --dark: #333;
  --bgsecondary: #fff;
  --bgprimary: #eeeeee;
}

.body{
  display: flex;
  background: var(--bgprimary);
}

.body1 {
  background: var(--bgsecondary);
  width: 100%;
  margin: 1rem;
  border-radius: .5rem;
}

.sidebar{
  background: var(--bgsecondary);
  padding: 1rem;
  height: 100vh;
  position: sticky;
  top: 0;
}

.sidebar ul{
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: .4rem;
  height: 100%;
}

.top, .bottom{
display: grid;
gap: .5rem;
}

.sidebar ul li{
  padding: 1rem;
  display: grid;
  place-items: center; 
  border-radius: .25rem;
  height: 4rem;
  aspect-ratio: 1;
  cursor: pointer;
}
.sidebar ul .active{
  background: var(--primary);
  z-index: 1;
  color: var(--txtnegative);
}

.inactive {
background: var(--bgprimary);
transition: background 0.3s;
}

.inactive:hover {
background: #ccc;
}

a li img {
  width: 100%;
}
.bottom img {
  width: 100%;
}

.goBack {
  position: absolute; /* Add this line */
  top: 1.2rem; /* Adjust the top distance as needed */
  left: 7rem; /* Adjust the left distance as needed */
  width: 3rem;
  text-decoration: none;
  background: none;
  border: none;
  border-radius: .15rem;
  margin: .8rem .7rem;
  cursor: pointer;
  transition: .6s;
}
.goBack:hover {
  width: 3rem;
  transition: .8s;
  margin: .8rem .7rem;
  padding-right: 1.5rem;
}

.goBack img {
  width: 2rem;
}
::selection{
  color: #fff;
  background: #3C87FF;
}
.wrapper{
  max-width: 405px;
  padding: 28px 0 30px;
  margin: 137px auto;
  background: #fff;
  border-radius: 7px;
  box-shadow: 0 10px 30px rgba(0,0,0,0.1);
}
.task-input{
  height: 52px;
  padding: 0 25px;
  position: relative;
}
.task-input img{
  top: 50%;
  position: absolute;
  transform: translate(17px, -50%);
}
.task-input input{
  height: 100%;
  width: 100%;
  outline: none;
  font-size: 18px;
  border-radius: 5px;
  padding: 0 20px 0 53px;
  border: 1px solid #999;
}
.task-input input:focus,
.task-input input.active{
  padding-left: 52px;
  border: 2px solid #3C87FF;
}
.task-input input::placeholder{
  color: #bfbfbf;
}
.controls, li{
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.controls{
  padding: 18px 25px;
  border-bottom: 1px solid #ccc;
}
.filters span{
  margin: 0 8px;
  font-size: 17px;
  color: #444444;
  cursor: pointer;
}
.filters span:first-child{
  margin-left: 0;
}
.filters span.active{
  color: #3C87FF;
}
.controls .clear-btn{
  border: none;
  opacity: 0.6;
  outline: none;
  color: #fff;
  cursor: pointer;
  font-size: 13px;
  padding: 7px 13px;
  border-radius: 4px;
  letter-spacing: 0.3px;
  pointer-events: none;
  transition: transform 0.25s ease;
  background: linear-gradient(135deg, #1798fb 0%, #2D5CFE 100%);
}
.clear-btn.active{
  opacity: 0.9;
  pointer-events: auto;
}
.clear-btn:active{
  transform: scale(0.93);
}
.task-box{
  margin-top: 20px;
  margin-right: 5px;
  padding: 0 20px 10px 25px;
}
.task-box.overflow{
  overflow-y: auto;
  max-height: 300px;
}
.task-box::-webkit-scrollbar{
  width: 5px;
}
.task-box::-webkit-scrollbar-track{
  background: #f1f1f1;
  border-radius: 25px;
}
.task-box::-webkit-scrollbar-thumb{
  background: #e6e6e6;
  border-radius: 25px;
}
.task-box .task{
  list-style: none;
  font-size: 17px;
  margin-bottom: 18px;
  padding-bottom: 16px;
  align-items: flex-start;
  border-bottom: 1px solid #ccc;
}
.task-box .task:last-child{
  margin-bottom: 0;
  border-bottom: 0;
  padding-bottom: 0;
}
.task-box .task label{
  display: flex;
  align-items: flex-start;
}
.task label input{
  margin-top: 7px;
  accent-color: #3C87FF;
}
.task label p{
  user-select: none;
  margin-left: 12px;
  word-wrap: break-word;
}
.task label p.checked{
  text-decoration: line-through;
}
.task-box .settings{
  position: relative;
}
.settings :where(i, li){
  cursor: pointer;
}
.settings .task-menu{
  z-index: 10;
  right: -5px;
  bottom: -65px;
  padding: 5px 0;
  background: #fff;
  position: absolute;
  border-radius: 4px;
  transform: scale(0);
  transform-origin: top right;
  box-shadow: 0 0 6px rgba(0,0,0,0.15);
  transition: transform 0.2s ease;
}
.task-box .task:last-child .task-menu{
  bottom: 0;
  transform-origin: bottom right;
}
.task-box .task:first-child .task-menu{
  bottom: -65px;
  transform-origin: top right;
}
.task-menu.show{
  transform: scale(1);
}
.task-menu li{
  height: 25px;
  font-size: 16px;
  margin-bottom: 2px;
  padding: 17px 15px;
  cursor: pointer;
  justify-content: flex-start;
}
.task-menu li:last-child{
  margin-bottom: 0;
}
.settings li:hover{
  background: #f5f5f5;
}
.settings li i{
  padding-right: 8px;
}

@media (max-width: 400px) {
  body{
    padding: 0 10px;
  }
  .wrapper {
    padding: 20px 0;
  }
  .filters span{
    margin: 0 5px;
  }
  .task-input{
    padding: 0 20px;
  }
  .controls{
    padding: 18px 20px;
  }
  .task-box{
    margin-top: 20px;
    margin-right: 5px;
    padding: 0 15px 10px 20px;
  }
  .task label input{
    margin-top: 4px;
  }
}

.calculator {
  max-width: 20rem;
  width: 100%;
  border-radius: 12px;
  padding: .5rem;
  background: #fff;
  box-shadow: rgba(0, 0, 0, 0.1) 0px 4px 50px 5px;
  position: absolute;
  transform: translate(-35%, -50%);
  top: 50%;
  left: 50%;
  z-index: 3;
  display: none;
}
.calculator #display {
  height: 80px;
  width: 100%;
  outline: none;
  border: none;
  text-align: right;
  margin-bottom: 10px;
  font-size: 25px;
  color: #000e1a;
}
.calculator .buttons {
  display: grid;
  grid-gap: .5rem;
  grid-template-columns: repeat(4, 1fr);
}
.calculator .buttons button {
  padding: .5rem;
  border-radius: 6px;
  border: none;
  font-size: 20px;
  cursor: pointer;
  background-color: #fff;
  box-shadow: rgba(0, 0, 0, 0.178) 0px 0px 2px .5px;
}
.calculator .buttons button:active {
  transform: scale(0.99);
}
.calculator .operator {
  color: #2f9fff;
}
#equal {
  background-color: #0099ff;
}
#equal:hover {
  background: #4583e7;
}
#btnRed {
  background: #ff0000;
  color: #fff;
}

#btnOrange {
  background: #ffb30e;
}

#overlay {
  position: fixed; /* Sit on top of the page content */
  display: none; /* Hidden by default */
  width: 100%; /* Full width (cover the whole page) */
  height: 100%; /* Full height (cover the whole page) */
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(0,0,0,0.5); /* Black background with opacity */
  z-index: 2; /* Specify a stack order in case you're using a different order for other elements */
  cursor: pointer; /* Add a pointer on hover */
}

/* preloader */
#loading-screen {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: #fff;
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 9999;
}

#loading-spinner {
  border: 4px solid rgba(255, 255, 255, 0.3);
  border-top: 4px solid #3498db;
  border-radius: 50%;
  width: 40px;
  height: 40px;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}