﻿/* --- Header Menu Toggle (open button) --- */
.menu-toggle {
  position: absolute;
  left: 1rem;
  background: none;
  border: none;
  color: #fff;
  font-size: 1.6rem;
  cursor: pointer;
  transition: transform 0.2s ease;
}
.menu-toggle:hover {
  transform: scale(1.1);
}


.close-sidebar-btn {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background-color: var(--primary-color);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  cursor: pointer;
  box-shadow: 0 2px 6px rgba(0,0,0,0.2);
  transition: background-color 0.3s, transform 0.2s;
}

.close-sidebar-btn:hover {
  background-color: var(--secondary-color);
  transform: rotate(90deg) scale(1.1);
}


/* ===== Sidebar Styles ===== */
.sidebar {
  position: fixed;
  top: 0;
  left: -270px;
  width: 270px;
  height: 100%;
  background: #fff;
  box-shadow: 3px 0 12px rgba(0, 0, 0, 0.15);
  overflow-y: auto;
  transition: left 0.3s ease;
  z-index: 99999;
}
.sidebar.active { left: 0; }

/* Sidebar Header */
.sidebar-header {
  height: var(--header-height);
  padding: 0 20px;
  background: var(--primary-color);
  color: white;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.sidebar-header h5 {
  margin: 0;
  font-size: 1.2rem;
}

/* Navigation Menu */
.nav {
  list-style: none;
  padding: 10px 0;
  margin: 0;
}
.nav li {
  border-bottom: 1px solid #f0f0f0;
  width: 100%;
}

/* Menu Rows */
.nav .menu-row {
  display: flex;
  align-items: center;
  justify-content: space-between; /* push toggle to end */
  width: 100%;
}
.nav .menu-row a {
  flex: 1;
  display: flex;
  align-items: center;
  padding: 15px 20px;
  color: var(--text-color);
  text-decoration: none;
  transition: all 0.3s;
  font-size: 1rem;
}
.nav .menu-row a:hover {
  background-color: #f0f5ff;
  color: var(--primary-color);
}
.nav i {
  margin-right: 15px;
  width: 20px;
  text-align: center;
  color: var(--primary-color);
}

/* Collapse Toggle */
.collapse-toggle {
  margin-left: auto;
  padding: 0 15px;
  color: var(--primary-color);
  cursor: pointer;
  transition: transform 0.3s;
  display: flex;
  align-items: center;
}
.collapse-menu.active .collapse-toggle i {
  transform: rotate(180deg);
}

/* Submenu Content */
.collapse-content {
  width: 100%;
  background-color: #f8f9fa;
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s ease;
}
.collapse-content.active {
  max-height: 500px;
}
.collapse-content a {
  display: block;
  padding: 12px 20px 12px 55px;
  font-size: 1rem;
  color: var(--text-color);
  text-decoration: none;
  transition: all 0.2s;
  position: relative;
  border-left: 3px solid transparent;
}
.collapse-content a:hover {
  background-color: #e8eeff;
  color: var(--primary-color);
  border-left: 3px solid var(--accent-color);
}

/* ===== Overlay ===== */
.overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.5);
  z-index: 10000;
  display: none;
  transition: all 0.3s;
}
.overlay.active { display: block; }

/* ===== Responsive Design ===== */
@media (max-width: 768px) {
  .sidebar {
    width: 250px;
    left: -250px;
  }
  .collapse-content a { padding-left: 50px; }
}
