/**
 * Header Authentication UI Styles
 * Beautiful, responsive authentication components
 */

/* Auth Container */
.auth-container {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

/* Auth Buttons */
.auth-buttons {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.auth-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  padding: 0.5rem 1rem;
  border: none;
  border-radius: 0.5rem;
  font-size: 0.875rem;
  font-weight: 500;
  text-decoration: none;
  cursor: pointer;
  transition: all 0.2s ease-in-out;
  white-space: nowrap;
}

.auth-btn:focus {
  outline: 2px solid #3b82f6;
  outline-offset: 2px;
}

.auth-btn--primary {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.auth-btn--primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

.auth-btn--secondary {
  background: white;
  color: #374151;
  border: 1px solid #d1d5db;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

.auth-btn--secondary:hover {
  background: #f9fafb;
  border-color: #9ca3af;
}

.auth-btn--small {
  padding: 0.25rem 0.5rem;
  font-size: 0.75rem;
}

/* Authenticated User Display */
.auth-user {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  position: relative;
}

.auth-avatar {
  width: 2rem;
  height: 2rem;
  border-radius: 50%;
  border: 2px solid #e5e7eb;
  object-fit: cover;
}

.auth-user-info {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
}

.auth-username {
  font-size: 0.875rem;
  font-weight: 500;
  color: #111827;
  line-height: 1.2;
}

.auth-guest-badge {
  font-size: 0.75rem;
  color: #6b7280;
  background: #f3f4f6;
  padding: 0.125rem 0.375rem;
  border-radius: 0.25rem;
  line-height: 1;
}

/* Dropdown Menu */
.auth-dropdown {
  position: relative;
}

.auth-dropdown-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  border: none;
  background: #f3f4f6;
  border-radius: 0.375rem;
  cursor: pointer;
  transition: background-color 0.2s;
}

.auth-dropdown-btn:hover {
  background: #e5e7eb;
}

.auth-dropdown-menu {
  position: absolute;
  top: 100%;
  right: 0;
  margin-top: 0.5rem;
  background: white;
  border: 1px solid #e5e7eb;
  border-radius: 0.5rem;
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
  min-width: 12rem;
  z-index: 50;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-0.5rem);
  transition: all 0.2s ease-in-out;
}

.auth-dropdown-menu.show {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.auth-menu-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  width: 100%;
  padding: 0.75rem 1rem;
  border: none;
  background: none;
  color: #374151;
  font-size: 0.875rem;
  text-decoration: none;
  text-align: left;
  cursor: pointer;
  transition: background-color 0.2s;
}

.auth-menu-item:first-child {
  border-top-left-radius: 0.5rem;
  border-top-right-radius: 0.5rem;
}

.auth-menu-item:last-child {
  border-bottom-left-radius: 0.5rem;
  border-bottom-right-radius: 0.5rem;
}

.auth-menu-item:hover {
  background: #f9fafb;
}

/* Error State */
.auth-error {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem;
  background: #fef2f2;
  border: 1px solid #fecaca;
  border-radius: 0.375rem;
}

.auth-error-text {
  font-size: 0.875rem;
  color: #dc2626;
}

/* Notifications */
.auth-notification {
  position: fixed;
  top: 1rem;
  right: 1rem;
  background: white;
  border: 1px solid #e5e7eb;
  border-radius: 0.5rem;
  padding: 1rem;
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
  z-index: 1000;
  opacity: 0;
  transform: translateX(100%);
  transition: all 0.3s ease-in-out;
  max-width: 20rem;
}

.auth-notification--show {
  opacity: 1;
  transform: translateX(0);
}

.auth-notification--success {
  border-left: 4px solid #10b981;
}

.auth-notification--error {
  border-left: 4px solid #ef4444;
}

.auth-notification--info {
  border-left: 4px solid #3b82f6;
}

/* Responsive Design */
@media (max-width: 640px) {
  .auth-container {
    gap: 0.5rem;
  }
  
  .auth-buttons {
    gap: 0.25rem;
  }
  
  .auth-btn {
    padding: 0.375rem 0.75rem;
    font-size: 0.8125rem;
  }
  
  .auth-user-info {
    display: none; /* Hide user info on mobile, just show avatar */
  }
  
  .auth-dropdown-menu {
    right: -0.5rem;
    min-width: 10rem;
  }
  
  .auth-notification {
    top: 0.5rem;
    right: 0.5rem;
    left: 0.5rem;
    max-width: none;
  }
}

/* Animation for smooth transitions */
@keyframes slideIn {
  from {
    opacity: 0;
    transform: translateY(-0.5rem);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.auth-container * {
  animation: slideIn 0.3s ease-out;
}

/* Dark mode support */
@media (prefers-color-scheme: dark) {
  .auth-btn--secondary {
    background: #374151;
    color: #f9fafb;
    border-color: #4b5563;
  }
  
  .auth-btn--secondary:hover {
    background: #4b5563;
    border-color: #6b7280;
  }
  
  .auth-dropdown-btn {
    background: #374151;
    color: #f9fafb;
  }
  
  .auth-dropdown-btn:hover {
    background: #4b5563;
  }
  
  .auth-dropdown-menu {
    background: #1f2937;
    border-color: #374151;
  }
  
  .auth-menu-item {
    color: #f9fafb;
  }
  
  .auth-menu-item:hover {
    background: #374151;
  }
  
  .auth-notification {
    background: #1f2937;
    border-color: #374151;
    color: #f9fafb;
  }
}
