/* ===== MODERN PROFESSIONAL HEADER ===== */

/* Header Container */
.modern-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--header-height);
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.98) 0%, rgba(248, 250, 252, 0.95) 100%);
  backdrop-filter: blur(25px);
  border-bottom: 1px solid rgba(102, 126, 234, 0.1);
  box-shadow: 
    0 4px 32px rgba(0, 0, 0, 0.08),
    0 2px 16px rgba(102, 126, 234, 0.05),
    inset 0 1px 0 rgba(255, 255, 255, 0.8);
  z-index: 1000;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.header-container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 100%;
  max-width: 100%;
  margin: 0 auto;
  padding: 0 1.5rem;
  gap: 1rem;
}

/* ===== LEFT SECTION ===== */
.header-left {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex: 1;
  min-width: 0;
}

/* Mobile Menu Button */
.mobile-menu-btn {
  display: none;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  width: 44px;
  height: 44px;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  border: none;
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 4px 16px rgba(102, 126, 234, 0.3);
  position: relative;
  overflow: hidden;
}

.mobile-menu-btn::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.2) 0%, transparent 50%);
  opacity: 0;
  transition: opacity 0.3s ease;
}

.mobile-menu-btn:hover::before {
  opacity: 1;
}

.mobile-menu-btn:hover {
  transform: translateY(-2px) scale(1.05);
  box-shadow: 0 8px 25px rgba(102, 126, 234, 0.4);
}

.hamburger-line {
  width: 20px;
  height: 2px;
  background: white;
  border-radius: 2px;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  margin: 2px 0;
}

.mobile-menu-btn.active .hamburger-line:nth-child(1) {
  transform: rotate(45deg) translate(5px, 5px);
}

.mobile-menu-btn.active .hamburger-line:nth-child(2) {
  opacity: 0;
}

.mobile-menu-btn.active .hamburger-line:nth-child(3) {
  transform: rotate(-45deg) translate(7px, -6px);
}

/* Logo Container */
.logo-container {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex: 1;
  min-width: 0;
}

.logo-icon {
  width: 48px;
  height: 48px;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 
    0 8px 24px rgba(102, 126, 234, 0.25),
    0 4px 12px rgba(118, 75, 162, 0.15);
  position: relative;
  overflow: hidden;
  flex-shrink: 0;
}

.logo-icon::before {
  content: '';
  position: absolute;
  top: -50%;
  right: -50%;
  width: 100%;
  height: 100%;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.3) 0%, transparent 70%);
  transform: rotate(45deg);
}

.logo-icon i {
  font-size: 20px !important;
  color: white;
  z-index: 2;
  position: relative;
}

.logo-text {
  flex: 1;
  min-width: 0;
}

.logo-title {
  font-size: 18px !important;
  font-weight: 700;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin: 0;
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.logo-subtitle {
  font-size: 12px !important;
  color: #64748b;
  font-weight: 500;
  display: block;
  margin-top: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ===== CENTER SECTION ===== */
.header-center {
  display: flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
}

.quick-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background: rgba(255, 255, 255, 0.8);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(102, 126, 234, 0.1);
  border-radius: 16px;
  padding: 8px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.05);
}

.quick-action-btn {

  align-items: center;
  gap: 0.5rem;
  padding: 8px 12px;
  background: transparent;
  border: none;
  border-radius: 10px;
  color: #475569;
  font-size: 13px !important;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;
}

.quick-action-btn::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  opacity: 0;
  transition: opacity 0.3s ease;
  border-radius: 10px;
}

.quick-action-btn:hover::before {
  opacity: 0.1;
}

.quick-action-btn:hover {
  color: #667eea;
  transform: translateY(-1px);
}

.quick-action-btn i {
  font-size: 14px !important;
  z-index: 2;
  position: relative;
}

.quick-action-btn span {
  z-index: 2;
  position: relative;
}

/* ===== RIGHT SECTION ===== */
.header-right {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-shrink: 0;
}

/* System Status */
.system-status {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 6px 12px;
  background: rgba(34, 197, 94, 0.1);
  border: 1px solid rgba(34, 197, 94, 0.2);
  border-radius: 20px;
  backdrop-filter: blur(10px);
}

.status-indicator {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  position: relative;
}

.status-indicator.online {
  background: #22c55e;
  box-shadow: 0 0 0 2px rgba(34, 197, 94, 0.3);
  animation: pulse-green 2s infinite;
}

@keyframes pulse-green {
  0%, 100% { box-shadow: 0 0 0 2px rgba(34, 197, 94, 0.3); }
  50% { box-shadow: 0 0 0 4px rgba(34, 197, 94, 0.1); }
}

.status-text {
  font-size: 12px !important;
  color: #22c55e;
  font-weight: 600;
}

/* Notification Group */
.notification-group {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.notification-btn {
  position: relative;
  width: 44px;
  height: 44px;
  border: none;
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.bell-btn {
  background: linear-gradient(135deg, #f59e0b 0%, #f97316 100%);
  box-shadow: 0 4px 16px rgba(245, 158, 11, 0.3);
}

.message-btn {
  background: linear-gradient(135deg, #10b981 0%, #059669 100%);
  box-shadow: 0 4px 16px rgba(16, 185, 129, 0.3);
}

.notification-btn::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.2) 0%, transparent 50%);
  opacity: 0;
  transition: opacity 0.3s ease;
}

.notification-btn:hover::before {
  opacity: 1;
}

.notification-btn:hover {
  transform: translateY(-2px) scale(1.05);
}

.bell-btn:hover {
  box-shadow: 0 8px 25px rgba(245, 158, 11, 0.4);
}

.message-btn:hover {
  box-shadow: 0 8px 25px rgba(16, 185, 129, 0.4);
}

.notification-btn i {
  font-size: 16px !important;
  color: white;
  z-index: 2;
  position: relative;
}

.notification-count {
  position: absolute;
  top: -6px;
  right: -6px;
  background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
  color: white;
  font-size: 10px !important;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 10px;
  min-width: 18px;
  height: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid white;
  box-shadow: 0 2px 8px rgba(239, 68, 68, 0.4);
  z-index: 3;
}

.notification-pulse {
  position: absolute;
  top: -6px;
  right: -6px;
  width: 18px;
  height: 18px;
  border: 2px solid #ef4444;
  border-radius: 50%;
  animation: notification-pulse 2s infinite;
  z-index: 1;
}

@keyframes notification-pulse {
  0% { transform: scale(1); opacity: 1; }
  100% { transform: scale(1.5); opacity: 0; }
}

/* User Profile Container */
.user-profile-container {
  position: relative;
}

.user-profile-btn {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 6px 12px 6px 6px;
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid rgba(102, 126, 234, 0.1);
  border-radius: 16px;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  backdrop-filter: blur(10px);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.05);
}

.user-profile-btn:hover {
  background: rgba(255, 255, 255, 1);
  border-color: rgba(102, 126, 234, 0.2);
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
  transform: translateY(-1px);
}

.user-avatar {
  position: relative;
  width: 36px;
  height: 36px;
  flex-shrink: 0;
}

.avatar-img {
  width: 100%;
  height: 100%;
  border-radius: 10px;
  object-fit: cover;
  border: 2px solid rgba(102, 126, 234, 0.2);
}

.online-indicator {
  position: absolute;
  bottom: -2px;
  right: -2px;
  width: 12px;
  height: 12px;
  background: #22c55e;
  border: 2px solid white;
  border-radius: 50%;
  box-shadow: 0 0 0 1px rgba(34, 197, 94, 0.3);
}

.user-info {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  min-width: 0;
}

.user-name {
  font-size: 14px !important;
  font-weight: 600;
  color: #1e293b;
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 120px;
}

.user-role {
  font-size: 11px !important;
  color: #64748b;
  font-weight: 500;
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 120px;
}

.dropdown-arrow {
  font-size: 12px !important;
  color: #64748b;
  transition: transform 0.3s ease;
}

.user-profile-btn.active .dropdown-arrow {
  transform: rotate(180deg);
}

/* User Dropdown */
.user-dropdown {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  width: 280px;
  background: rgba(255, 255, 255, 0.98);
  backdrop-filter: blur(25px);
  border: 1px solid rgba(102, 126, 234, 0.1);
  border-radius: 16px;
  box-shadow: 
    0 20px 40px rgba(0, 0, 0, 0.15),
    0 8px 24px rgba(102, 126, 234, 0.1);
  opacity: 0;
  visibility: hidden;
  transform: translateY(-10px) scale(0.95);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  z-index: 1001;
}

.user-dropdown.active {
  opacity: 1;
  visibility: visible;
  transform: translateY(0) scale(1);
}

.dropdown-header {
  padding: 20px;
  display: flex;
  align-items: center;
  gap: 12px;
  background: linear-gradient(135deg, rgba(102, 126, 234, 0.05) 0%, rgba(118, 75, 162, 0.05) 100%);
  border-radius: 16px 16px 0 0;
}

.user-avatar-large {
  width: 50px;
  height: 50px;
  flex-shrink: 0;
}

.user-avatar-large img {
  width: 100%;
  height: 100%;
  border-radius: 12px;
  object-fit: cover;
  border: 2px solid rgba(102, 126, 234, 0.2);
}

.user-details h4 {
  font-size: 16px !important;
  font-weight: 700;
  color: #1e293b;
  margin: 0 0 4px 0;
  line-height: 1.2;
}

.user-details p {
  font-size: 13px !important;
  color: #64748b;
  margin: 0 0 8px 0;
  line-height: 1.2;
}

.user-badge {
  display: inline-block;
  padding: 4px 8px;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  font-size: 10px !important;
  font-weight: 600;
  border-radius: 6px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.dropdown-divider {
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(102, 126, 234, 0.1), transparent);
  margin: 0 20px;
}

.dropdown-menu {
  padding: 12px 0;
}

.dropdown-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 20px;
  color: #475569;
  text-decoration: none;
  font-size: 14px !important;
  font-weight: 500;
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
}

.dropdown-item::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(135deg, rgba(102, 126, 234, 0.05) 0%, rgba(118, 75, 162, 0.05) 100%);
  opacity: 0;
  transition: opacity 0.3s ease;
}

.dropdown-item:hover::before {
  opacity: 1;
}

.dropdown-item:hover {
  color: #667eea;
}

.dropdown-item i {
  font-size: 16px !important;
  width: 20px;
  text-align: center;
  z-index: 2;
  position: relative;
}

.dropdown-item span {
  z-index: 2;
  position: relative;
}

.item-badge {
  margin-left: auto;
  background: #ef4444;
  color: white;
  font-size: 10px !important;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 8px;
  min-width: 16px;
  height: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2;
  position: relative;
}

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

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

.logout-item::before {
  background: rgba(239, 68, 68, 0.05) !important;
}

/* ===== RESPONSIVE DESIGN ===== */

/* Large Desktop */
@media (min-width: 1440px) {
  .header-container {
    padding: 0 2rem;
  }
  
  .logo-title {
    font-size: 20px !important;
  }
  
  .logo-subtitle {
    font-size: 13px !important;
  }
}

/* Desktop */
@media (min-width: 1024px) {
  .mobile-menu-btn {
    display: none;
  }
  
  .header-center {
    display: flex;
  }
  
  .system-status {
    display: flex;
  }
}

/* Tablet */
@media (max-width: 1023px) {
  .header-center {
    display: none;
  }
  
  .system-status {
    display: none;
  }
  
  .mobile-menu-btn {
    display: flex;
  }
  
  .header-container {
    padding: 0 1rem;
  }
  
  .user-dropdown {
    width: 260px;
  }
}

/* Mobile Large */
@media (max-width: 768px) {
  :root {
    --header-height: 70px;
  }
  
  .modern-header {
    height: 70px;
  }
  
  .header-container {
    padding: 0 0.75rem;
    gap: 0.75rem;
  }
  
  .logo-icon {
    width: 40px;
    height: 40px;
  }
  
  .logo-icon i {
    font-size: 18px !important;
  }
  
  .logo-title {
    font-size: 16px !important;
  }
  
  .logo-subtitle {
    font-size: 11px !important;
  }
  
  .notification-btn {
    width: 40px;
    height: 40px;
  }
  
  .notification-btn i {
    font-size: 14px !important;
  }
  
  .user-info {
    display: none;
  }
  
  .dropdown-arrow {
    display: none;
  }
  
  .user-profile-btn {
    padding: 6px;
    border-radius: 12px;
  }
  
  .user-avatar {
    width: 32px;
    height: 32px;
  }
  
  .user-dropdown {
    width: 240px;
    right: -10px;
  }
}

/* Mobile Small */
@media (max-width: 480px) {
  :root {
    --header-height: 65px;
  }
  
  .modern-header {
    height: 65px;
  }
  
  .header-container {
    padding: 0 0.5rem;
    gap: 0.5rem;
  }
  
  .logo-title {
    font-size: 14px !important;
  }
  
  .logo-subtitle {
    display: none;
  }
  
  .notification-group {
    gap: 0.25rem;
  }
  
  .notification-btn {
    width: 36px;
    height: 36px;
  }
  
  .notification-btn i {
    font-size: 13px !important;
  }
  
  .notification-count {
    font-size: 9px !important;
    min-width: 16px;
    height: 16px;
    top: -4px;
    right: -4px;
  }
  
  .user-avatar {
    width: 28px;
    height: 28px;
  }
  
  .online-indicator {
    width: 10px;
    height: 10px;
  }
  
  .user-dropdown {
    width: calc(100vw - 20px);
    right: -5px;
  }
  
  .dropdown-header {
    padding: 16px;
  }
  
  .dropdown-item {
    padding: 10px 16px;
  }
}

/* Extra Small Mobile */
@media (max-width: 360px) {
  .header-container {
    padding: 0 0.25rem;
  }
  
  .logo-container {
    gap: 0.5rem;
  }
  
  .logo-icon {
    width: 36px;
    height: 36px;
  }
  
  .logo-icon i {
    font-size: 16px !important;
  }
  
  .logo-title {
    font-size: 13px !important;
  }
  
  .notification-btn {
    width: 32px;
    height: 32px;
  }
  
  .user-avatar {
    width: 26px;
    height: 26px;
  }
}

/* Header Animation on Scroll */
.modern-header.scrolled {
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.99) 0%, rgba(248, 250, 252, 0.98) 100%);
  box-shadow: 
    0 8px 40px rgba(0, 0, 0, 0.12),
    0 4px 20px rgba(102, 126, 234, 0.08),
    inset 0 1px 0 rgba(255, 255, 255, 0.9);
}

/* Accessibility */
@media (prefers-reduced-motion: reduce) {
  .modern-header,
  .mobile-menu-btn,
  .notification-btn,
  .user-profile-btn,
  .dropdown-item,
  .quick-action-btn {
    transition: none;
  }
  
  .status-indicator.online,
  .notification-pulse {
    animation: none;
  }
}

/* High Contrast Mode */
@media (prefers-contrast: high) {
  .modern-header {
    border-bottom: 2px solid #000;
  }
  
  .logo-icon,
  .mobile-menu-btn,
  .notification-btn {
    border: 2px solid #000;
  }
}

/* Print Styles */
@media print {
  .modern-header {
    display: none;
  }
}