:root {
  --primary-color: #007bff;
  --primary-color-hover: #0056b3;
  --secondary-color: #28a745; /* Green for success states */
  --accent-yellow: #FFCD00; /* Swedish yellow for warnings */
  --accent-red: #C60C30; /* Danish red for errors and critical alerts */
  --background-light: #f8f9fa; /* Light background for sections */
  --background-lighter: #f1f1f1; /* Lighter background for hover or focus states */
  --border-color: #ddd; /* Neutral border color */
  --text-dark: #343a40; /* Dark gray for main text */
  --text-muted: #6c757d; /* Muted text for less emphasis */
  --nav-background: #f8f9fa; /* Navigation background color to match light background */
  --nav-link-color: #343a40; /* Dark text for navigation for contrast */
  --nav-link-hover: #0056b3; /* Hover color for navigation links */
  --font-primary: 'Roboto', sans-serif; /* Updated primary font for body text */
  --font-heading: 'Lora', serif; /* Updated font for headings and navbar brand */
  --hero-background-dark: #343a40; /* Dark grey for hero background */
  --network-primary-color: #007bff; /* Primary color for network activations */
}

/* Font Styling */
body {
  font-family: var(--font-primary);
  color: var(--text-dark);
}

h1, h2, h5, .navbar-brand {
  font-family: var(--font-heading);
}

/* Navigation Styles */
.navbar {
  position: sticky;
  top: 0;
  z-index: 100; /* Ensures the navbar stays above other content */
}

.nav-menu {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 1rem;
  margin: 0;
  padding: 0;
}

.nav-item {
  list-style: none;
}

.nav-link {
  text-decoration: none;
  color: var(--nav-link-color);
  transition: color 0.3s ease;
}

.nav-link:hover,
.nav-link:focus {
  color: var(--nav-link-hover);
}

.hamburger {
  display: none;
  cursor: pointer;
  background: none;
  border: none;
  font-size: 1.5rem;
}

@media (max-width: 768px) {
  .navbar {
    justify-content: space-between;
  }

  .nav-menu {
    display: none;
  }
  
  .nav-menu.active {
    display: flex;
    flex-direction: column;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background-color: var(--nav-background);
    padding: 1rem;
  }
  
  .hamburger {
    display: block;
  }
}
.nav-item {
  position: relative;
}

.submenu {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  background-color: var(--nav-background);
  padding: 0.5rem;
  min-width: 150px;
}

.nav-item:hover .submenu {
  display: block;
}

.submenu a {
  display: block;
  padding: 0.5rem;
  color: var(--nav-link-color);
  text-decoration: none;
}

/* Grid and Flexbox Layout*/

/* Main Page Layout */
.main-container {
  display: grid;
  grid-template-columns: 1fr 3fr; /* Sidebar (1/4) and Main Content (3/4) */
  grid-template-rows: auto 1fr auto; /* Header, Content, Footer */
  grid-template-areas:
    "header header"
    "sidebar main"
    "footer footer";
  gap: 20px;
}

.header {
  grid-area: header;
}

.sidebar {
  grid-area: sidebar;
}

.main {
  grid-area: main;
}

.footer {
  grid-area: footer;
}

@media (max-width: 768px) {
  .main-container {
    grid-template-columns: 1fr; /* Stacks content vertically */
    grid-template-areas:
      "header"
      "main"
      "sidebar"
      "footer";
  }
}

/* Table Layout */
.table-container {
  display: grid;
  grid-template-columns: repeat(4, 1fr); /* Four columns for different data points */
  gap: 10px;
}

.table-item {
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 10px;
  border: 1px solid var(--border-color);
}

/* Calculator and Widgets Layout */
.calculator {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 15px;
}

.calculator-buttons {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

/* Cards Layout for Events and Education */
.cards-container {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); /* Adaptive cards */
  gap: 20px;
}

.card {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 20px;
  background-color: var(--background-light);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.card:hover {
  transform: translateY(-5px);
  box-shadow: 0 8px 16px rgba(0, 0, 0, 0.2);
}

@media (max-width: 768px) {
  .card:hover {
    transform: none;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
  }
}
