@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@400;600;700&display=swap');

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

/* Sidebar Container */
.sidebar-container {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 1000;
}

/* Sidebar Style */
.sidebar {
  position: fixed;
  top: 0;
  left: -250px;  
  width: 250px;
  height: 100vh;
  background-color: white;
  box-shadow: 2px 0 12px rgba(0, 0, 0, 0.15);
  transition: left 0.3s ease;
  padding-bottom: 20px;
  display: flex;
  flex-direction: column;
}

.sidebar.active {
  left: 0;
}

/* Sidebar Header */
.sidebar-header {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  border-bottom: 1px solid #eee;
  position: relative;
}

/* Logo Style */
.sidebar-logo {
  display: block;
  max-width: 150px;
  margin: 0 auto;
  transition: opacity 0.3s ease;
}

/* Sidebar Search Bar */
.sidebar-search {
  padding: 10px 20px;
  border-bottom: 1px solid #eee;
}

.input-with-filter {
  position: relative;
}

/* Sidebar Search Input */
.input-with-filter input {
  width: 100%;
  padding: 8px 40px 8px 8px; 
  border: 1px solid #ccc;
  border-radius: 4px;
}

/* Sidebar Filter Button */
.sidebar-filter-btn {
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  background: transparent;
  border: none;
  font-size: 16px;
  cursor: pointer;
  z-index: 10;
  color: #006AFF;
}

.sidebar-filter-btn:focus {
  outline: none;
}

/* Navigation Style */
.sidebar-nav {
  margin-top: 20px;
  flex: 1;
  overflow-y: auto;
  scrollbar-width: none; 
}

.sidebar-nav::-webkit-scrollbar {
  display: none;
}

.sidebar-nav ul {
  list-style: none;
}

/* Menu Item Style */
.menu-item a {
  display: block;
  padding: 15px 20px;
  color: #333;
  text-decoration: none;
  transition: background 0.3s, color 0.3s;
}

.menu-item a:hover {
  background: #006AFF;
  color: #fff;
}

/* Sidebar menu item active state */
.menu-item a.active {
  background: #006AFF;
  color: #fff;
}

/* Sidebar btn */
.open-sidebar-btn {
  position: fixed;
  top: 20px;
  left: 20px;
  background-color: #006AFF;
  border: none;
  color: #fff;
  border-radius: 50%;
  width: 35px;
  height: 35px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  cursor: pointer;
  z-index: 1100;
}

.open-sidebar-btn:hover {
  background-color: #006AFF;
}

/* close sidebar icon */
.hamburger-icon {
  position: absolute;
  top: 5px;
  right: 5px;
  background: transparent;
  border: none;
  cursor: pointer;
  width: 22px; /* size */
  height: 16px; /* size */
  display: flex;
  flex-direction: column;
  align-items: flex-end; /* slashes against the right */
  justify-content: flex-start;
  gap: 2px; /* spacing between bars decreased */
  padding: 0;
}

.hamburger-icon .bar {
  display: block;
  height: 2px; /* height */
  background-color: #006AFF;
  border-radius: 2px;
  transition: all 0.3s;
}

/* First Bar width */
.hamburger-icon .bar:nth-child(1) {
  width: 70%;
}

/* Second Bar width */
.hamburger-icon .bar:nth-child(2) {
  width: 50%;
}

/* Third Bar widtg */
.hamburger-icon .bar:nth-child(3) {
  width: 30%;
}

/* Sidebar Footer (Settings and Login section) */
.sidebar-footer {
  position: absolute;
  bottom: 0;
  width: 100%;
  border-top: 1px solid #eee;
  padding: 10px 0;
  display: flex;
  justify-content: space-between;
  background: white;
}

.sidebar-footer-item:first-child {
  margin-left: 10px; /* Settings to the left */
}

.sidebar-footer-item:last-child {
  margin-right: 10px; /* Login to the right */
}

.sidebar-footer-item {
  text-decoration: none;
  color: #333;
  display: flex;
  align-items: center;
  font-size: 14px;
}

.sidebar-footer-item i {
  margin-right: 5px;
}

.sidebar-footer-item:hover {
  color: #006AFF;
}


/* 1450px */
@media only screen and (max-width: 1450px) {
  .sidebar {
    width: 220px;
    left: -220px;
  }
  .sidebar.active {
    left: 0;
  }
}

/* 1100px */
@media only screen and (max-width: 1100px) {
  .sidebar {
    width: 200px;
    left: -200px;
  }
  .sidebar.active {
    left: 0;
  }
}

/* 600px */
@media only screen and (max-width: 600px) {
  .sidebar {
    width: 180px;
    left: -180px;
  }
  .sidebar.active {
    left: 0;
  }
  .open-sidebar-btn {
    left: 10px;
  }
}

/* --- Filter Style--- */
.filter-menu {
  position: absolute;
  top: 110%; /* logo below the input */
  right: 0;
  background: #fff;
  border: 1px solid #ccc;
  border-radius: 8px;
  padding: 8px 0;
  box-shadow: 0 2px 6px rgba(0,0,0,0.15);
  display: none;
  z-index: 100002; 
  min-width: 100px;
}

/* group filter options into categories */
.filter-category {
  padding: 5px 10px;
  border-bottom: 1px solid #eee;
}

.filter-category:last-child {
  border-bottom: none;
}

.filter-category-title {
  font-size: 0.9rem;
  font-weight: bold;
  margin-bottom: 5px;
  display: block;
  color: #006AFF;
}

.filter-menu button {
  width: 100%;
  background: none;
  border: none;
  text-align: left;
  padding: 8px 15px;
  cursor: pointer;
  border-radius: 4px;
  font-family: 'Poppins', sans-serif;
  transition: background 0.2s;
}

.filter-menu button:hover,
.filter-menu button.active {
  background: #f1f1f1;
}

/* new styles for Filter by Tag Modal */
#filterByTagModal .modal-dialog {
  max-width: 300px;
}

#filterByTagModal .modal-header {
  padding: 8px 15px;
}

#filterByTagModal .modal-body {
  padding: 15px;
}

#filterByTagModal #tagSearchInput {
  font-size: 0.9rem;
  padding: 5px;
}

#filterByTagModal #tagList .list-group-item {
  font-size: 0.9rem;
  padding: 5px 10px;
}


/* ================================ */
/* Night Mode Adjustments for Sidebar */
/* ================================ */
body.night-mode .sidebar {
  background-color: #1e1e1e !important;
  color: #ffffff !important;
}

body.night-mode .sidebar-header {
  border-bottom: 1px solid #444444 !important;
}

body.night-mode .sidebar-logo {
  /* Logo colour change
     filter: invert(1) !important;
  */
}

body.night-mode .sidebar-search {
  border-bottom: 1px solid #444444 !important;
}

body.night-mode .sidebar-search input {
  background-color: #2c2c2c !important;
  border: 1px solid #444444 !important;
  color: #ffffff !important;
}

body.night-mode .sidebar-filter-btn {
  color: #ffffff !important;
}

/* Itens do menu */
body.night-mode .menu-item a {
  color: #ffffff !important;
}

body.night-mode .menu-item a:hover {
  background: #006AFF !important; 
  color: #ffffff !important;
}

body.night-mode .menu-item a.active {
  background: #006AFF !important;
  color: #ffffff !important;
}

/* Footer sidebar */
body.night-mode .sidebar-footer {
  background: #1e1e1e !important;
  border-top: 1px solid #444444 !important;
}

body.night-mode .sidebar-footer-item {
  color: #ffffff !important;
}

body.night-mode .sidebar-footer-item:hover {
  color: #006AFF !important;
}

body.night-mode .hamburger-icon .bar {
  background-color: #ffffff !important;
}

body.night-mode .filter-menu {
  background: #1e1e1e !important;
  border: 1px solid #444444 !important;
  color: #ffffff !important;
}

body.night-mode .filter-menu .filter-category-title {
  color: #006AFF !important;
}

body.night-mode .filter-menu button {
  background: none !important;
  color: #ffffff !important;
}

body.night-mode .filter-menu button:hover,
body.night-mode .filter-menu button.active {
  background: #2c2c2c !important;
}
