/* Base Styles */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
}

body {
  line-height: 1.6;
  color: #333;
  background-color: #f5f5f5;
}
/* Responsive Images */
img {
  max-width: 100%;
  height: auto;
  display: block;
  margin: 20px auto;
}
.image-container {
  text-align: center;
  margin: 20px 0;
}

/* Navigation */
.topnav {
  background-color: #4caf50;
  overflow: hidden;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 20px;
  position: sticky;
  top: 0;
  z-index: 1000;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

.logo {
  color: white;
  font-size: 24px;
  font-weight: bold;
  padding: 14px 0;
}

.nav-links {
  display: flex;
}

.nav-links a {
  color: white;
  text-align: center;
  padding: 14px 16px;
  text-decoration: none;
  font-size: 17px;
  transition: background-color 0.3s;
}

.nav-links a:hover {
  background-color: #45a049;
}

.nav-links a.active {
  background-color: #367c39;
}

.icon {
  display: none;
  color: white;
  text-decoration: none;
  padding: 14px 16px;
  cursor: pointer;
}

.hamburger {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  height: 24px;
  width: 30px;
}

.bar {
  height: 4px;
  width: 100%;
  background-color: white;
  border-radius: 2px;
}

/* Sidebar */
.sidebar {
  height: 100%;
  width: 250px;
  position: fixed;
  z-index: 1;
  top: 56px;
  left: 0;
  background-color: #fff;
  overflow-x: hidden;
  padding-top: 20px;
  box-shadow: 2px 0 5px rgba(0, 0, 0, 0.1);
  transition: 0.3s;
}

.sidebar a {
  padding: 10px 15px;
  text-decoration: none;
  font-size: 16px;
  color: #333;
  display: block;
  transition: 0.3s;
  border-left: 4px solid transparent;
}

.sidebar a:hover {
  background-color: #f1f1f1;
  border-left: 4px solid #4caf50;
}

.sidebar a.active {
  background-color: #e9f5e9;
  border-left: 4px solid #4caf50;
  color: #4caf50;
  font-weight: bold;
}

/* Main Content */
.main-content {
  margin-left: 250px;
  padding: 20px;
  max-width: 1200px;
  transition: margin-left 0.3s;
}

h1 {
  color: #333;
  margin-bottom: 20px;
  padding-bottom: 10px;
  border-bottom: 2px solid #4caf50;
}

h2 {
  color: #4caf50;
  margin: 25px 0 15px;
}

h3 {
  color: #333;
  margin: 20px 0 10px;
}

p {
  margin-bottom: 15px;
}

/* Cards and Boxes */
.intro-card {
  background-color: #fff;
  padding: 20px;
  border-radius: 5px;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
  margin-bottom: 20px;
}

.definition-box {
  background-color: #e9f5e9;
  padding: 15px;
  border-left: 4px solid #4caf50;
  margin-bottom: 20px;
  border-radius: 0 5px 5px 0;
}

.note-box {
  background-color: #fff3cd;
  padding: 15px;
  border-left: 4px solid #ffc107;
  margin: 20px 0;
  border-radius: 0 5px 5px 0;
}

.topic-box {
  background-color: #fff;
  padding: 10px 15px;
  border-radius: 5px;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
  margin-bottom: 20px;
  display: inline-block;
}

.topic-box h2 {
  margin: 0;
  color: #4caf50;
}

.ds-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 20px;
  margin: 20px 0;
}

.ds-card {
  background-color: #fff;
  padding: 20px;
  border-radius: 5px;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
  transition: transform 0.3s, box-shadow 0.3s;
}

.ds-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.ds-card h3 {
  color: #4caf50;
  margin-bottom: 10px;
}

.ds-card .btn {
  margin-top: 10px;
  display: inline-block;
}

/* Code Examples */
.code-example {
  margin: 20px 0;
}

.code-example h3 {
  margin-bottom: 10px;
}

pre {
  background-color: #f8f8f8;
  padding: 15px;
  border-radius: 5px;
  overflow-x: auto;
  border: 1px solid #ddd;
}

code {
  font-family: "Courier New", Courier, monospace;
  color: #333;
}

/* Feature List */
.feature-list {
  margin: 20px 0;
  padding-left: 20px;
}

.feature-list li {
  margin-bottom: 10px;
}

/* Diagram */
.diagram-container {
  margin: 20px 0;
  text-align: center;
}

.diagram {
  display: inline-block;
  margin: 20px auto;
}

.diagram-node {
  background-color: #4caf50;
  color: white;
  padding: 10px 15px;
  border-radius: 5px;
  margin: 10px;
  display: inline-block;
}

.main-node {
  background-color: #333;
  font-weight: bold;
}

.diagram-branches {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 20px;
}

.branch {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.sub-branches {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
}

.sub-node {
  background-color: #45a049;
  font-size: 14px;
}

.diagram-caption {
  color: #666;
  font-style: italic;
}

/* Navigation Buttons */
.navigation-buttons {
  display: flex;
  justify-content: space-between;
  margin-top: 40px;
}

.next-page {
  display: flex;
  justify-content: flex-end;
  margin-top: 40px;
}

.btn {
  display: inline-block;
  background-color: #4caf50;
  color: white;
  padding: 10px 20px;
  text-decoration: none;
  border-radius: 5px;
  transition: background-color 0.3s;
}

.btn:hover {
  background-color: #45a049;
}

/* Footer */
footer {
  background-color: #333;
  color: white;
  text-align: center;
  padding: 20px;
  margin-top: 40px;
  margin-left: 250px;
  transition: margin-left 0.3s;
}

/* Responsive Design */
@media screen and (max-width: 768px) {
  .nav-links {
    display: none;
    flex-direction: column;
    width: 100%;
    position: absolute;
    top: 56px;
    left: 0;
    background-color: #4caf50;
    z-index: 1001;
  }

  .nav-links.responsive {
    display: flex;
  }

  .icon {
    display: block;
  }

  .sidebar {
    width: 100%;
    height: auto;
    position: relative;
    top: 0;
    padding-top: 10px;
    margin-bottom: 20px;
    display: none;
    z-index: 999;
  }

  .sidebar.responsive {
    display: block;
  }

  .main-content {
    margin-left: 0;
    padding: 15px;
  }

  footer {
    margin-left: 0;
  }

  .diagram-branches {
    flex-direction: column;
  }
}

@media screen and (max-width: 438px) {
  .navigation-buttons {
    flex-direction: column;
    align-items: center;
    gap: 12px;
    padding: 0 10px;
  }

  .navigation-buttons .btn {
    width: 100%;
    text-align: center;
    font-size: 16px;
    padding: 10px;
    gap: 10px;
  }

  h1 {
    font-size: 22px;
    text-align: center;
  }

  .btn {
    font-size: 16px;
    padding: 10px 14px;
  }

  .main-content {
    padding: 10px;
  }
}
