/* Universal Header Styles */
.universal-header {
  position: sticky;
  top: 0;
  z-index: 1000;
  background: linear-gradient(135deg, #2c3e50 0%, #34495e 100%);
  color: white;
  padding: 15px 20px;
  box-shadow: 0 2px 10px rgba(0,0,0,0.15);
  border-bottom: 3px solid #667eea;
}

.header-content {
  max-width: 1400px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 15px;
}

.header-branding {
  display: flex;
  align-items: center;
  gap: 15px;
}

.header-branding h1 {
  font-size: 22px;
  margin: 0;
  font-weight: 600;
}

.header-branding .subtitle {
  font-size: 14px;
  opacity: 0.8;
  margin: 0;
}

.header-nav {
  display: flex;
  gap: 20px;
  flex-wrap: wrap;
  align-items: center;
}

/* Navigation links section */
.nav-links {
  display: flex;
  gap: 25px;
  align-items: center;
}

.nav-link {
  color: white;
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
  padding: 8px 12px;
  border-radius: 6px;
  transition: all 0.3s ease;
  position: relative;
}

.nav-link:hover {
  color: #67d8f7;
  background: rgba(255, 255, 255, 0.1);
  transform: translateY(-1px);
}

.nav-link:active {
  transform: translateY(0);
}

/* Active link indication (optional for future use) */
.nav-link.active {
  color: #67d8f7;
  background: rgba(255, 255, 255, 0.15);
}

/* Action buttons section */
.nav-actions {
  display: flex;
  gap: 10px;
  align-items: center;
  margin-left: 20px;
  padding-left: 20px;
  border-left: 1px solid rgba(255, 255, 255, 0.2);
}

.header-btn {
  padding: 8px 14px;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
  transition: all 0.3s ease;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
}

.header-btn-primary {
  background: #007bff;
  color: white;
}

.header-btn-primary:hover {
  background: #0056b3;
  transform: translateY(-1px);
}

.header-btn-secondary {
  background: #6c757d;
  color: white;
}

.header-btn-secondary:hover {
  background: #545b62;
  transform: translateY(-1px);
}

.header-btn-info {
  background: #17a2b8;
  color: white;
}

.header-btn-info:hover {
  background: #117a8b;
  transform: translateY(-1px);
}

.header-btn-success {
  background: #28a745;
  color: white;
}

.header-btn-success:hover {
  background: #1e7e34;
  transform: translateY(-1px);
}

.header-btn-danger {
  background: #dc3545;
  color: white;
}

.header-btn-danger:hover {
  background: #c82333;
  transform: translateY(-1px);
}

.header-btn-warning {
  background: #ffc107;
  color: #212529;
}

.header-btn-warning:hover {
  background: #e0a800;
  transform: translateY(-1px);
}

.header-btn-profile {
  background: #6f42c1;
  color: white;
}

.header-btn-profile:hover {
  background: #5a32a3;
  transform: translateY(-1px);
}

.header-btn-install {
  background: #27ae60;
  color: white;
  font-weight: 600;
  box-shadow: 0 2px 4px rgba(0,0,0,0.2);
  transition: all 0.3s ease;
}

.header-btn-install:hover {
  background: #219a52;
  transform: translateY(-1px);
  box-shadow: 0 4px 8px rgba(0,0,0,0.3);
}

.header-btn-install:active {
  transform: translateY(0);
}

/* Profile Dropdown Styles */
.profile-dropdown {
  position: relative;
  display: inline-block;
}

.profile-btn {
  background: #6f42c1;
  color: white;
  border: none;
  padding: 8px 14px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 13px;
  font-weight: 600;
  transition: all 0.3s ease;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.profile-btn:hover {
  background: #5a32a3;
  transform: translateY(-1px);
}

.profile-arrow {
  transition: transform 0.3s ease;
  font-size: 12px;
}

.profile-dropdown.show .profile-arrow {
  transform: rotate(180deg);
}

.profile-dropdown-content {
  display: none;
  position: absolute;
  right: 0;
  background-color: white;
  min-width: 220px;
  box-shadow: 0 8px 16px rgba(0,0,0,0.2);
  border-radius: 8px;
  z-index: 1001;
  border: 1px solid #ddd;
  overflow: hidden;
  top: 100%;
  margin-top: 5px;
}

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

.profile-info {
  padding: 15px;
  background: #f8f9fa;
  color: #495057;
  font-size: 13px;
  line-height: 1.4;
}

.profile-email {
  color: #007bff;
  font-weight: 600;
  word-break: break-all;
}

.profile-divider {
  margin: 0;
  border: none;
  border-top: 1px solid #dee2e6;
}

.profile-dropdown-item {
  display: block;
  padding: 12px 15px;
  color: #495057;
  text-decoration: none;
  transition: background-color 0.2s ease;
  font-size: 14px;
}

.profile-dropdown-item:hover {
  background-color: #f8f9fa;
  color: #007bff;
}

.profile-dropdown-item.logout-item {
  color: #dc3545;
  border-top: 1px solid #dee2e6;
}

.profile-dropdown-item.logout-item:hover {
  background-color: #f8f9fa;
  color: #c82333;
}

.logout-item {
  color: #dc3545 !important;
}

.logout-item:hover {
  background-color: #f8f9fa !important;
  color: #c82333 !important;
}

/* Mobile responsive - Optimized for compact header */
/* Use hamburger menu for all mobile devices (portrait and landscape) */
@media (max-width: 1024px) {
  .universal-header {
    padding: 8px 10px;
  }
  
  .header-content {
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
    position: relative;
  }
  
  /* Hamburger Menu Button */
  .hamburger-menu {
    display: flex;
    flex-direction: column;
    justify-content: space-around;
    width: 30px;
    height: 30px;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 5px;
    z-index: 1002;
    transition: all 0.3s ease;
  }
  
  .hamburger-line {
    width: 100%;
    height: 3px;
    background: white;
    border-radius: 2px;
    transition: all 0.3s ease;
  }
  
  .hamburger-menu.active .hamburger-line:nth-child(1) {
    transform: translateY(8px) rotate(45deg);
  }
  
  .hamburger-menu.active .hamburger-line:nth-child(2) {
    opacity: 0;
  }
  
  .hamburger-menu.active .hamburger-line:nth-child(3) {
    transform: translateY(-8px) rotate(-45deg);
  }
  
  /* Mobile Navigation */
  .header-nav {
    position: fixed;
    top: 0;
    right: -100%;
    height: 100vh;
    width: 80%;
    max-width: 300px;
    background: linear-gradient(135deg, #2c3e50 0%, #34495e 100%);
    flex-direction: column;
    padding: 80px 20px 20px 20px;
    gap: 0;
    transition: right 0.3s ease;
    box-shadow: -5px 0 15px rgba(0,0,0,0.3);
    z-index: 1001;
    overflow-y: auto;
  }
  
  .header-nav.mobile-menu-open {
    right: 0;
  }
  
  .nav-links {
    display: flex;
    flex-direction: column;
    gap: 0;
    width: 100%;
    margin-bottom: 20px;
    padding-bottom: 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
  }
  
  .nav-link {
    display: flex !important;
    width: 100%;
    padding: 15px 10px;
    text-align: left;
    border-radius: 6px;
    font-size: 16px;
  }
  
  .nav-link:hover {
    background: rgba(255, 255, 255, 0.15);
  }
  
  .nav-actions {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-left: 0;
    padding-left: 0;
    border-left: none;
    width: 100%;
  }
  
  .header-btn {
    font-size: 14px;
    padding: 12px 10px;
    width: 100%;
    justify-content: center;
    white-space: normal;
  }
  
  .profile-dropdown {
    position: relative;
  }
  
  .profile-btn {
    font-size: 12px;
    padding: 5px 10px;
  }
  
  .profile-dropdown-content {
    right: 0;
    left: auto;
    min-width: 180px;
  }
  
  /* Overlay for mobile menu */
  .header-nav.mobile-menu-open::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: -1;
  }
}

/* Hide hamburger menu on desktop */
@media (min-width: 1025px) {
  .hamburger-menu {
    display: none;
  }
}

/* Ensure page content accounts for sticky header */
body.has-universal-header {
  padding-top: 0;
}

.page-content {
  margin-top: 0;
}

/* Helper classes */
.header-btn-hidden {
  display: none !important;
}

.header-btn-visible {
  display: inline-flex !important;
}

.nav-link-hidden {
  display: none !important;
}

.nav-link-visible {
  display: inline-flex !important;
}

.nav-btn-hidden {
  display: none !important;
}

.nav-btn-visible {
  display: inline-flex !important;
}
