﻿:root {
  /* General Theme */
  --primary-color: #003366;
  --accent-color: #ffc107;
  --text-color: #333;
  --light-bg: #f5f7fa;
  --header-height: 60px;
}

* { margin:0; padding:0; box-sizing:border-box; }

body {
  font-family: "Segoe UI", Arial, sans-serif;
  background-color: var(--light-bg);
  color: var(--text-color);
  margin: 0;
}

/* --- Header and Navbar --- */
.header {
  position: fixed; /* Changed to fixed to stay on top */
  top: 0;
  left: 0;
  width: 100%;
  height: var(--header-height);
  background-color: var(--primary-color);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10000;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
}

.header h1 {
  margin: 0;
  font-size: 1.5rem;
  font-weight: normal;
  /* Truncate text on small screens */
  max-width: calc(100% - 100px);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.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);
}

/* --- Main Content --- */
.main-content {
  padding: var(--header-height) 0 0; /* Pushes content below the fixed header */
  transition: margin-left 0.3s ease;
}

/* --- Sidebar --- */
.sidebar {
  position: fixed;
  top: 0;
  left: -280px; /* Initially hidden */
  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: 20000; /* Highest z-index */
}

.sidebar.active {
  left: 0;
}

.sidebar-header {
  background: var(--primary-color);
  color: #fff;
  padding: 1rem 1.2rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.sidebar-header h5 {
  margin: 0;
  font-size: 1.2rem;
}

/* Custom style for close button to avoid conflicts */
.close-sidebar-btn {
  background: none;
  border: none;
  color: #fff;
  font-size: 1.6rem;
  cursor: pointer;
}

.sidebar .nav {
  list-style: none;
  padding: 0.5rem;
  margin: 0;
}

.sidebar .nav a {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 1.25rem;
  text-decoration: none;
  font-size: 1rem;
  color: var(--text-color);
  transition: all 0.2s ease;
  border-radius: 6px;
  margin: 0.2rem 0;
}

.sidebar .nav a i {
  width: 20px;
  text-align: center;
  color: var(--primary-color);
}

.sidebar .nav a:hover {
  background: var(--light-bg);
  color: var(--primary-color);
}

/* --- Collapse Menus --- */
.collapse-menu > a::after {
  content: "\f078"; /* Font Awesome chevron-down icon */
  font-family: "Font Awesome 6 Free";
  font-weight: 900;
  margin-left: auto;
  transition: transform 0.3s ease;
}

.collapse-menu.open > a::after {
  transform: rotate(180deg);
}

.collapse-content {
  display: none;
  padding-left: 1.5rem;
  overflow: hidden; /* Added for smooth animation */
}

.collapse-content a {
  padding: 0.5rem 1rem;
  font-size: 0.95rem;
}

/* --- Overlay --- */
.overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
  z-index: 15000;
}

.overlay.active {
  opacity: 1;
  visibility: visible;
}

/* Main Content Area */
.main-content {
    padding: var(--header-height) 0 0; /* Pushes content below the fixed header */
    transition: margin-left 0.3s ease;
}

/* Footer */
footer {
  background: var(--primary-color);
  color: #fff;
  text-align: center;
  padding: 2rem 0;
  margin-top: 3rem;
}
footer a {
  color: var(--accent-color);
  text-decoration: none;
  transition: color 0.2s ease;
}
footer a:hover { color: #e0a800; text-decoration: underline; }
