/* ══════════════════════════════════════════════════════════════
   HEADER
   ══════════════════════════════════════════════════════════════ */

.main-header {
  display: flex;
  align-items: center;
  gap: var(--sp-4);
  padding: 0 var(--sp-8);
  height: var(--header-height);
  background: var(--white);
  border-bottom: 1px solid var(--gray-100);
  position: sticky;
  top: 0;
  z-index: 50;
}

/* Mobile menu button */
.mobile-menu-btn {
  display: none;
  width: 40px;
  height: 40px;
  border: none;
  border-radius: var(--radius-md);
  background: transparent;
  color: var(--gray-600);
  cursor: pointer;
  font-size: 18px;
  align-items: center;
  justify-content: center;
}

.mobile-menu-btn:hover {
  background: var(--gray-100);
}

/* Search Bar */
.search-bar {
  flex: 1;
  max-width: 480px;
  position: relative;
}

.search-bar .search-icon {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--gray-400);
  font-size: 14px;
  pointer-events: none;
}

.search-bar input {
  width: 100%;
  padding: 10px 14px 10px 40px;
  border: 1.5px solid var(--gray-200);
  border-radius: var(--radius-md);
  background: var(--gray-50);
  color: var(--gray-800);
  font-size: 13px;
  outline: none;
  transition: all var(--transition-fast);
}

.search-bar input:focus {
  background: var(--white);
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-subtle);
}

.search-bar input::placeholder {
  color: var(--gray-400);
}

.search-shortcut {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  background: var(--gray-100);
  color: var(--gray-400);
  font-size: 11px;
  font-family: inherit;
  padding: 2px 7px;
  border-radius: 4px;
  border: 1px solid var(--gray-200);
  pointer-events: none;
}

/* Search Results Dropdown */
.search-results {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  background: var(--white);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  max-height: 380px;
  overflow-y: auto;
  z-index: 200;
}

.search-result-item {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  padding: 10px 16px;
  cursor: pointer;
  transition: background var(--transition-fast);
}

.search-result-item:hover {
  background: var(--gray-50);
}

.search-result-item i {
  color: var(--gray-400);
  width: 18px;
  text-align: center;
}

.search-result-item .result-text {
  flex: 1;
}

.search-result-item .result-label {
  font-size: 13px;
  font-weight: 500;
  color: var(--gray-800);
}

.search-result-item .result-meta {
  font-size: 11px;
  color: var(--gray-400);
}

.search-result-group {
  padding: 8px 16px 4px;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--gray-400);
  border-top: 1px solid var(--gray-100);
}

.search-result-group:first-child {
  border-top: none;
}

/* Header Actions */
.header-actions {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  margin-left: auto;
}

.header-btn {
  position: relative;
  width: 40px;
  height: 40px;
  border: none;
  border-radius: var(--radius-md);
  background: transparent;
  color: var(--gray-500);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  transition: all var(--transition-fast);
}

.header-btn:hover {
  background: var(--gray-100);
  color: var(--gray-800);
}

.notif-badge {
  position: absolute;
  top: 6px;
  right: 6px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--danger);
  color: var(--white);
  font-size: 10px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid var(--white);
}

/* Notification Dropdown */
.notif-dropdown {
  position: absolute;
  top: calc(var(--header-height) - 4px);
  right: var(--sp-8);
  width: 400px;
  background: var(--white);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-xl);
  z-index: 200;
  animation: modalSlideUp var(--transition-fast) ease;
}

.notif-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--sp-4) var(--sp-5);
  border-bottom: 1px solid var(--gray-100);
}

.notif-header h4 {
  font-size: 14px;
}

.notif-mark-read {
  border: none;
  background: none;
  color: var(--primary);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
}

.notif-mark-read:hover {
  text-decoration: underline;
}

.notif-list {
  max-height: 400px;
  overflow-y: auto;
}

.notif-item {
  display: flex;
  gap: var(--sp-3);
  padding: var(--sp-4) var(--sp-5);
  border-bottom: 1px solid var(--gray-50);
  transition: background var(--transition-fast);
  cursor: pointer;
}

.notif-item:hover {
  background: var(--gray-50);
}

.notif-item.unread {
  background: var(--primary-subtle);
}

.notif-item.unread:hover {
  background: var(--primary-light);
}

.notif-icon {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  flex-shrink: 0;
}

.notif-urgent {
  background: var(--danger-light);
  color: var(--danger);
}

.notif-warning {
  background: var(--warning-light);
  color: #B45309;
}

.notif-success {
  background: var(--success-light);
  color: #15803D;
}

.notif-info {
  background: var(--info-light);
  color: var(--info);
}

.notif-content p {
  font-size: 13px;
  line-height: 1.4;
  color: var(--gray-700);
}

.notif-content p strong {
  color: var(--gray-900);
}

.notif-time {
  font-size: 11px;
  color: var(--gray-400);
  margin-top: 2px;
  display: block;
}

/* ══════════════════════════════════════════════════════════════
   RESPONSIVE
   ══════════════════════════════════════════════════════════════ */

@media (max-width: 1024px) {
  .main-header {
    padding: 0 var(--sp-4);
  }

  .mobile-menu-btn {
    display: flex;
  }

  .search-shortcut {
    display: none;
  }

  .notif-dropdown {
    right: var(--sp-4);
    width: calc(100vw - 32px);
    max-width: 400px;
  }
}

@media (max-width: 640px) {
  .search-bar {
    max-width: none;
  }
}
