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

* {
  font-family: "Poppins", "sans-sarif";
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  --body-color: #e4e9f7;
  --sidebar-color: #fff;
  --primary-color: #f4f2f2;
  --primary-color-light: #f4f2f2;
  --toggle-color: #ddd;
  --text-color: #707070;
  --dark-color: #000;

  --trans-02: all 0.2s ease;
  --trans-03: all 0.3s ease;
  --trans-04: all 0.4s ease;
  --trans-05: all 0.5s ease;
}

body {
  height: 100vh;
  background-color: var(--body-color);
  transition: var(--trans-02);
}

body.dark {
  --body-color: #181914;
  --sidebar-color: #242526;
  --primary-color: #34383c;
  --primary-color-light: #383a3c;
  --toggle-color: #fff;
  --text-color: #ccc;
  --dark-color: #fff;
}
/* Reusable CSS */

.sidebar .text {
  font-size: 16px;
  font-weight: 500;
  color: var(--text-color);
  /* transition: var(--trans-04); */
  white-space: unset;
  opacity: 1;
}

.sidebar .image {
  min-width: 60px;
  display: flex;
  align-items: center;
}

/* Sidebar */
.sidebar {
  position: fixed;
  top: 0;
  left: 0;
  height: 100%;
  width: 250px;
  background-color: var(--sidebar-color);
  padding: 10px 14px;
  transition: var(--trans-02);
}

.sidebar header {
  position: relative;
}
.sidebar .image-text img {
  width: 40px;
  height: 40px;
  border-radius: 10px;
}

.sidebar header .image-text {
  display: flex;
  align-items: center;
}

.header .image-text .header-text {
  display: flex;
  flex-direction: column;
}

.header-text .main {
  font-weight: 600;
  font-size: larger;
}

.header-text .sub {
  margin-top: -2px;
    font-size: larger;

}

.sidebar header .toggle {
  position: absolute;
  top: 50%;
  right: -25px;
  transform: translateY(-50%) rotate(180deg);
  height: 25px;
  width: 25px;
  background-color: var(--dark-color);
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  color: var(--sidebar-color);
  font-size: 22px;
}

.sidebar li {
  height: 50px;
  /* background-color: red; */
  margin-top: 10px;
  list-style: none;
  display: flex;
  align-items: center;
}

.sidebar li .icons {
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 60px;
  font-size: 20px;
}
.sidebar li .icons,
.sidebar li .text {
  color: var(--text-color);
  transition: var(--trans-03);
}

.sidebar .search-bar input {
  width: 100%;
  height: 100%;
  outline: none;
  border: none;
  border-radius: 6px;
  background-color: var(--primary-color-light);
}
.sidebar .search-bar {
  background-color: var(--primary-color-light);
}

.sidebar li a {
  height: 100%;
  width: 100%;
  text-decoration: none;
  display: flex;
  align-items: center;
  padding-right: 50px;
  border-radius: 6px;
  transition: var(--trans-04);
  text-align: left;
}

.sidebar li a:hover {
  background: var(--primary-color);
}
.sidebar li a:hover .icons,
.sidebar li a:hover .text {
  color: var(--dark-color);
}

.sidebar .menu-bar {
  height: calc(100% - 50px);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.menu-bar .mode {
  position: relative;
  border-radius: 6px;
  background: var(--primary-color-light);
}

.menu-bar .mode .moon-sun {
  height: 50px;
  width: 60px;
  display: flex;
  align-items: center;
}
.menu-bar .mode i {
  position: absolute;
  transition: var(--trans-03);
}

.menu-bar .mode i.sun {
  opacity: 0;
}
body.dark .menu-bar .mode i.sun {
  opacity: 1;
}
body.dark .menu-bar .mode i.moon {
  opacity: 0;
}
.menu-bar .mode .toggle-switch {
  position: absolute;
  /* left: 0; */
  right: -10px;
  display: flex;
  height: 100%;
  align-items: center;
  justify-content: center;
  min-width: 60px;
  background: var(--primary-color-light);

  /* background: red; */
  cursor: pointer;
}

.toggle-switch .switch {
  position: relative;
  height: 22px;
  width: 44px;
  background-color: var(--toggle-color);
  border-radius: 25px;
}

.switch::before {
  content: "";
  position: absolute;
  height: 15px;
  width: 15px;
  border-radius: 50%;
  top: 50%;
  left: 5px;
  transform: translateY(-50%);
  background-color: var(--sidebar-color);
}

body.dark .switch::before {
  left: 25px;
}

body.dark .sidebar .image img {
  background-color: #fff;
  /* border-color: 2px solid #000; */
}

.sidebar.close {
  width: 78px;
}

.sidebar.close .text {
  opacity: 0;
}

.sidebar.close .search-bar {
  background-color: var(--sidebar-color);
}

body.dark .search-bar input {
  color: white;
}

.sidebar.close .toggle {
  transform: translateY(-50%);
}




/* Main container next to the sidebar */
.main-container {
  margin-left: 250px; /* Same width as the expanded sidebar */
  padding: 20px;
  width: calc(100% - 250px); /* Adjust width dynamically */
  min-height: 100vh;
  transition: var(--trans-02);
}

/* Adjust when the sidebar is collapsed */
.sidebar.close ~ .main-container {
  margin-left: 78px; /* Adjust to collapsed width */
  width: calc(100% - 78px);
}

/* Make sure the container adjusts properly in dark mode */
body.dark .main-container {
  background-color: var(--primary-color);
  color: var(--text-color);
}



/* Add these styles to your existing CSS file */

/* Make the menu scrollable */
.sidebar .menu {
  flex-grow: 1;
  overflow: hidden;
  position: relative;
}

.sidebar .scrollable-menu {
  height: 100%;
  overflow-y: scroll;
  padding-right: 5px; /* Add some padding for the scrollbar */
  /* For Firefox */
  scrollbar-width: thick;
  scrollbar-color: var(--text-color) var(--sidebar-color);
}


/* For Webkit browsers (Chrome, Safari, etc.) */
.sidebar .scrollable-menu::-webkit-scrollbar {
  width: 5px;
}

.sidebar .scrollable-menu::-webkit-scrollbar-track {
  background: var(--sidebar-color);
}

.sidebar .scrollable-menu::-webkit-scrollbar-thumb {
  background-color: var(--text-color);
  border-radius: 6px;
}

/* Fix the bottom content */
.sidebar .menu-bar {
  display: flex;
  flex-direction: column;
  height: calc(100% - 60px); /* Adjust based on your header height */
}

.sidebar .bottom-content {
  margin-top: auto;
  background-color: var(--sidebar-color);
  position: sticky;
  bottom: 0;
  padding-top: 10px;
  border-top: 1px solid var(--primary-color-light);
}

/* Ensure proper layout when sidebar is closed */
.sidebar.close .scrollable-menu {
  overflow: hidden;
}

/* Additional fix for the main container */
.sidebar.close ~ .main-container {
  margin-left: 78px; 
  width: calc(100% - 78px);
}

/* Ensure bottom content stays visible in closed state */
.sidebar.close .bottom-content {
  padding-top: 5px;
}


#cookie-popup {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    background: black;
    color: white;
    padding: 10px 20px;
    border-radius: 5px;
    opacity: 0.9;
    z-index: 1000;
    display: flex;
    align-items: center;
    gap: 10px;
    transition: opacity 0.5s ease;
}

#cookie-popup a {
    text-decoration: underline;
}

#close-popup {
    background: none;
    border: none;
    color: white;
    font-size: 16px;
    cursor: pointer;
}
