/* Import Google Fonts */
@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@400;500;600;700&display=swap');

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  --primary-color: #4a90e2;
  --primary-dark: #145bd6;
  --secondary-color: #1abc9c;
  --text-color: #333;
  --bg-color: #f9f9fb;
  --white: #fff;
  --border-color: #e0e0e0;
  --shadow-sm: 0 2px 4px rgba(0,0,0,0.05);
  --shadow-md: 0 4px 6px rgba(0,0,0,0.1);
  --transition: all 0.3s ease;
}

body {
  font-family: 'Poppins', sans-serif;
  line-height: 1.6;
  background-color: var(--bg-color);
  color: var(--text-color);
  overflow: hidden;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
  width: 8px;
}

::-webkit-scrollbar-track {
  background: #f1f1f1;
  border-radius: 10px;
}

::-webkit-scrollbar-thumb {
  background: #c1c1c1;
  border-radius: 10px;
  transition: var(--transition);
}

::-webkit-scrollbar-thumb:hover {
  background: #a8a8a8;
}

/* Header styles */
header {
  background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
  color: var(--white);
  padding: 15px 0;
  position: fixed;
  width: 100%;
  top: 0;
  left: 0;
  z-index: 1000;
  box-shadow: var(--shadow-md);
}

.header-container {
  width: 95%;
  max-width: 1400px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

header h1 {
  font-size: 1.8rem;
  font-weight: 700;
}

/* Hamburger Menu Button */
#menu-toggle {
  background: transparent;
  color: var(--white);
  border: none;
  cursor: pointer;
  display: none;
  width: 30px;
  height: 24px;
  position: relative;
  z-index: 1001;
}

.hamburger-line {
  display: block;
  width: 100%;
  height: 3px;
  background: transparent;
  color: #fff;
  margin: 5px 0;
  transition: var(--transition);
  border-radius: 3px;
}

/* Container layout */
.container {
  width: 100%;
  margin: 0 auto;
  display: flex;
  gap: 20px;
  height: 100vh;
  padding-top: 70px; /* Adjust based on header height */
  overflow: hidden;
}

/* Sidebar styles */
nav#sidebar {
  background: var(--white);
  border-right: 1px solid var(--border-color);
  padding: 20px;
  width: 250px;
  height: 100%;
  overflow-y: auto;
  transition: var(--transition);
  position: fixed;
  left: 0;
  top: 70px; /* Match header height */
  bottom: 0;
  z-index: 900;
  box-shadow: var(--shadow-sm);
}

nav#sidebar ul {
  list-style: none;
}

nav#sidebar ul li {
  margin-bottom: 15px;
}

nav#sidebar ul li a {
  text-decoration: none;
  color: var(--primary-color);
  font-weight: 500;
  transition: var(--transition);
  display: block;
  padding: 8px 10px;
  border-radius: 5px;
}

nav#sidebar ul li a:hover {
  color: var(--primary-dark);
  background-color: rgba(74, 144, 226, 0.1);
}

nav#sidebar ul li a.active {
  background-color: rgba(74, 144, 226, 0.15);
  color: var(--primary-dark);
  font-weight: 600;
}

/* Main content styles */
main {
  flex: 1;
  background: var(--white);
  padding: 30px;
  border-radius: 8px;
  box-shadow: var(--shadow-sm);
  overflow-y: auto;
  margin-left: 250px; /* Match sidebar width */
  height: calc(100vh - 70px); /* Adjust based on header height */
  transition: var(--transition);
}

/* Section headings */
h2 {
  font-size: 1.8rem;
  margin-bottom: 15px;
  border-bottom: 2px solid var(--border-color);
  padding-bottom: 5px;
  color: var(--primary-dark);
  scroll-margin-top: 80px; /* For smooth scrolling */
}

h3 {
  font-size: 1.4rem;
  margin-top: 25px;
  margin-bottom: 10px;
  color: var(--secondary-color);
  scroll-margin-top: 80px; /* For smooth scrolling */
}

h4 {
  font-size: 1.2rem;
  margin-top: 20px;
  margin-bottom: 8px;
  color: #34495e;
  scroll-margin-top: 80px; /* For smooth scrolling */
}

/* Paragraphs and lists */
p, li {
  margin-bottom: 10px;
  font-size: 1rem;
}

ol, ul {
  margin-left: 20px;
  margin-bottom: 15px;
}

/* Section subsections */
.section-sub {
  margin-bottom: 30px;
}

img {
  max-width: 100%;
  height: auto;
  margin: 15px 0;
  border-radius: 5px;
  box-shadow: var(--shadow-sm);
}

/* Note Styles */
.note {
  background-color: #e3f2fd;
  border-left: 6px solid #2196f3;
  padding: 20px;
  margin: 20px 0;
  border-radius: 8px;
  box-shadow: var(--shadow-sm);
}

.note h5 {
  color: #1976d2;
  margin-top: 0;
  font-size: 1.4rem;
  display: flex;
  align-items: center;
}

.note ol, .note ul {
  margin: 15px 0;
  padding-left: 20px;
}

.note ol li, .note ul li {
  margin-bottom: 8px;
  color: var(--text-color);
}

.note ul li {
  list-style-type: disc;
}

.note p {
  font-style: italic;
  color: #555;
}

/* Small Note Styles */
.small-note {
  background-color: #fff3e0;
  border-left: 4px solid #ff9800; 
  padding: 10px 15px; 
  margin: 10px 0; 
  border-radius: 6px; 
  box-shadow: var(--shadow-sm);
  font-size: 0.9rem; 
}

.small-note p {
  margin: 0;
  font-style: italic;
  color: #555;
}

/* Scroll to top button */
.scroll-to-top {
  position: fixed;
  bottom: 30px;
  right: 30px;
  width: 50px;
  height: 50px;
  background-color: var(--primary-color);
  color: var(--white);
  border-radius: 50%;
  display: flex;
  justify-content: center;
  align-items: center;
  cursor: pointer;
  box-shadow: var(--shadow-md);
  opacity: 0;
  visibility: hidden;
  transition: var(--transition);
  z-index: 999;
}

.scroll-to-top.visible {
  opacity: 1;
  visibility: visible;
}

.scroll-to-top:hover {
  background-color: var(--primary-dark);
  transform: translateY(-3px);
}

.scroll-to-top svg {
  width: 24px;
  height: 24px;
  fill: var(--white);
}

/* Responsive styles */
@media (max-width: 992px) {
  nav#sidebar {
    width: 220px;
  }
  
  main {
    margin-left: 220px;
  }
}

@media (max-width: 768px) {
  #menu-toggle {
    display: block;
  }
  
  nav#sidebar {
    transform: translateX(-100%);
    width: 250px;
    box-shadow: var(--shadow-md);
  }
  
  nav#sidebar.active {
    transform: translateX(0);
  }
  
  main {
    margin-left: 0;
    width: 100%;
  }
  
  .header-container {
    width: 90%;
  }
  
  header h1 {
    font-size: 1.5rem;
  }
}

@media (max-width: 480px) {
  main {
    padding: 20px 15px;
  }
  
  .scroll-to-top {
    width: 40px;
    height: 40px;
    bottom: 20px;
    right: 20px;
  }
  
  h2 {
    font-size: 1.5rem;
  }
  
  h3 {
    font-size: 1.3rem;
  }
}