/* Archon-Net UI Components */

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-xs);
  padding: var(--space-sm) var(--space-lg);
  border: none;
  border-radius: var(--border-radius);
  font-family: var(--font-primary);
  font-size: 1rem;
  font-weight: 500;
  text-decoration: none;
  cursor: pointer;
  transition: all var(--transition-fast);
  min-width: 120px;
  position: relative;
  overflow: hidden;
}

.btn::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.1), transparent);
  transition: left var(--transition-normal);
}

.btn:hover::before {
  left: 100%;
}

.btn-primary {
  background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
  color: var(--text-primary);
  box-shadow: var(--shadow-md);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
  background: linear-gradient(135deg, var(--primary-light), var(--primary-color));
}

.btn-outline {
  background: transparent;
  color: var(--primary-light);
  border: 2px solid var(--primary-color);
}

.btn-outline:hover {
  background: var(--primary-color);
  color: var(--text-primary);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.btn-secondary {
  background: linear-gradient(135deg, var(--secondary-color), var(--secondary-dark));
  color: var(--text-primary);
}

.btn-secondary:hover {
  transform: translateY(-2px);
  background: linear-gradient(135deg, var(--secondary-light), var(--secondary-color));
}

.btn-ghost {
  background: transparent;
  color: var(--text-secondary);
  border: 1px solid var(--border-color);
}

.btn-ghost:hover {
  background: var(--bg-card);
  color: var(--text-primary);
  border-color: var(--border-accent);
}

.btn-small {
  padding: var(--space-xs) var(--space-md);
  font-size: 0.875rem;
  min-width: 80px;
}

/* Google OAuth Button */
.btn-google {
  background: #ffffff;
  color: #3c4043;
  border: 1px solid #dadce0;
  font-weight: 500;
  gap: var(--space-sm);
}

.btn-google:hover {
  background: #f8f9fa;
  box-shadow: 0 1px 3px rgba(60, 64, 67, 0.3);
  transform: translateY(-1px);
}

.btn-google svg {
  flex-shrink: 0;
}

/* OAuth Divider */
.oauth-divider {
  display: flex;
  align-items: center;
  margin: var(--space-lg) 0;
  position: relative;
}

.oauth-divider::before {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border-color);
}

.oauth-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border-color);
}

.oauth-divider span {
  padding: 0 var(--space-md);
  background: var(--bg-primary);
  color: var(--text-secondary);
  font-size: 0.875rem;
}

.btn-large {
  padding: var(--space-md) var(--space-xl);
  font-size: 1.125rem;
  min-width: 160px;
}

.btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none !important;
}

/* Modal */
.modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: var(--bg-modal);
  backdrop-filter: blur(10px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2000;
  opacity: 0;
  visibility: hidden;
  transition: all var(--transition-normal);
}

.modal.active {
  opacity: 1;
  visibility: visible;
}

.modal-content {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius-lg);
  box-shadow: var(--shadow-lg);
  max-width: 600px;
  width: 90%;
  max-height: 90vh;
  overflow-y: auto;
  transform: translateY(20px);
  transition: transform var(--transition-normal);
}

.modal.active .modal-content {
  transform: translateY(0);
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-xl) var(--space-xl) var(--space-lg);
  border-bottom: 1px solid var(--border-color);
}

.modal-header h2 {
  margin: 0;
  font-size: 1.5rem;
}

.modal-close {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 1.5rem;
  cursor: pointer;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--border-radius);
  transition: all var(--transition-fast);
}

.modal-close:hover {
  background: var(--bg-tertiary);
  color: var(--text-primary);
}

/* Forms */
.auth-container {
  padding: var(--space-xl);
}

.auth-form {
  display: none;
}

.auth-form.active {
  display: block;
}

.form-group {
  margin-bottom: var(--space-lg);
}

.form-group label {
  display: block;
  margin-bottom: var(--space-sm);
  font-weight: 500;
  color: var(--text-primary);
}

.form-group input,
.form-group textarea,
.form-group select {
  width: 100%;
  padding: var(--space-md);
  background: var(--bg-tertiary);
  border: 2px solid var(--border-color);
  border-radius: var(--border-radius);
  color: var(--text-primary);
  font-family: var(--font-primary);
  font-size: 1rem;
  transition: all var(--transition-fast);
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
  outline: none;
  border-color: var(--primary-color);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

.form-group textarea {
  resize: vertical;
  min-height: 80px;
}

.form-hint {
  display: block;
  margin-top: var(--space-xs);
  font-size: 0.875rem;
  color: var(--text-muted);
}

.char-count {
  margin-top: var(--space-xs);
  font-size: 0.875rem;
  color: var(--text-muted);
  text-align: right;
}

.mythological-fields {
  margin-top: var(--space-xl);
  padding-top: var(--space-xl);
  border-top: 1px solid var(--border-color);
}

.mythological-fields h3 {
  margin-bottom: var(--space-lg);
  color: var(--text-accent);
  font-size: 1.25rem;
}

.auth-switch {
  text-align: center;
  margin-top: var(--space-lg);
  color: var(--text-muted);
}

.auth-switch a {
  color: var(--primary-light);
  font-weight: 500;
}

.auth-switch a:hover {
  color: var(--text-accent);
}

/* Cards */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius);
  padding: var(--space-lg);
  backdrop-filter: blur(10px);
  transition: all var(--transition-normal);
}

.card:hover {
  border-color: var(--border-accent);
  box-shadow: var(--shadow-md);
}

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--space-md);
  padding-bottom: var(--space-md);
  border-bottom: 1px solid var(--border-color);
}

.card-title {
  margin: 0;
  font-size: 1.25rem;
}

.card-content {
  line-height: 1.6;
}

.card-actions {
  margin-top: var(--space-lg);
  display: flex;
  gap: var(--space-sm);
  justify-content: flex-end;
}

/* Badges */
.badge {
  display: inline-flex;
  align-items: center;
  padding: var(--space-xs) var(--space-sm);
  background: var(--bg-tertiary);
  color: var(--text-primary);
  font-size: 0.75rem;
  font-weight: 500;
  border-radius: var(--space-md);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.badge-primary {
  background: var(--primary-color);
  color: white;
}

.badge-secondary {
  background: var(--secondary-color);
  color: white;
}

.badge-warning {
  background: var(--accent-color);
  color: var(--bg-primary);
}

.badge-danger {
  background: #ef4444;
  color: white;
}

.badge-success {
  background: #10b981;
  color: white;
}

/* Progress Bar */
.progress-bar {
  width: 100%;
  height: 8px;
  background: var(--bg-tertiary);
  border-radius: 4px;
  overflow: hidden;
  position: relative;
}

.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--primary-color), var(--secondary-color));
  border-radius: 4px;
  transition: width var(--transition-normal);
  position: relative;
}

.progress-fill::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  bottom: 0;
  right: 0;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
  animation: progress-shimmer 2s infinite;
}

/* Alerts */
.alert {
  padding: var(--space-md);
  border-radius: var(--border-radius);
  margin-bottom: var(--space-md);
  border-left: 4px solid;
}

.alert-info {
  background: rgba(99, 102, 241, 0.1);
  border-color: var(--primary-color);
  color: var(--primary-light);
}

.alert-success {
  background: rgba(16, 185, 129, 0.1);
  border-color: #10b981;
  color: #34d399;
}

.alert-warning {
  background: rgba(245, 158, 11, 0.1);
  border-color: var(--accent-color);
  color: var(--accent-light);
}

.alert-error {
  background: rgba(239, 68, 68, 0.1);
  border-color: #ef4444;
  color: #f87171;
}

/* Loading States */
.loading {
  position: relative;
  overflow: hidden;
}

.loading::after {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.1), transparent);
  animation: loading-shimmer 1.5s infinite;
}

/* Tooltips */
.tooltip {
  position: relative;
  cursor: help;
}

.tooltip::before {
  content: attr(data-tooltip);
  position: absolute;
  bottom: 100%;
  left: 50%;
  transform: translateX(-50%);
  padding: var(--space-xs) var(--space-sm);
  background: var(--bg-primary);
  color: var(--text-primary);
  font-size: 0.75rem;
  border-radius: var(--border-radius);
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--transition-fast);
  z-index: 1000;
  margin-bottom: var(--space-xs);
}

.tooltip:hover::before {
  opacity: 1;
}

/* Responsive helpers */
.show-mobile {
  display: none;
}

.hide-mobile {
  display: block;
}

@media (max-width: 768px) {
  .show-mobile {
    display: block;
  }
  
  .hide-mobile {
    display: none;
  }
  
  .modal-content {
    width: 95%;
    margin: var(--space-md);
  }
  
  .modal-header,
  .auth-container {
    padding: var(--space-lg);
  }
  
  .hero-actions {
    flex-direction: column;
    align-items: stretch;
  }
  
  .btn {
    width: 100%;
  }
}