/*==============================================================================
STATSCALAR ENTERPRISE - HEADER STYLES
Version: 2.0
Component: Main Header Navigation
Framework: Laravel Blade + Bootstrap
Author: Balagali
Description: Professional header styling with sticky navigation, responsive design,
and smooth interactions for enterprise platform.
==============================================================================*/

/*==============================================================================
01. HEADER CONTAINER - Sticky Navigation Wrapper
==============================================================================*/
.ss-header {
  position: sticky;
  top: 0;
  left: 0;
  width: 100%;
  z-index: 1050;
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid rgba(226, 232, 240, 0.75);
  transition:
    background 0.35s ease,
    box-shadow 0.35s ease,
    border-color 0.35s ease,
    padding 0.35s ease;
  will-change: background, box-shadow;
}

.ss-header.is-scrolled {
  background: rgba(255, 255, 255, 0.98);
  box-shadow: 0 12px 35px rgba(15, 23, 42, 0.08);
  border-bottom-color: rgba(226, 232, 240, 0.95);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
}

/*==============================================================================
02. NAVBAR - Navigation Bar Container
==============================================================================*/
.ss-navbar {
  min-height: 84px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 42px;
  transition: min-height 0.30s ease;
}

.ss-header.is-scrolled .ss-navbar {
  min-height: 74px;
}

/*==============================================================================
03. LOGO - Brand Logo Styling
==============================================================================*/
.ss-logo {
  display: flex;
  align-items: center;
  flex-shrink: 0;
  transition:
    transform 0.30s ease,
    opacity 0.30s ease;
  text-decoration: none;
}

.ss-logo:hover {
  transform: translateY(-2px);
}

.ss-logo img {
  width: 215px;
  height: auto;
  display: block;
  transition: transform 0.30s ease;
}

/* Text Logo */
.stat-logo {
  font-size: 32px;
  font-weight: 800;
  letter-spacing: 2px;
  color: var(--ss-heading);
  transition: var(--ss-transition);
  line-height: 1;
}

.stat-logo span {
  color: var(--ss-primary);
  font-weight: 900;
}

.ss-header.is-scrolled .stat-logo {
  transform: scale(0.97);
}

/*==============================================================================
04. NAVIGATION MENU - Desktop Navigation Links
==============================================================================*/
.ss-menu {
  flex: 1;
  display: flex;
  justify-content: center;
  margin: 0;
}

.ss-nav-list {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  list-style: none;
  margin: 0;
  padding: 0;
}

.ss-nav-list > li {
  position: relative;
  margin: 0;
  padding: 0;
}

/* Navigation Links */
.ss-nav-list > li > a {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  height: 48px;
  padding: 0 18px;
  font-size: 15px;
  font-weight: 600;
  color: var(--ss-heading);
  border-radius: 12px;
  transition: all 0.25s ease;
  text-decoration: none;
  overflow: hidden;
}

/* Link Hover State */
.ss-nav-list > li > a:hover {
  color: var(--ss-primary);
  background: var(--ss-primary-light);
}

/* Link Hover Animation */
.ss-nav-list > li > a::before {
  content: "";
  position: absolute;
  left: 50%;
  bottom: 6px;
  width: 0;
  height: 2px;
  background: var(--ss-primary);
  transition: all 0.30s ease;
  transform: translateX(-50%);
  border-radius: 30px;
}

.ss-nav-list > li > a:hover::before {
  width: 60%;
}

/* Active Link State */
.ss-nav-list > li.active > a {
  color: var(--ss-primary);
  background: var(--ss-primary-light);
}

.ss-nav-list > li.active > a::after {
  content: "";
  position: absolute;
  left: 18px;
  right: 18px;
  bottom: 8px;
  height: 3px;
  border-radius: 30px;
  background: var(--ss-primary);
}

/* Link Focus State */
.ss-nav-list a:focus-visible {
  outline: none;
  box-shadow: 0 0 0 4px rgba(0, 168, 107, 0.18);
  border-radius: 12px;
}

/*==============================================================================
05. ACTIONS - Right-side Action Buttons
==============================================================================*/
.ss-actions {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-shrink: 0;
  list-style: none;
  margin: 0;
  padding: 0;
}

.ss-actions .ss-btn {
  min-height: 48px;
  padding: 0 24px;
  font-size: 14px;
  font-weight: 600;
  transition:
    transform 0.25s ease,
    box-shadow 0.25s ease;
}

.ss-actions .ss-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 14px 28px rgba(15, 23, 42, 0.10);
}

.ss-actions .ss-btn:focus-visible {
  outline: none;
  box-shadow: 0 0 0 4px rgba(0, 168, 107, 0.18);
}

/*==============================================================================
06. ACCOUNT DROPDOWN - User Account Menu
==============================================================================*/
.ss-account {
  position: relative;
  margin: 0;
}

/* Account Button */
.ss-account-btn {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 48px;
  min-width: 180px;
  padding: 0 18px;
  background: #fff;
  border: 1px solid var(--ss-border);
  border-radius: 14px;
  font-weight: 600;
  color: var(--ss-heading);
  transition: var(--ss-transition);
  cursor: pointer;
  overflow: hidden;
  position: relative;
  gap: 10px;
}

/* Shimmer Effect */
.ss-account-btn::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(255, 255, 255, 0.45),
    transparent
  );
  transform: translateX(-120%);
  transition: transform 0.6s ease;
}

.ss-account-btn:hover::before {
  transform: translateX(120%);
}

/* Account Button Hover */
.ss-account-btn:hover {
  border-color: var(--ss-primary);
  color: var(--ss-primary);
  box-shadow: 0 8px 24px rgba(0, 168, 107, 0.10);
}

/* Account Icon */
.ss-account-btn i {
  font-size: 13px;
  transition: var(--ss-transition);
  position: relative;
  z-index: 1;
}

/* Account Icon (mobile-only avatar, hidden on desktop) */
.ss-account-icon {
  display: none;
  font-size: 20px !important;
}

.ss-account.open .ss-account-btn i {
  transform: rotate(180deg);
}

/* Account Button Focus */
.ss-account-btn:focus-visible {
  outline: none;
  box-shadow: 0 0 0 4px rgba(0, 168, 107, 0.18);
}

/*==============================================================================
07. DROPDOWN MENU - Account Dropdown
==============================================================================*/
.ss-dropdown {
  position: absolute;
  top: calc(100% + 14px);
  right: 0;
  width: 240px;
  background: #fff;
  border: 1px solid var(--ss-border);
  border-radius: 18px;
  box-shadow: 0 22px 60px rgba(15, 23, 42, 0.12);
  overflow: hidden;
  opacity: 0;
  visibility: hidden;
  transform: translateY(12px);
  transition: all 0.28s ease;
  z-index: 100;
  list-style: none;
  margin: 0;
  padding: 10px 0;
}

.ss-account.open .ss-dropdown {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
  animation: ssDropdown 0.25s ease;
}

@keyframes ssDropdown {
  from {
    opacity: 0;
    transform: translateY(14px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

/* Dropdown Items */
.ss-dropdown li {
  width: 100%;
  padding: 0 10px;
  list-style: none;
  margin: 0;
}

.ss-dropdown li + li {
  border-top: 1px solid var(--ss-border);
}

/* Dropdown Links */
.ss-dropdown a {
  display: flex;
  align-items: center;
  min-height: 48px;
  padding: 12px 20px;
  font-size: 15px;
  font-weight: 600;
  color: var(--ss-heading);
  text-decoration: none;
  border-radius: 12px;
  transition:
    background 0.25s ease,
    color 0.25s ease,
    transform 0.25s ease;
}

.ss-dropdown a:hover {
  background: var(--ss-primary-light);
  color: var(--ss-primary);
  transform: translateX(6px);
}

/* Dropdown Icons */
.ss-dropdown a i {
  width: 20px;
  margin-right: 12px;
  color: var(--ss-primary);
  font-size: 14px;
}

/*==============================================================================
08. MOBILE TOGGLE BUTTON - Mobile Menu Toggle
==============================================================================*/
.ss-mobile-toggle {
  display: none;
  width: 48px;
  height: 48px;
  border: 1px solid var(--ss-border);
  border-radius: 14px;
  background: #fff;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 5px;
  cursor: pointer;
  transition: all 0.30s ease;
  padding: 0;
  margin: 0;
}

.ss-mobile-toggle:hover {
  border-color: var(--ss-primary);
  background: var(--ss-primary-light);
}

.ss-mobile-toggle:focus-visible {
  outline: none;
  box-shadow: 0 0 0 4px rgba(0, 168, 107, 0.18);
}

/* Hamburger Lines */
.ss-mobile-toggle span {
  width: 20px;
  height: 2px;
  background: var(--ss-heading);
  border-radius: 20px;
  transition: 0.30s ease;
  display: block;
}

/*==============================================================================
09. MOBILE NAVIGATION - Mobile Menu
==============================================================================*/
.ss-mobile-nav {
  position: fixed;
  top: 0;
  right: -100%;
  width: 320px;
  max-width: 90vw;
  height: 100vh;
  overflow-y: auto;
  overflow-x: hidden;
  background: #fff;
  box-shadow: -18px 0 50px rgba(15, 23, 42, 0.12);
  transition: right 0.35s ease;
  z-index: 1100;
  padding: 96px 28px 40px;
  -webkit-overflow-scrolling: touch;
}

.ss-mobile-nav.open {
  right: 0;
}

.ss-mobile-nav[aria-hidden="true"] {
  visibility: hidden;
}

/* Mobile Menu List */
.ss-mobile-nav ul {
  display: flex;
  flex-direction: column;
  gap: 6px;
  list-style: none;
  margin: 0;
  padding: 0;
}

.ss-mobile-nav li {
  width: 100%;
  list-style: none;
  margin: 0;
  padding: 0;
}

/* Mobile Menu Links */
.ss-mobile-nav a {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 52px;
  padding: 0 18px;
  border-radius: 14px;
  font-size: 15px;
  font-weight: 600;
  color: var(--ss-heading);
  text-decoration: none;
  transition: 0.30s ease;
}

.ss-mobile-nav a:hover {
  background: var(--ss-primary-light);
  color: var(--ss-primary);
  transform: translateX(4px);
}

.ss-mobile-nav a:focus-visible {
  outline: none;
  box-shadow: 0 0 0 4px rgba(0, 168, 107, 0.18);
}

/* Arrow Icon for Mobile Links */
.ss-mobile-nav a::after {
  content: "›";
  opacity: 0.35;
  transition: 0.30s ease;
  font-size: 20px;
}

.ss-mobile-nav a:hover::after {
  opacity: 1;
  transform: translateX(3px);
}

/*==============================================================================
10. MOBILE MENU OVERLAY - Backdrop/Overlay
==============================================================================*/
.ss-mobile-nav::before {
  content: "";
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(15, 23, 42, 0.3);
  opacity: 0;
  visibility: hidden;
  transition: all 0.35s ease;
  z-index: -1;
}

.ss-mobile-nav.open::before {
  opacity: 1;
  visibility: visible;
}

/*==============================================================================
11. RESPONSIVE DESIGN - Media Queries
==============================================================================*/

/* Tablet - 1199px and below */
@media (max-width: 1199px) {
  .ss-navbar {
    gap: 24px;
  }
  
  .ss-nav-list {
    gap: 2px;
  }
  
  .ss-nav-list > li > a {
    padding: 0 14px;
  }
}

/* Tablet - 991px and below */
@media (max-width: 991px) {
  .ss-menu {
    display: none;
  }
  
  .ss-navbar {
    min-height: 72px;
  }
  
  .stat-logo {
    font-size: 28px;
  }
  
  .ss-actions .ss-btn-outline {
    display: none;
  }
  
  .ss-mobile-toggle {
    display: flex;
  }
}

/* Mobile - 576px and below */
@media (max-width: 576px) {
  .ss-header {
    padding: 0;
  }
  
  .ss-navbar {
    min-height: 64px;
    gap: 12px;
    padding: 0;
  }
  
  .stat-logo {
    font-size: 24px;
    letter-spacing: 0.5px;
  }
  
  .ss-mobile-nav {
    width: 100%;
    max-width: 100%;
    padding: 80px 20px 40px;
  }
  
  .ss-mobile-nav a {
    padding: 0 16px;
    min-height: 48px;
  }
  
  .ss-actions .ss-btn {
    padding: 0 16px;
    min-height: 42px;
    font-size: 13px;
  }

  /* Account button: collapse to an icon-only square so the long
     user name can't force the layout viewport wider than the screen */
  .ss-account-btn {
    min-width: 0;
    width: 48px;
    height: 48px;
    padding: 0;
    gap: 0;
    justify-content: center;
  }

  .ss-account-name,
  .ss-account-caret {
    display: none;
  }

  .ss-account-icon {
    display: inline-block;
  }
}

/*==============================================================================
12. ACCESSIBILITY & UTILITIES
==============================================================================*/

/* Reduced Motion */
@media (prefers-reduced-motion: reduce) {
  .ss-header,
  .ss-navbar,
  .ss-logo,
  .ss-nav-list a,
  .ss-account-btn,
  .ss-dropdown,
  .ss-mobile-nav {
    transition: none;
    animation: none;
  }
  
  .ss-logo:hover {
    transform: none;
  }
  
  .ss-account.open .ss-account-btn i {
    transform: none;
  }
  
  .ss-mobile-nav a:hover {
    transform: none;
  }
}

/* High Contrast Mode */
@media (prefers-contrast: more) {
  .ss-header {
    border-bottom-width: 2px;
  }
  
  .ss-nav-list > li > a,
  .ss-account-btn,
  .ss-mobile-toggle {
    border-width: 2px;
  }
}

/* Print Styles */
@media print {
  .ss-header,
  .ss-mobile-nav {
    display: none;
  }
}

/*==============================================================================
13. UTILITY CLASSES
==============================================================================*/

/* Smooth scrolling for entire page */
html {
  scroll-behavior: smooth;
}

/* Prevent body scroll when mobile menu is open */
body.mobile-nav-open {
  overflow: hidden;
}
