/*
 * Common Header for ScienceSpark Maharashtra
 * Features:
 * - Fixed height of 65px
 * - Background image
 * - Magic menu icon for mobile view
 * - Responsive design
 * - Dynamic menu sizing
 */

/* Common Header */
.common-header {
  height: 65px;
  width: 100%;
  position: fixed;
  top: 0;
  left: 0;
  z-index: 1000;
  background-image: url('../images/header-background.webp');
  background-size: cover;
  background-position: center;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 20px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

/* Logo styling */
.header-logo {
  color: white;
  font-weight: 700;
  font-size: 1.8rem;
  text-shadow: 1px 1px 3px rgba(0, 0, 0, 0.5);
  margin: 0;
  padding: 0;
  display: flex;
  align-items: center;
  height: 100%;
}

.header-logo a {
  color: white;
  text-decoration: none;
  transition: all 0.3s ease;
}

.header-logo a:hover {
  opacity: 0.9;
}

/* Magic Menu Icon */
.magic-menu-icon {
  display: none;
  cursor: pointer;
  width: 30px;
  height: 25px;
  position: relative;
  margin-left: auto;
  z-index: 1001;
}

.magic-menu-icon span {
  display: block;
  position: absolute;
  height: 3px;
  width: 100%;
  background: white;
  border-radius: 3px;
  opacity: 1;
  left: 0;
  transform: rotate(0deg);
  transition: .25s ease-in-out;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}

.magic-menu-icon span:nth-child(1) {
  top: 0px;
}

.magic-menu-icon span:nth-child(2),
.magic-menu-icon span:nth-child(3) {
  top: 10px;
}

.magic-menu-icon span:nth-child(4) {
  top: 20px;
}

.magic-menu-icon.open span:nth-child(1) {
  top: 10px;
  width: 0%;
  left: 50%;
}

.magic-menu-icon.open span:nth-child(2) {
  transform: rotate(45deg);
}

.magic-menu-icon.open span:nth-child(3) {
  transform: rotate(-45deg);
}

.magic-menu-icon.open span:nth-child(4) {
  top: 10px;
  width: 0%;
  left: 50%;
}

/* Navigation Menu */
.header-nav {
  height: 100%;
  display: flex;
  align-items: center;
}

.nav-menu {
  display: flex;
  list-style: none;
  margin: 0;
  padding: 0;
  height: 100%;
}

.nav-menu li {
  height: 100%;
  display: flex;
  align-items: center;
}

.nav-menu li a {
  color: white;
  text-decoration: none;
  padding: 0 15px;
  font-weight: 500;
  font-size: 1rem;
  transition: all 0.3s ease;
  text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.3);
  height: 100%;
  display: flex;
  align-items: center;
}

.nav-menu li a:hover,
.nav-menu li a.active {
  background-color: rgba(255, 255, 255, 0.2);
}

/* Dropdown Menu */
.dropdown {
  position: relative;
}

.dropdown-toggle {
  display: flex;
  align-items: center;
}

.dropdown-toggle i {
  margin-left: 5px;
  transition: transform 0.3s ease;
}

.dropdown:hover .dropdown-toggle i {
  transform: rotate(180deg);
}

.dropdown-menu {
  position: absolute;
  top: 100%;
  left: 0;
  background-color: white;
  min-width: 200px;
  box-shadow: 0 8px 16px rgba(0, 0, 0, 0.1);
  border-radius: 4px;
  padding: 10px 0;
  display: none;
  z-index: 1001;
  overflow: hidden;
}

.dropdown:hover .dropdown-menu {
  display: block;
}

.dropdown-menu li {
  height: auto;
  width: 100%;
}

.dropdown-menu li a {
  color: #333;
  padding: 10px 15px;
  display: block;
  text-shadow: none;
  height: auto;
}

.dropdown-menu li a:hover {
  background-color: #f5f5f5;
  color: #333;
}

.dropdown-header {
  display: flex;
  justify-content: space-between;
  padding: 10px 15px;
  font-weight: 600;
  color: #666;
  border-bottom: 1px solid #eee;
}

/* Responsive Styles */
@media (max-width: 768px) {
  .magic-menu-icon {
    display: block;
  }
  
  .header-nav {
    position: fixed;
    top: 65px;
    right: -100%;
    width: auto;
    height: auto;
    background-color: white;
    flex-direction: column;
    box-shadow: -2px 2px 10px rgba(0, 0, 0, 0.1);
    transition: right 0.3s ease;
    align-items: flex-start;
    padding: 0;
    border-radius: 0 0 0 4px;
  }
  
  .header-nav.open {
    right: 0;
  }
  
  .nav-menu {
    flex-direction: column;
    width: 100%;
    height: auto;
  }
  
  .nav-menu li {
    width: 100%;
    height: auto;
  }
  
  .nav-menu li a {
    color: #333;
    padding: 15px;
    width: 100%;
    text-shadow: none;
    border-bottom: 1px solid #eee;
    justify-content: flex-start;
  }
  
  .dropdown-menu {
    position: static;
    box-shadow: none;
    display: none;
    width: 100%;
    padding: 0;
  }
  
  .dropdown.open .dropdown-menu {
    display: block;
  }
  
  .dropdown-toggle i {
    margin-left: auto;
  }
  
  .dropdown-menu li a {
    padding-left: 30px;
  }
}

/* Body padding to account for fixed header */
body {
  padding-top: 65px;
}
