@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@100;200;300;400;500;600;700&display=swap');

:root{
  --base-clr: #F5F5F7;
  --text-clr: #1D1D1F;
  --line-clr: #5154db;

  --sidebar-open: 250px;
  --sidebar-closed: 60px;
}

/* ===================== */
/* RESET */
/* ===================== */

*{
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html{
  font-family: Poppins, sans-serif;
}

body{
  min-height: 100vh;
  background: var(--base-clr);
  color: var(--text-clr);

  display: grid;
  grid-template-columns: var(--sidebar-open) 1fr;

  transition: grid-template-columns 0.3s ease;
}

/* desktop collapsed layout */

body.sidebar-collapsed{
  grid-template-columns: var(--sidebar-closed) 1fr;
}
/* ===================== */
/* LAYOUT */
/* ===================== */

#sidebar{
  grid-column: 1;
}

main{
  grid-column: 2;
  padding: 20px;
  transition: margin-left 0.3s ease;
}

/* ===================== */
/* SIDEBAR */
/* ===================== */

#sidebar{
    height: 100vh;
    width: var(--sidebar-open);

  background: #1D1D1F;
  border-right: 1px solid rgba(81,84,219,0.3);

  position: sticky;
  top: 0;

  overflow-y: auto;
  overflow-x: hidden;

  transition:
    width 0.3s ease,
    transform 0.3s ease;

  padding: 10px;

  z-index: 2000;
}

/* collapsed desktop state */
#sidebar.close{
  width: var(--sidebar-closed);
}

/* ===================== */
/* LISTS */
/* ===================== */

#sidebar ul{
  list-style: none;
}

/* ===================== */
/* HEADER */
/* ===================== */

#sidebar .logo{
  color: white;
  font-weight: 600;
  padding: 10px;
  display: block;
}

/* toggle button */

#toggle-btn{
  margin-left: auto;

  background: none;
  border: none;

  cursor: pointer;

  padding: 10px;
}

#toggle-btn img{
  filter: invert(1);
  transition: transform 0.2s ease;
}

/* ===================== */
/* LINKS + BUTTONS */
/* ===================== */

#sidebar a,
#sidebar .dropdown-btn{
  display: flex;
  align-items: center;
  gap: 10px;

  width: 100%;

  padding: 12px;

  border-radius: 8px;

  color: white;
  text-decoration: none;

  background: none;
  border: none;

  cursor: pointer;

  transition: background 0.2s ease;
}

/* hover */

#sidebar a:hover,
#sidebar .dropdown-btn:hover{
  background: rgba(255,255,255,0.1);
}

/* active page */

#sidebar li.active > a{
  text-decoration: underline wavy white;
}

/* ===================== */
/* ICONS */
/* ===================== */

#sidebar img,
#sidebar svg{
  flex-shrink: 0;

  filter: invert(100%);

  transition:
    filter 0.3s ease,
    transform 0.3s ease;
}

/* dropdown arrow rotate */

.rotate img:last-child{
  transform: rotate(180deg);
}

/* ===================== */
/* SUBMENU */
/* ===================== */

.sub-menu{
  display: none;
  padding-left: 15px;
}

.sub-menu.show{
  display: block;
}

/* ===================== */
/* COLLAPSED STATE */
/* ===================== */

#sidebar.close span{
  display: none;
}

/* hide module complete banner when collapsed */

#sidebar.close .module-complete{
  display: none;
}

#sidebar.close a,
#sidebar.close .dropdown-btn{
  justify-content: center;
}

/* hide dropdown arrow when collapsed */

#sidebar.close .dropdown-btn img:last-child{
  display: none;
}

/* ===================== */
/* TOOLTIP */
/* ===================== */

#tooltip{
  position: fixed;

  background: #111;
  color: white;

  padding: 6px 10px;

  border-radius: 6px;

  font-size: 12px;

  pointer-events: none;

  opacity: 0;

  transition: opacity 0.15s ease;

  z-index: 9999;
}

/* ===================== */
/* PROGRESS */
/* ===================== */

.progress-container{
  padding: 10px 15px;
}

.progress-text{
  display: flex;
  justify-content: space-between;

  font-size: 0.9rem;

  margin-bottom: 5px;

  color: #ccc;
}

.progress-bar{
  width: 100%;
  height: 8px;

  background: #2c2c2c;

  border-radius: 5px;

  overflow: hidden;
}

.progress-fill{
  height: 100%;

  background: #00c6ff;

  transition: width 0.3s ease;
}

/* ===================== */
/* TICKS */
/* ===================== */

.tick{
  color: #00c853;
  margin-right: 6px;
  font-weight: bold;
}

.tick.empty{
  display: inline-block;
  width: 14px;
}

/* ===================== */
/* MODULE COMPLETE */
/* ===================== */

.module-complete{
  background: linear-gradient(135deg, #00c6ff, #0072ff);

  color: white;

  padding: 10px;
  margin: 10px;

  border-radius: 8px;

  text-align: center;
  font-weight: bold;
}


/* ===================== */
/* HIDE MOBILE UI ON DESKTOP */
/* ===================== */

.mobile-topbar{
  display: none;
}

.sidebar-overlay{
  display: none;
}


/* ===================== */
/* MOBILE RESPONSIVE */
/* ===================== */

@media (max-width: 800px){

  body{
    display: block;
  }

  main{
    width: 100%;
    padding: 80px 16px 20px;
  }

  /* enable mobile ui */

  .mobile-topbar{
    display: flex;
  }

  .sidebar-overlay{
    display: block;
  }

  /* ===================== */
  /* SIDEBAR DRAWER */
  /* ===================== */

  #sidebar{
      position: fixed;
    
      top: 60px;
      left: 0;
    
      height: calc(100vh - 60px);

    width: 280px;
    height: 100vh;

    transform: translateX(0);

    overflow-y: auto;

    z-index: 2000;
  }

  /* hidden offscreen */

  #sidebar.close{
    width: 280px;
    transform: translateX(-100%);
  }

  /* ===================== */
  /* MOBILE TOPBAR */
  /* ===================== */

  .mobile-topbar{
    position: fixed;

    top: 0;
    left: 0;

    width: 100%;
    height: 60px;

    background: #1D1D1F;

    align-items: center;

    padding: 0 15px;

    z-index: 2100;

    border-bottom: 1px solid rgba(81,84,219,0.3);
  }

  .mobile-menu-btn{
    background: none;
    border: none;

    cursor: pointer;
  }

  .mobile-menu-btn img{
    width: 28px;
    filter: invert(1);
  }

  .mobile-title{
    color: white;

    margin-left: 15px;

    font-weight: 600;
    font-size: 1rem;
  }

  /* ===================== */
  /* OVERLAY */
  /* ===================== */

  .sidebar-overlay{
    position: fixed;
    inset: 0;

    background: rgba(0,0,0,0.4);

    opacity: 0;
    visibility: hidden;

    transition: 0.3s ease;

    z-index: 1500;
  }

  .sidebar-overlay.show{
    opacity: 1;
    visibility: visible;
  }

  /* ===================== */
  /* TOUCH FRIENDLY */
  /* ===================== */

  #sidebar a,
  #sidebar .dropdown-btn{
    min-height: 52px;
    font-size: 1rem;
  }

  .sub-menu{
    padding-left: 10px;
  }

  /* hide sidebar logo on mobile */

#sidebar .logo{
  display: none;
}

  /* hide desktop toggle */

  #toggle-btn{
    display: none;
  }

  /* keep text visible on mobile */

  #sidebar.close span{
    display: inline;
  }

  #sidebar.close .dropdown-btn img:last-child{
    display: block;
  }
}