/* Header Component Styles - Neomorphic Dark Theme */

.header {
  position: sticky;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  background: #1f2937; /* Dark gray-800 */
  backdrop-filter: blur(10px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
  padding: 1rem 0; /* Slightly more padding for better proportions */
}

.header__container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 1.5rem;
  max-width: 1200px;
  margin: 0 auto;
  gap: 1rem;
}

/* Logo Section */
.header__left {
  flex-shrink: 0;
}

.header__logo {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  text-decoration: none;
  color: #fb923c; /* Orange accent as default */
  font-weight: 700;
  font-size: 1.5rem;
  transition: color 0.2s ease;
}

.header__logo:hover {
  color: #fed7aa; /* Lighter orange on hover */
}

.header__logo-img {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-md);
}

.header__logo-text {
  display: block;
}

/* Search Section */
.header__center {
  flex: 1;
  max-width: 400px;
  margin: 0 var(--space-lg);
}

.header__search {
  position: relative;
  width: 100%;
}

.header__search-input {
  width: 100%;
  padding: var(--space-sm) var(--space-lg);
  padding-right: 3rem;
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: var(--radius-full);
  background: rgba(255, 255, 255, 0.1);
  color: var(--color-gray-800);
  font-size: var(--font-size-sm);
  transition: all var(--transition-fast);
}

.header__search-input::placeholder {
  color: rgba(255, 255, 255, 0.7);
}

.header__search-input:focus {
  outline: none;
  border-color: var(--color-accent);
  background: rgba(255, 255, 255, 0.2);
  box-shadow: 0 0 0 3px rgba(255, 215, 0, 0.1);
}

.header__search-input:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.header__search-btn {
  position: absolute;
  right: var(--space-sm);
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  color: rgba(255, 255, 255, 0.7);
  cursor: pointer;
  padding: var(--space-xs);
  border-radius: var(--radius-sm);
  transition: color var(--transition-fast);
}

.header__search-btn:hover:not(:disabled) {
  color: var(--color-accent);
}

.header__search-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

/* Navigation and User Section */
.header__right {
  display: flex;
  align-items: center;
  gap: var(--space-lg);
  flex-shrink: 0;
}

/* Navigation */
.header__nav-list {
  display: flex;
  list-style: none;
  gap: var(--space-md);
  margin: 0;
  padding: 0;
}

.header__nav-link {
  display: flex;
  align-items: center;
  gap: var(--space-xs);
  padding: var(--space-sm) var(--space-md);
  border-radius: var(--radius-md);
  color: rgba(255, 255, 255, 0.9);
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-medium);
  text-decoration: none;
  transition: all var(--transition-fast);
}

.header__nav-link:hover {
  color: var(--color-accent);
  background: rgba(255, 255, 255, 0.1);
}

.header__nav-icon {
  font-size: var(--font-size-base);
}

/* User Section */
.header__user-profile {
  display: flex;
  align-items: center;
  gap: 2rem; /* Explicit spacing between user info and logout button */
}

.header__user-guest {
  display: flex;
  align-items: center;
  gap: 2rem; /* More spacing for neomorphic effects */
}

.header__user-info {
  display: flex;
  flex-direction: column;
  gap: var(--space-xs);
}

.header__user-name {
  color: #e5e7eb; /* text-gray-200 */
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-medium);
}

.header__user-badge {
  display: inline-block;
  padding: var(--space-xs) var(--space-sm);
  background: #fb923c; /* Orange accent */
  color: #1f2937; /* Dark background for contrast */
  font-size: var(--font-size-xs);
  font-weight: var(--font-weight-semibold);
  border-radius: var(--radius-sm);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* Neomorphic Button Styles */
.neumorphic-raised {
  background: #1f2937;
  border-radius: 1rem;
  box-shadow: 8px 8px 16px #111827, -8px -8px 16px #2d3a4a;
  transition: all 0.3s ease-in-out;
}

.neumorphic-raised:hover {
  box-shadow: 4px 4px 8px #111827, -4px -4px 8px #2d3a4a;
}

.neumorphic-active {
  box-shadow: inset 6px 6px 12px #111827, inset -6px -6px 12px #2d3a4a;
  color: #fb923c; /* Orange accent */
}

/* Header Logout Button Container */
.header__logout-btn {
  /* Ensure proper spacing from username */
  margin-left: 1rem; /* Additional spacing if gap doesn't work */
}

/* Header Logout Button - Neomorphic Style */
.header__logout-btn .btn-ghost {
  background: #1f2937;
  border-radius: 1rem;
  border: none;
  color: #fb923c; /* Orange accent */
  font-weight: 600;
  padding: 0.5rem 1rem;
  font-size: 0.875rem;
  box-shadow: 8px 8px 16px #111827, -8px -8px 16px #2d3a4a;
  transition: all 0.3s ease-in-out;
}

.header__logout-btn .btn-ghost:hover {
  background: #1f2937; /* Keep dark background */
  box-shadow: 4px 4px 8px #111827, -4px -4px 8px #2d3a4a;
  color: #fed7aa; /* Lighter orange text on hover */
}

.header__logout-btn .btn-ghost:active {
  box-shadow: inset 4px 4px 8px #111827, inset -4px -4px 8px #2d3a4a;
}

/* Login Button - Neomorphic Style */
.header__user-guest .btn-ghost.neumorphic-raised {
  background: #1f2937;
  border-radius: 1rem;
  border: none;
  color: #9ca3af; /* Gray text */
  font-weight: 600;
  padding: 0.5rem 1rem;
  font-size: 0.875rem;
  box-shadow: 8px 8px 16px #111827, -8px -8px 16px #2d3a4a;
  transition: all 0.3s ease-in-out;
}

.header__user-guest .btn-ghost.neumorphic-raised:hover {
  background: #1f2937; /* Keep dark background */
  box-shadow: 4px 4px 8px #111827, -4px -4px 8px #2d3a4a;
  color: #d1d5db; /* Lighter gray text on hover */
}

.header__user-guest .btn-ghost.neumorphic-raised:active {
  box-shadow: inset 4px 4px 8px #111827, inset -4px -4px 8px #2d3a4a;
}

/* Register Button - Neomorphic Style */
.header__user-guest .btn-primary.neumorphic-raised {
  background: #1f2937; /* Dark background like logout button */
  border-radius: 1rem;
  border: none;
  color: #fb923c; /* Orange text */
  font-weight: 600;
  padding: 0.5rem 1rem;
  font-size: 0.875rem;
  box-shadow: 8px 8px 16px #111827, -8px -8px 16px #2d3a4a;
  transition: all 0.3s ease-in-out;
}

.header__user-guest .btn-primary.neumorphic-raised:hover {
  background: #1f2937; /* Keep dark background */
  box-shadow: 4px 4px 8px #111827, -4px -4px 8px #2d3a4a;
  color: #fed7aa; /* Lighter orange text on hover */
}

.header__user-guest .btn-primary.neumorphic-raised:active {
  box-shadow: inset 4px 4px 8px #111827, inset -4px -4px 8px #2d3a4a;
}

/* Mobile Menu Toggle */
.header__mobile-toggle {
  display: none;
  flex-direction: column;
  gap: 3px;
  background: none;
  border: none;
  cursor: pointer;
  padding: var(--space-sm);
}

.header__mobile-toggle span {
  width: 20px;
  height: 2px;
  background: var(--color-white);
  border-radius: 1px;
  transition: all var(--transition-fast);
}

/* Mobile Styles */
@media (max-width: 768px) {
  .header__container {
    padding: var(--space-sm) var(--space-md);
    gap: var(--space-md);
  }
  
  .header__center {
    display: none;
  }
  
  .header__nav {
    display: none;
  }
  
  .header__mobile-toggle {
    display: flex;
  }
  
  .header__user-info {
    display: none;
  }
  
  .header__logout-btn .btn-ghost {
    padding: var(--space-sm);
    font-size: var(--font-size-xs);
  }
}

@media (max-width: 480px) {
  .header__logo-text {
    display: none;
  }
  
  .header__container {
    gap: var(--space-sm);
  }
  
  .header__right {
    gap: var(--space-sm);
  }
  
  /* Reduce spacing on mobile for better fit */
  .header__user-profile {
    gap: 1rem;
  }
  
  .header__logout-btn {
    margin-left: 0.5rem;
  }
  
  /* Reduce spacing on mobile but maintain neomorphic effects */
  .header__user-guest {
    gap: 1rem;
  }
}

/* Mobile menu expanded state */
.header--mobile-open .header__nav {
  display: block;
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.2);
  padding: var(--space-lg);
}

.header--mobile-open .header__nav-list {
  flex-direction: column;
  gap: var(--space-sm);
}

.header--mobile-open .header__mobile-toggle span:nth-child(1) {
  transform: rotate(45deg) translate(5px, 5px);
}

.header--mobile-open .header__mobile-toggle span:nth-child(2) {
  opacity: 0;
}

.header--mobile-open .header__mobile-toggle span:nth-child(3) {
  transform: rotate(-45deg) translate(7px, -6px);
}

/* Search expanded state for mobile (future feature) */
.header--search-open .header__center {
  display: block;
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(10px);
  padding: var(--space-lg);
  border-bottom: 1px solid rgba(255, 255, 255, 0.2);
}