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

/* --- General Reset for Sidebar --- */
::after,
::before {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

.wrapper {
  display: flex;
}

/* --- Sidebar Container --- */
#sidebar {
  position: fixed;
  top: 0;
  min-width: 70px;
  height: 100vh;
  z-index: 1040;
  transition: width 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  background: #232323;
  color: #E4E5F1;
  border-right: #171717 solid 1px;
  display: flex;
  flex-direction: column;
  width: 70px;
  padding-bottom: 0.5em;
}
#sidebar.expand {
  width: 220px;
}

/* --- Sidebar Scrollbar --- */
#sidebar::-webkit-scrollbar {
  width: 5px;
}
#sidebar::-webkit-scrollbar-track {
  background-color: #cccccc;
}
#sidebar::-webkit-scrollbar-thumb {
  background-color: #999999;
  border-radius: 4px;
}
#sidebar::-webkit-scrollbar-thumb:hover {
  background-color: #777777;
}

/* --- Sidebar Toggle Button (To expand the sidebar) --- */
.toggle-btn {
  background-color: transparent;
  color: white;
  cursor: pointer;
  border: 0;
  padding: 1rem 0.5rem;
  transition: transform 0.3s;
}
.toggle-btn:hover{
  color: #AEFF00;
}
#sidebar:not(.expand) .toggle-btn i {
  transform: rotate(90deg);
  transition: transform 0.3s;
}
#sidebar.expand .toggle-btn i {
  transform: rotate(0deg);
  transition: transform 0.3s;
}

/* --- Sidebar Logo --- */
.sidebar-logo {
  width: 100%;
  margin: auto 0;
}
.sidebar-top{
  justify-content: center;
  height: 220px;
  box-shadow: 0 4px 4px -2px rgba(0, 0, 0, 0.7);
  border-bottom: 2px solid black;
}
.logo-redirection{
  margin: 0;
  box-sizing: border-box;
}

/* --- Sidebar Navigation --- */
.sidebar-nav {
  padding: 2rem 0;
  flex: 1 1 auto;
  list-style: none;
  --bs-nav-link-color: #E4E5F1;
  --bs-nav-link-hover-color: #E4E5F1;
}
#sidebar.expand .sidebar-nav {
  overflow-y: auto;
}

.nav-item {
  position: relative;
}

/* --- Sidebar Navigation Links --- */
.nav-link {
  cursor: pointer;
  padding: .625rem 1.625rem;
  color: #FFF;
  display: block;
  font-size: 0.9rem;
  white-space: nowrap;
  border-left: 3px solid transparent;
}
.nav-link:active {
  color: #E4E5F1;
}
.nav-link:hover {
  color: #AEFF00;
}
.nav-link i {
  font-size: 1.1rem;
  margin-right: .75rem;
}

/* --- Sidebar Dropdowns Menus --- */
#sidebar:not(.expand) .nav-item .sidebar-dropdown {
  position: absolute;
  top: 0;
  left: 100%;
  background: #232323;
  border-radius: 8px;
  border: 1px solid #444;
  box-shadow: 0 4px 16px rgba(0,0,0,0.15);
  padding: 0.5em 0;
  min-width: fit-content;
  display: none;
}
#sidebar:not(.expand) .nav-item:hover > .has-dropdown + .sidebar-dropdown {
  display: block;
  width: 100%;
  opacity: 1;
}
#sidebar.expand .nav-link[data-bs-toggle="collapse"]::after {
  border: solid;
  border-width: 0 .075rem .075rem 0;
  content: "";
  display: inline-block;
  padding: 2px;
  position: absolute;
  right: 1.5rem;
  top: 1.4rem;
  transform: rotate(-135deg);
  transition: all .2s ease-out;
}
#sidebar.expand .nav-link[data-bs-toggle="collapse"].collapsed::after {
  transform: rotate(45deg);
  transition: all .2s ease-out;
}
#sidebar:not(.expand) .sidebar-logo,
#sidebar:not(.expand) .sidebar-nav > .nav-item > .nav-link > span ,
#sidebar:not(.expand) .sidebar-button-text {
    display: none;
}


/* Kiwi Menu Dropdown */
#kiwiMenu, #kiwiMenu>li>ul{
  background-color: rgb(199, 199, 199);
  color: rgb(0, 0, 0);
}

#kiwiMenu a{
  color: black;
}
#sidebar:not(.expand) #kiwiMenu a{
  color: white;
}


#kiwiMenu a:hover{
  color: #5f8a02;
}



/* --- Sidebar Button --- */
.sidebar-button {
  margin: 1em;
  margin-bottom: 2em;
}
.sidebar-button > a{
  background-color: #CFB15A;
  transition: all 0.4s;
  text-decoration: none;
}
.sidebar-button > a:hover{
  background-color: #e8c867;
  transition: all 0.4s;
}
.sidebar-button-logo {
  width: 40px;
  height: auto;
}

/* --- Sidebar Button Link & Text --- */
.sidebar-button-link {
  border-radius: 15px;
  padding: 5px;
  display: inline-block;
  white-space: nowrap;
}
.sidebar-button-text {
  text-decoration: none;
  color: #000000;
  font-weight: bold;
  text-align: center;
}

/* --- Sidebar Dropdown Content --- */
.sidebar-dropdown {
  background-color: #4b4b4b;
  color: #AEFF00;
}
.sidebar-link {
  display: flex;
  align-items: center;
  text-decoration: none;
  color: #E4E5F1;
}
.sidebar-link:hover {
  color: #AEFF00;
}

/* --- Sidebar Footer --- */
.sidebar-footer {
  height: 100px;
  padding-top: 5%;
  margin-top: auto;
}


.version {
  opacity: 0.5;
  font-size: 0.8rem;
}

/* --- Sidebar Active State --- */
.active {
  border-left: 2px solid #AEFF00;
  color: #AEFF00;
}
.active>.nav-link,
.active>.sidebar-link {
  color: #AEFF00;
}

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

/* --- Topbar Container --- */
.topbar-header {
  position: fixed;
  top: 0;
  flex-grow: 1;
  width: 100%;
  height: 64px;
  background: #232323;
  z-index: 1050;
  display: flex;
  justify-content: space-between;
  box-shadow: 0 2px 8px rgba(0,0,0,0.08);
  padding: 1em;
  gap: 2em;
}

/* --- Topbar Responsive Position --- */
body.sidebar-expanded .topbar-header {
  left: 220px;
  width: calc(100% - 220px);
  transition: left 0.25s, width 0.25s;
}
body:not(.sidebar-expanded) .topbar-header {
  left: calc(70px);
  width: calc(100% - 70px);
  transition: left 0.25s, width 0.25s;
}

/* --- Topbar Navigation --- */
.topbar-nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
  padding: 0;
  margin: 0;
  list-style: none;
}

.topbar-time {
  color: #AEFF00;
  font-size: 2em;
  font-weight: bold;
}
.topbar-user .nav-link span.mr-2 {
  font-size: 2em !important;
}

/* --- Topbar Flex Layout --- */
.topbar-flex {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
  padding: 0;
  margin: 0;
  list-style: none;
}
.topbar-title {
  color: white;
  font-size: 2em;
  margin: 0;
}

/* --- Topbar Dropdown --- */
.topbar-dropdown {
  background: #232323;
  border-radius: 8px;
  border: 1px solid #444;
  box-shadow: 0 4px 16px rgba(0,0,0,0.15);
  padding: 0.5em 0;
}
.topbar-dropdown .dropdown-item {
  color: #E4E5F1;
  transition: background 0.2s, color 0.2s;
}
.topbar-dropdown .dropdown-item:hover {
  background: #AEFF00;
  color: #232323;
}
.dropdown-divider {
  border-top: 1px solid #444;
  margin: 0;
}
.dropdown-menu{
  padding-top: 0;
  padding-bottom: 0;
}

/* --- Topbar Dropdown Language Switcher --- */
.topbar-dropdown .dropdown-item.language-switcher {
  padding: 0;
  background: none;
  border: none;
}
.topbar-dropdown .dropdown-item.language-switcher ul {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5em;
  margin: 0;
  padding: 0.5em 0;
  min-width: 4rem;
}
.topbar-dropdown .dropdown-item.language-switcher li {
  list-style: none;
}
@media (max-width: 576px) {
  .topbar-dropdown .dropdown-item.language-switcher ul {
    min-width: 2.5rem;
  }
}

/* --- Topbar Dropdown Menu --- */
.topbar-dropdown .dropdown-menu {
  position: relative;
  overflow: visible;
  background-color: #232323;
  border: 1px solid #444;
  z-index: 1051;
}
.topbar-dropdown .dropdown-submenu > .dropdown-menu.language-flags-dropdown {
  position: absolute;
  left: 100%;
  top: 0;
  display: none;
  visibility: hidden;
  opacity: 0;
  min-width: 180px;
  z-index: 1052;
}
.dropdown-item.active-locale{
  background: #03C700;
  color: black;
}
.topbar-dropdown .dropdown-submenu:hover > .dropdown-menu.language-flags-dropdown,
.topbar-dropdown .dropdown-submenu:focus-within > .dropdown-menu.language-flags-dropdown {
  display: block;
  visibility: visible;
  opacity: 1;
}
.dropdown-menu--rounded li:first-child > .dropdown-item {
  border-top-left-radius: 8px;
  border-top-right-radius: 8px;
}
.dropdown-menu--rounded li:last-child > .dropdown-item {
  border-bottom-left-radius: 8px;
  border-bottom-right-radius: 8px;
}

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

/* --- Sidebar Responsive --- */
@media (max-width: 576px) {
  .sidebar-button a {
    flex-direction: column;
    align-items: center;
    text-align: center;
  }
  .sidebar-button-logo {
    margin-bottom: 8px;
  }
  .topbar-dropdown .dropdown-item.language-switcher ul {
    min-width: 2.5rem;
  }
}