﻿/* Navbar */
.navbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--header-height); 
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--primary-color);
  z-index: 99998;
}
.navbar .navbar-brand {
  font-weight: bold;
  color: #fff;
  text-decoration: none;
  font-size: 1.6rem;
  letter-spacing: 0.5px;
  transition: color 0.3s ease;
}
.navbar .navbar-brand:hover {
  color: var(--accent-color);
}

/* Small devices */
@media (max-width: 480px) {
  .navbar .navbar-brand {
    font-size: 1rem;
  }
}


/* --- 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; }
}


/* ===== Mega Menu ===== */
.mega-menu ul {
    list-style-type: none;
    padding: 4px;
    margin: 4px;
}

.mega-menu li {
    padding: 4px;
    margin: 0;
}

.mega-menu a {
    text-decoration: none;
}

.mega-menu ul ul a:hover {
    background-color: var(--primary-color);
    color: white;
}

.mega-menu > ul {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-around;
}

.mega-menu > ul > li {
    flex: 1;
}

/* Second-level list items: grid with bullet column */
.mega-menu > ul > li > ul > li {
    display: grid;
    grid-template-columns: 28px 1fr;
}

/* Bullet pseudo‑element – placed in first column, first row */
.mega-menu > ul > li > ul > li::before {
    content: '';
    grid-column: 1;
    grid-row: 1;
    margin: 0.5rem 0.5rem 0.5rem 0;   /* right margin only for spacing */
    align-self: center;
    justify-self: center;
    display: block;
    height: 0.5rem;
    width: 0.5rem;
    border-radius: 9999px;
    --tw-bg-opacity: 1;
    background-color: rgb(121 156 75 / var(--tw-bg-opacity));
}

/* All direct children (links, paragraphs, etc.) go into the second column */
.mega-menu > ul > li > ul > li > * {
    grid-column: 2;
}

/* Alternate bullet color for even rows */
.mega-menu > ul > li > ul > li:nth-child(even)::before {
    background-color: rgb(153 0 51 / var(--tw-bg-opacity));
}

/* Basic paragraph styling inside menu */
.mega-menu p {
    margin: 0.25rem 0 0.5rem 0;
    font-size: 0.9rem;
    line-height: 1.4;
    color: #555;
}

@media screen and (max-width: 640px) {
    .mega-menu > ul {
        flex-direction: column;
    }
}
