/* Shared Header Styles - ROA2WEB */

/* Header Container */
.header-container {
  position: sticky;
  top: 0;
  z-index: var(--z-header, 100);
  background: var(--color-bg, #fff);
  border-bottom: 1px solid var(--color-border, #e5e7eb);
  height: var(--header-height, 60px);
  padding: 0 var(--space-lg, 24px);
}

/* Gradient Header Variant */
.header-container--gradient {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  border-bottom: none;
}

.header-container--gradient .header-brand {
  color: white;
}

.header-container--gradient .hamburger-line {
  background-color: white;
}

/* Header Navigation */
.header-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  height: 100%;
  max-width: 1600px;
  margin: 0 auto;
}

/* Header Left Section */
.header-left {
  display: flex;
  align-items: center;
  gap: var(--space-md, 16px);
}

/* Brand/Logo */
.header-brand {
  display: flex;
  align-items: center;
  gap: var(--space-sm, 8px);
  font-size: var(--text-lg, 18px);
  font-weight: var(--font-semibold, 600);
  color: var(--color-primary, #2563eb);
  text-decoration: none;
  white-space: nowrap;
}

.header-brand:hover {
  opacity: 0.9;
}

/* Header Actions (right side) */
.header-actions {
  display: flex;
  align-items: center;
  gap: var(--space-md, 16px);
}

/* Hamburger Button */
.hamburger-btn {
  display: flex;
  flex-direction: column;
  justify-content: space-around;
  width: 32px;
  height: 32px;
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 4px;
  z-index: 10;
  transition: all 0.3s ease;
}

.hamburger-btn:hover {
  opacity: 0.7;
}

.hamburger-line {
  width: 100%;
  height: 3px;
  background-color: var(--color-primary, #2563eb);
  border-radius: 2px;
  transition: all 0.3s ease;
  transform-origin: center;
}

/* Hamburger Animation - X state */
.hamburger-btn.active .hamburger-line:nth-child(1) {
  transform: translateY(9px) rotate(45deg);
}

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

.hamburger-btn.active .hamburger-line:nth-child(3) {
  transform: translateY(-9px) rotate(-45deg);
}

/* Header User Menu */
.header-user {
  display: flex;
  align-items: center;
  gap: var(--space-sm, 8px);
  padding: var(--space-sm, 8px);
  border-radius: var(--radius-md, 6px);
  cursor: pointer;
  transition: background-color 0.15s ease;
  color: var(--color-text, #111827);
}

.header-user:hover {
  background-color: var(--color-bg-secondary, #f9fafb);
}

/* Gradient header user menu */
.header-container--gradient .header-user {
  color: white;
}

.header-container--gradient .header-user:hover {
  background-color: rgba(255, 255, 255, 0.1);
}

/* Server Badge (US-026) */
.server-badge {
  display: flex;
  align-items: center;
  gap: var(--space-xs, 4px);
  padding: var(--space-xs, 4px) var(--space-sm, 8px);
  background: var(--primary-100, #dbeafe);
  color: var(--primary-700, #1d4ed8);
  border-radius: var(--radius-sm, 4px);
  font-size: 0.75rem;
  font-weight: var(--font-semibold, 600);
}

.server-badge i {
  font-size: 0.75rem;
}

/* Dark mode support for server badge */
[data-theme="dark"] .server-badge {
  background: var(--primary-900, #1e3a8a);
  color: var(--primary-200, #bfdbfe);
}

/* Gradient header server badge */
.header-container--gradient .server-badge {
  background: rgba(255, 255, 255, 0.2);
  color: white;
}

/* Server Switch - ServerSelector component has its own scoped styles */
/* Only header-specific overrides here if needed */

/* Theme Toggle Button */
.theme-toggle-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  background: transparent;
  border: 1px solid var(--surface-border, #e2e8f0);
  border-radius: var(--radius-md, 6px);
  cursor: pointer;
  color: var(--text-color, #111827);
  transition: all 0.15s ease;
}

.theme-toggle-btn:hover {
  background: var(--surface-hover, #f1f5f9);
  border-color: var(--primary-500, #3b82f6);
  color: var(--primary-500, #3b82f6);
}

.theme-toggle-btn i {
  font-size: 1rem;
}

/* Gradient header theme toggle */
.header-container--gradient .theme-toggle-btn {
  color: white;
  border-color: rgba(255, 255, 255, 0.3);
}

.header-container--gradient .theme-toggle-btn:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: white;
}

/* Mobile Responsive */
@media (max-width: 768px) {
  /* US-401/US-402: Hide desktop header on mobile - MobileTopBar takes over */
  .header-container {
    display: none !important;
  }

  .header-left {
    gap: var(--space-sm, 8px);
  }

  .header-actions {
    gap: var(--space-sm, 8px);
  }

  .header-brand {
    font-size: var(--text-base, 16px);
  }

  /* Hide text-only elements on mobile */
  .desktop-only {
    display: none;
  }
}

@media (max-width: 480px) {
  .header-brand span {
    display: none;
  }

  .header-brand i {
    font-size: 1.5rem;
  }
}

/* Server Switch Password Modal (US-009) */
.server-switch-modal .server-switch-modal-content {
  display: flex;
  flex-direction: column;
  gap: var(--space-md, 16px);
}

.server-switch-modal .form-field {
  display: flex;
  flex-direction: column;
  gap: var(--space-xs, 4px);
}

.server-switch-modal .switch-error {
  display: flex;
  align-items: center;
  gap: var(--space-sm, 8px);
  padding: var(--space-sm, 8px) var(--space-md, 12px);
  background: var(--red-50, #fef2f2);
  border: 1px solid var(--red-200, #fecaca);
  border-radius: var(--radius-sm, 4px);
  color: var(--red-700, #b91c1c);
  font-size: 0.875rem;
}

.server-switch-modal .switch-error i {
  color: var(--red-500, #ef4444);
}

/* Dark mode support for modal */
[data-theme="dark"] .server-switch-modal .switch-error {
  background: var(--red-900, #7f1d1d);
  border-color: var(--red-700, #b91c1c);
  color: var(--red-200, #fecaca);
}

[data-theme="dark"] .server-switch-modal .switch-error i {
  color: var(--red-400, #f87171);
}

/* ===== Server Switch Password Modal Dialog ===== */
.server-switch-modal .p-dialog {
  border-radius: var(--radius-lg) !important;
  box-shadow: var(--shadow-lg) !important;
  background: var(--surface-card) !important;
  border: 1px solid var(--surface-border) !important;
  min-width: 320px !important;
}

.server-switch-modal .p-dialog-header {
  background: var(--surface-card) !important;
  border-bottom: 1px solid var(--surface-border) !important;
  padding: var(--space-md) var(--space-lg) !important;
}

.server-switch-modal .p-dialog-content {
  background: var(--surface-card) !important;
  padding: var(--space-lg) !important;
}

.server-switch-modal .p-dialog-footer {
  background: var(--surface-card) !important;
  border-top: 1px solid var(--surface-border) !important;
  padding: var(--space-md) var(--space-lg) !important;
}

/* Dark mode support for modal dialog */
[data-theme="dark"] .server-switch-modal .p-dialog {
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.4) !important;
  background: var(--surface-card) !important;
}

[data-theme="dark"] .server-switch-modal .p-dialog-header {
  background: var(--surface-card) !important;
  color: var(--text-color) !important;
}

[data-theme="dark"] .server-switch-modal .p-dialog-header .p-dialog-title {
  color: var(--text-color) !important;
}

[data-theme="dark"] .server-switch-modal .p-dialog-content {
  background: var(--surface-card) !important;
}

[data-theme="dark"] .server-switch-modal .p-dialog-footer {
  background: var(--surface-card) !important;
}

/* Dark mode support for Password input inside modal */
[data-theme="dark"] .server-switch-modal .p-password .p-inputtext {
  background: var(--surface-overlay, #374151) !important;
  color: var(--text-color, #f9fafb) !important;
  border-color: var(--surface-border, #4b5563) !important;
}

[data-theme="dark"] .server-switch-modal .p-password .p-inputtext::placeholder {
  color: var(--text-color-secondary, #9ca3af) !important;
}

[data-theme="dark"] .server-switch-modal .p-password .p-inputtext:focus {
  border-color: var(--primary-400, #60a5fa) !important;
}

/* Password toggle icon dark mode */
[data-theme="dark"] .server-switch-modal .p-password-toggle-icon {
  color: var(--text-color-secondary, #9ca3af) !important;
}

/* System preference dark mode support for Password input */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme]) .server-switch-modal .p-password .p-inputtext {
    background: var(--surface-overlay, #374151) !important;
    color: var(--text-color, #f9fafb) !important;
    border-color: var(--surface-border, #4b5563) !important;
  }

  :root:not([data-theme]) .server-switch-modal .p-password .p-inputtext::placeholder {
    color: var(--text-color-secondary, #9ca3af) !important;
  }

  :root:not([data-theme]) .server-switch-modal .p-password-toggle-icon {
    color: var(--text-color-secondary, #9ca3af) !important;
  }
}
