/* 
 * Unified Navbar CSS
 * This file contains all styles for the navbar component used across the site.
 * Use this file in conjunction with navbar-dropdown.html and load-navbar.js
 */

:root {
  /* Color system from the main theme */
  --dl-color-theme-primary1: #8e44ad;       /* Deep purple - primary brand color */
  --dl-color-theme-primary2: #9b59b6;       /* Lighter purple - hover/active color */
  --dl-color-theme-secondary1: #FFFFFF;     /* White for text on dark backgrounds */
  --dl-color-theme-secondary2: #f8f4fc;     /* Very light purple for backgrounds */
  --dl-color-theme-accent1: #e74c3c;        /* Red for accent/call to action */ 
  --dl-color-theme-accent2: #f39c12;        /* Gold/yellow for secondary accents */
  --dl-color-theme-neutral-dark: #2c3e50;   /* Dark blue-gray for text */
  --dl-color-theme-neutral-light: #f9f9fb;  /* Off-white for backgrounds */
  
  /* Size variables */
  --dl-size-size-maxwidth: 1400px;
  --dl-size-size-xsmall: 16px;
  --dl-size-size-small: 48px;
  
  /* Spacing variables */
  --dl-space-space-unit: 16px;
  --dl-space-space-halfunit: 8px;
  --dl-space-space-twounits: 32px;
  --dl-space-space-threeunits: 48px;
  --dl-space-space-oneandhalfunits: 24px;
}

/* Container holding the navbar */
.navbar-container {
  top: 0;
  width: 100%;
  display: flex;
  z-index: 1000;
  position: sticky;
  justify-content: center;
  background-color: var(--dl-color-theme-neutral-light);
}

/* Interactive navbar main element */
.navbar-interactive {
  width: 100%;
  display: flex;
  z-index: 100;
  max-width: var(--dl-size-size-maxwidth);
  align-items: center;
  padding-top: var(--dl-space-space-halfunit);
  padding-left: var(--dl-space-space-threeunits);
  padding-right: var(--dl-space-space-threeunits);
  padding-bottom: var(--dl-space-space-halfunit);
  justify-content: space-between;
}

/* Logo styling */
.navbar-logo-link {
  display: flex;
  text-decoration: none;
}

.navbar-logo {
  width: 60px;
  height: 60px;
  object-fit: contain;
  margin: 5px 0;
}

/* Desktop menu */
.navbar-desktop-menu {
  flex: 1;
  display: flex;
  justify-content: space-between;
}

.navbar-links {
  gap: var(--dl-space-space-twounits);
  flex: 1;
  display: flex;
  align-items: center;
  margin-left: var(--dl-space-space-twounits);
  flex-direction: row;
  justify-content: flex-start;
}

.navbar-link {
  color: var(--dl-color-theme-neutral-dark);
  text-decoration: none;
}

.navbar-link[aria-current="page"] {
  font-weight: bold;
}

/* Dropdown styles */
.navbar-dropdown {
  position: relative;
  display: inline-block;
}

.navbar-dropdown-button {
  display: flex;
  align-items: center;
  gap: 5px;
  border: none;
  background: none;
  cursor: pointer;
  padding: 0;
  font-family: Inter, sans-serif;
  color: var(--dl-color-theme-neutral-dark);
}

.navbar-dropdown-icon {
  width: 16px;
  height: 16px;
  transition: transform 0.3s ease;
}

.navbar-dropdown-button[aria-expanded="true"] .navbar-dropdown-icon {
  transform: rotate(180deg);
}

.navbar-dropdown-content {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  min-width: 180px;
  z-index: 1000;
  background-color: var(--dl-color-theme-neutral-light);
  box-shadow: 0px 8px 16px 0px rgba(0,0,0,0.1);
  border-radius: 4px;
  padding: var(--dl-space-space-halfunit) 0;
  animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.navbar-dropdown-content.show {
  display: block;
}

.navbar-dropdown-link {
  color: var(--dl-color-theme-neutral-dark);
  padding: var(--dl-space-space-halfunit) var(--dl-space-space-unit);
  text-decoration: none;
  display: block;
  transition: background-color 0.3s;
}

.navbar-dropdown-link:hover {
  background-color: rgba(0, 0, 0, 0.05);
}

.navbar-dropdown-link[aria-current="page"] {
  font-weight: bold;
}

/* Action buttons */
.navbar-buttons {
  gap: var(--dl-space-space-unit);
  display: flex;
  align-items: center;
  flex-direction: row;
  justify-content: flex-end;
}

.navbar-action-button {
  color: var(--dl-color-theme-secondary1);
  cursor: pointer;
  display: flex;
  transition: all 0.3s ease;
  align-items: center;
  font-weight: 600;
  padding-top: var(--dl-space-space-halfunit);
  white-space: nowrap;
  padding-left: var(--dl-space-space-oneandhalfunits);
  border-radius: 8px;
  padding-right: var(--dl-space-space-oneandhalfunits);
  padding-bottom: var(--dl-space-space-halfunit);
  justify-content: center;
  background-color: var(--dl-color-theme-primary1);
  text-decoration: none;
}

.navbar-action-button:hover {
  background-color: var(--dl-color-theme-primary2);
  transform: translateY(-2px);
}

/* Mobile menu styles */
.burger-menu {
  display: none;
  cursor: pointer;
}

.burger-icon {
  width: var(--dl-size-size-xsmall);
  height: var(--dl-size-size-xsmall);
}

.mobile-menu {
  top: 0px;
  right: 0px; /* Changed from left to right */
  width: 80%; /* Reduced width for better slide-in effect */
  max-width: 300px; /* Maximum width for larger screens */
  height: 100vh;
  display: none;
  padding: var(--dl-space-space-twounits);
  z-index: 1001;
  position: fixed;
  flex-direction: column;
  justify-content: space-between;
  background-color: var(--dl-color-theme-neutral-light);
  box-shadow: -5px 0 15px rgba(0, 0, 0, 0.1); /* Add shadow on left side */
}

.mobile-menu-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.5);
  z-index: 1000;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.mobile-menu-overlay.active {
  display: block;
  opacity: 1;
}

.mobile-menu.active {
  display: flex;
  animation: slideInRight 0.3s ease-out;
}

@keyframes slideInRight {
  from {
    transform: translateX(100%); /* Changed to slide from right */
  }
  to {
    transform: translateX(0);
  }
}

.mobile-menu-nav {
  display: flex;
  align-items: flex-start;
  flex-direction: column;
}

.mobile-menu-top {
  width: 100%;
  display: flex;
  align-items: center;
  margin-bottom: var(--dl-space-space-threeunits);
  justify-content: space-between;
}

.mobile-menu-logo {
  height: 50px;
  width: 50px;
  object-fit: contain;
}

.mobile-menu-close {
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.mobile-menu-close-icon {
  width: var(--dl-size-size-xsmall);
  height: var(--dl-size-size-xsmall);
}

.mobile-menu-links {
  gap: var(--dl-space-space-unit);
  width: 100%;
  display: flex;
  align-self: flex-start;
  flex-direction: column;
}

.mobile-menu-link {
  color: var(--dl-color-theme-neutral-dark);
  padding: var(--dl-space-space-halfunit) 0;
  text-decoration: none;
}

.mobile-menu-link[aria-current="page"] {
  font-weight: bold;
}

/* Mobile dropdown styles */
.mobile-menu-dropdown {
  width: 100%;
}

.mobile-menu-dropdown-button {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--dl-space-space-halfunit) 0;
  background: none;
  border: none;
  cursor: pointer;
  font-family: Inter, sans-serif;
  color: var(--dl-color-theme-neutral-dark);
  text-align: left;
}

.mobile-menu-dropdown-icon {
  width: 16px;
  height: 16px;
  transition: transform 0.3s ease;
}

.mobile-menu-dropdown-button.active .mobile-menu-dropdown-icon {
  transform: rotate(180deg);
}

.mobile-menu-dropdown-content {
  display: none;
  padding-left: var(--dl-space-space-unit);
}

.mobile-menu-dropdown-content.show {
  display: block;
  animation: slideDown 0.3s ease;
}

@keyframes slideDown {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.mobile-menu-dropdown-link {
  display: block;
  padding: var(--dl-space-space-halfunit) 0;
  color: var(--dl-color-theme-neutral-dark);
  text-decoration: none;
}

.mobile-menu-dropdown-link[aria-current="page"] {
  font-weight: bold;
}

.mobile-menu-buttons {
  gap: var(--dl-space-space-unit);
  display: flex;
  margin-top: var(--dl-space-space-twounits);
  flex-direction: column;
}

.mobile-menu-button {
  padding: var(--dl-space-space-halfunit) var(--dl-space-space-unit);
  border-radius: 4px;
  text-decoration: none;
  text-align: center;
}

.mobile-menu-button.primary {
  background-color: var(--dl-color-theme-primary1);
  color: white;
}

/* Responsive styles */
@media(max-width: 767px) {
  .navbar-interactive {
    padding-left: var(--dl-space-space-twounits);
    padding-right: var(--dl-space-space-twounits);
  }
}

@media(max-width: 479px) {
  .navbar-interactive {
    padding: var(--dl-space-space-unit);
  }
  
  .navbar-desktop-menu {
    display: none;
  }
  
  .burger-menu {
    display: flex;
  }
  
  .mobile-menu {
    padding: var(--dl-space-space-unit);
  }
}