/**
 * Firebase authentication module styles
 * Complete style definitions for auth UI
 */

/* Auth widget styles */
.auth-widget {
  position: fixed;
  top: 10px;
  right: 10px;
  z-index: 1000;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(10px);
  border-radius: 12px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  padding: 12px 16px;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  font-size: 14px;
  transition: all 0.3s ease;
}

.auth-widget:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.15);
}

.auth-widget-content {
  display: flex;
  align-items: center;
  gap: 12px;
}

.user-info {
  display: flex;
  align-items: center;
  gap: 8px;
}

.user-avatar {
  font-size: 16px;
  width: 20px;
  text-align: center;
}

.user-name {
  font-weight: 500;
  color: #333;
  max-width: 120px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.user-status {
  font-size: 12px;
  padding: 2px 8px;
  border-radius: 10px;
  font-weight: 500;
  background: #f5f5f5;
  color: #666;
}

.user-status.anonymous {
  background: #fff3cd;
  color: #856404;
}

.user-status.authenticated {
  background: #d4edda;
  color: #155724;
}

.auth-actions {
  display: flex;
  gap: 6px;
}

.auth-btn {
  background: #007bff;
  color: white;
  border: none;
  padding: 6px 12px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
}

.auth-btn:hover {
  background: #0056b3;
  transform: translateY(-1px);
}

.auth-btn.secondary {
  background: #6c757d;
}

.auth-btn.secondary:hover {
  background: #545b62;
}

/* Auth modal styles */
.auth-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  box-sizing: border-box;
}

.auth-modal-backdrop {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(4px);
}

.auth-modal-content {
  position: relative;
  background: white;
  border-radius: 16px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
  width: 100%;
  max-width: 400px;
  max-height: 90vh;
  overflow-y: auto;
  animation: modalSlideIn 0.3s ease-out;
}

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

.auth-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 24px 24px 16px;
  border-bottom: 1px solid #eee;
}

.auth-modal-title {
  margin: 0;
  font-size: 20px;
  font-weight: 600;
  color: #333;
}

.auth-modal-close {
  background: none;
  border: none;
  font-size: 24px;
  cursor: pointer;
  color: #666;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: all 0.2s ease;
}

.auth-modal-close:hover {
  background: #f5f5f5;
  color: #333;
}

.auth-modal-body {
  padding: 24px;
}

/* Form styles */
.auth-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.auth-form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.auth-form-group label {
  font-size: 14px;
  font-weight: 500;
  color: #333;
}

.auth-form-group input {
  padding: 12px 16px;
  border: 2px solid #e1e5e9;
  border-radius: 8px;
  font-size: 16px;
  transition: all 0.2s ease;
  background: white;
}

.auth-form-group input:focus {
  outline: none;
  border-color: #007bff;
  box-shadow: 0 0 0 3px rgba(0, 123, 255, 0.1);
}

.auth-form-group input::placeholder {
  color: #999;
}

.auth-form-btn {
  padding: 12px 24px;
  border: none;
  border-radius: 8px;
  font-size: 16px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.auth-form-btn.primary {
  background: #007bff;
  color: white;
}

.auth-form-btn.primary:hover {
  background: #0056b3;
  transform: translateY(-1px);
}

.auth-form-btn.google {
  background: white;
  color: #333;
  border: 2px solid #e1e5e9;
}

.auth-form-btn.google:hover {
  background: #f8f9fa;
  border-color: #007bff;
}

.google-icon {
  font-weight: bold;
  color: #4285f4;
}

.auth-form-switch {
  text-align: center;
  margin: 8px 0 0;
  font-size: 14px;
  color: #666;
}

.auth-form-switch a {
  color: #007bff;
  text-decoration: none;
  font-weight: 500;
}

.auth-form-switch a:hover {
  text-decoration: underline;
}

/* Loading state styles */
.auth-loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  padding: 40px 20px;
}

.auth-spinner {
  width: 32px;
  height: 32px;
  border: 3px solid #e1e5e9;
  border-top: 3px solid #007bff;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

.auth-loading p {
  margin: 0;
  color: #666;
  font-size: 14px;
}

/* Message styles */
.auth-error, .auth-success {
  padding: 12px 16px;
  border-radius: 8px;
  margin-top: 16px;
  font-size: 14px;
  font-weight: 500;
}

.auth-error {
  background: #f8d7da;
  color: #721c24;
  border: 1px solid #f5c6cb;
}

.auth-success {
  background: #d4edda;
  color: #155724;
  border: 1px solid #c3e6cb;
}

/* Dark theme support */
@media (prefers-color-scheme: dark) {
  .auth-widget {
    background: rgba(42, 42, 42, 0.95);
    border-color: rgba(255, 255, 255, 0.1);
  }
  
  .user-name {
    color: #fff;
  }
  
  .user-status {
    background: #444;
    color: #ccc;
  }
  
  .user-status.anonymous {
    background: #2d2a1f;
    color: #d4a843;
  }
  
  .user-status.authenticated {
    background: #1f2d1f;
    color: #6bb86b;
  }
  
  .auth-modal-content {
    background: #2a2a2a;
  }
  
  .auth-modal-title {
    color: #fff;
  }
  
  .auth-modal-header {
    border-bottom-color: #444;
  }
  
  .auth-modal-close {
    color: #ccc;
  }
  
  .auth-modal-close:hover {
    background: #444;
    color: #fff;
  }
  
  .auth-form-group label {
    color: #fff;
  }
  
  .auth-form-group input {
    background: #444;
    border-color: #555;
    color: #fff;
  }
  
  .auth-form-group input::placeholder {
    color: #999;
  }
  
  .auth-form-group input:focus {
    border-color: #007bff;
  }
  
  .auth-form-btn.google {
    background: #444;
    color: #fff;
    border-color: #555;
  }
  
  .auth-form-btn.google:hover {
    background: #555;
  }
  
  .auth-form-switch {
    color: #ccc;
  }
  
  .auth-loading p {
    color: #ccc;
  }
  
  .auth-spinner {
    border-color: #555;
    border-top-color: #007bff;
  }
}

/* Responsive design */
@media (max-width: 768px) {
  .auth-widget {
    position: fixed;
    top: 10px;
    left: 10px;
    right: 10px;
    max-width: none;
  }
  
  .auth-widget-content {
    flex-wrap: wrap;
  }
  
  .user-info {
    flex: 1;
    min-width: 0;
  }
  
  .user-name {
    max-width: 100px;
  }
  
  .auth-modal {
    padding: 10px;
  }
  
  .auth-modal-content {
    max-width: none;
    border-radius: 12px;
  }
  
  .auth-modal-header {
    padding: 20px 20px 12px;
  }
  
  .auth-modal-body {
    padding: 20px;
  }
  
  .auth-modal-title {
    font-size: 18px;
  }
}

@media (max-width: 480px) {
  .auth-widget {
    font-size: 12px;
    padding: 8px 12px;
  }
  
  .auth-btn {
    font-size: 11px;
    padding: 4px 8px;
  }
  
  .auth-modal-header {
    padding: 16px 16px 8px;
  }
  
  .auth-modal-body {
    padding: 16px;
  }
}

/* Edit name button styles */
.auth-btn.edit {
  background: #28a745;
  font-size: 12px;
  padding: 4px 8px;
  min-width: 32px;
  border-radius: 4px;
}

.auth-btn.edit:hover {
  background: #218838;
}

.auth-btn.profile {
  background: #8b5cf6;
  font-size: 12px;
  padding: 4px 8px;
  min-width: 32px;
  border-radius: 4px;
}

.auth-btn.profile:hover {
  background: #7c3aed;
}

/* Form hint text */
.form-hint {
  font-size: 12px;
  color: var(--text-secondary, #666);
  margin-top: 4px;
  display: block;
}

.auth-form-group .form-hint {
  color: #999;
}

/* Form hint in dark theme */
@media (prefers-color-scheme: dark) {
  .form-hint {
    color: #ccc;
  }
  
  .auth-form-group .form-hint {
    color: #aaa;
  }
  
  .auth-btn.edit {
    background: #20c997;
  }
  
  .auth-btn.edit:hover {
    background: #1ba085;
  }
  
  .auth-btn.profile {
    background: #8b5cf6;
  }
  
  .auth-btn.profile:hover {
    background: #7c3aed;
  }
}