/**
 * 🔐 AUTH UI STYLES
 * =================
 * Styles für Login/Logout Bereich und Auth-Modals
 */

/* User-Auth-Container */
.user-auth-container {
  position: relative;
  margin-left: auto;
}

.user-display {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  border-radius: 6px;
  background: var(--bg-secondary);
  cursor: pointer;
  transition: all 0.2s ease;
  border: 1px solid transparent;
}

.user-display:hover {
  background: var(--bg-hover);
  border-color: var(--border-color);
}

.user-icon {
  display: flex;
  align-items: center;
  color: var(--text-secondary);
}

.user-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.user-name {
  font-size: 14px;
  font-weight: 500;
  color: var(--text-primary);
}

.user-role {
  font-size: 11px;
  color: var(--text-secondary);
  font-weight: 400;
}

.user-action-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 4px;
  background: transparent;
  border: none;
  cursor: pointer;
  border-radius: 4px;
  color: var(--text-secondary);
  transition: all 0.2s ease;
}

.user-action-btn:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
}

/* User-Dropdown */
.user-dropdown {
  position: absolute;
  top: calc(100% + 4px);
  right: 0;
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: 6px;
  padding: 4px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
  z-index: 10000;
  min-width: 160px;
}

.dropdown-item {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 8px 12px;
  text-align: left;
  border: none;
  background: transparent;
  cursor: pointer;
  border-radius: 4px;
  color: var(--text-primary);
  font-size: 14px;
  transition: background 0.2s ease;
}

.dropdown-item:hover {
  background: var(--bg-hover);
}

.dropdown-item svg {
  flex-shrink: 0;
}

/* Password Field mit Auge-Icon */
.password-field-wrapper {
  position: relative;
  width: 100%;
}

.password-field-wrapper input {
  width: 100%;
  padding-right: 45px !important; /* Platz für Icon */
}

.password-toggle-icon {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  cursor: pointer;
  color: var(--text-secondary);
  transition: color 0.2s ease;
  width: 20px;
  height: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  user-select: none;
}

.password-toggle-icon:hover {
  color: var(--text-primary);
}

.password-toggle-icon svg {
  width: 20px;
  height: 20px;
  fill: currentColor;
}

/* Auth-Modal */
.auth-modal {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.7);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100000;
  animation: fadeIn 0.2s ease;
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

.auth-modal-content {
  background: var(--bg-primary);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 24px;
  max-width: 400px;
  width: 90%;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5);
  animation: slideIn 0.3s ease;
}

@keyframes slideIn {
  from {
    transform: translateY(-20px);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

.auth-modal-content h2 {
  margin: 0 0 16px 0;
  font-size: 20px;
  color: var(--text-primary);
}

.auth-modal-content p {
  margin: 0 0 16px 0;
  color: var(--text-secondary);
  font-size: 14px;
}

.auth-modal-content form {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.auth-modal-content input {
  padding: 10px 12px;
  border: 1px solid var(--border-color);
  border-radius: 4px;
  background: var(--bg-secondary);
  color: var(--text-primary);
  font-size: 14px;
  transition: all 0.2s ease;
}

.auth-modal-content input:focus {
  outline: none;
  border-color: var(--primary-color);
  box-shadow: 0 0 0 3px rgba(255, 204, 0, 0.1);
}

.auth-modal-content button {
  padding: 10px 16px;
  border: none;
  border-radius: 4px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
}

.auth-modal-content button[type='submit'] {
  background: var(--primary-color);
  color: #000;
}

.auth-modal-content button[type='submit']:hover {
  background: #ffd700;
  transform: translateY(-1px);
  box-shadow: 0 4px 8px rgba(255, 204, 0, 0.3);
}

.auth-modal-content button[type='button'] {
  background: var(--bg-secondary);
  color: var(--text-primary);
  border: 1px solid var(--border-color);
}

.auth-modal-content button[type='button']:hover {
  background: var(--bg-hover);
}

/* Erzwungenes Password-Change-Modal (nicht schließbar) */
.auth-modal-force {
  backdrop-filter: blur(4px);
}

.auth-modal-force .auth-modal-content {
  border: 2px solid var(--primary-color);
}

/* Error-Message in Modal */
.auth-error {
  padding: 8px 12px;
  background: rgba(255, 0, 0, 0.1);
  border: 1px solid rgba(255, 0, 0, 0.3);
  border-radius: 4px;
  color: #ff6b6b;
  font-size: 13px;
  margin-bottom: 12px;
}

/* Success-Message in Modal */
.auth-success {
  padding: 8px 12px;
  background: rgba(0, 255, 0, 0.1);
  border: 1px solid rgba(0, 255, 0, 0.3);
  border-radius: 4px;
  color: #51cf66;
  font-size: 13px;
  margin-bottom: 12px;
}
