/**
 * Button Components
 * Unified button styles for consistent UI
 * Extracted from custom.css and consolidated
 */

/* ============================================================================
   BASE BUTTON STYLES
   ============================================================================ */

button, .btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.5rem 1rem;
  font-size: 0.875rem;
  font-weight: 500;
  border: none;
  border-radius: var(--border-radius-base);
  cursor: pointer;
  transition: all var(--transition-base);
  text-decoration: none;
  white-space: nowrap;
  user-select: none;
  position: relative;
  overflow: hidden;
}

/* Remove duplicate button base styles - already defined above */

button:hover, .btn:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow-medium);
}

button:active, .btn:active {
  transform: translateY(0);
}

/* ============================================================================
   BUTTON VARIANTS
   ============================================================================ */

/* Primary Button */
.btn-primary {
  background: var(--color-primary-blue);
  color: white;
  position: relative;
  overflow: hidden;
}

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

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

.btn-primary:hover {
  background: var(--color-primary-blue-hover);
  transform: translateY(-1px);
  box-shadow: var(--shadow-glow);
}

/* Secondary Button */
.btn-secondary {
  background: var(--color-gray-200);
  color: var(--color-gray-800);
  border: 1px solid var(--color-gray-300);
}

.btn-secondary:hover {
  background: var(--color-gray-300);
  border-color: var(--color-gray-400);
  color: var(--color-gray-900);
}

/* Success Button */
.btn-success {
  background: var(--color-success-green);
  color: white;
}

.btn-success:hover {
  background: var(--color-success-green-hover);
  box-shadow: 0 0 20px rgb(34 197 94 / 40%);
}

/* Danger Button */
.btn-danger {
  background: var(--color-error-red);
  color: white;
}

/* ============================================================================
   NAVIGATION BUTTON STYLES
   ============================================================================ */

/* Navigation buttons from list-spot-3step.css */
#nextBtn, #submitBtn {
  background: linear-gradient(135deg, var(--primary-blue) 0%, #8b5cf6 100%);
  color: white;
  box-shadow: var(--shadow-subtle);
}

#nextBtn:hover, #submitBtn:hover {
  background: linear-gradient(135deg, var(--primary-blue-hover) 0%, #7c3aed 100%);
  box-shadow: var(--shadow-elevated);
}

#prevBtn {
  background: linear-gradient(135deg, #f3f4f6 0%, #e5e7eb 100%);
  color: #374151;
  border: 1px solid var(--border-light);
}

#prevBtn:hover {
  background: linear-gradient(135deg, #e5e7eb 0%, #d1d5db 100%);
  color: #1f2937;
}

/* Dark mode navigation buttons */
.dark #prevBtn {
  background: linear-gradient(135deg, #374151 0%, #4b5563 100%);
  color: #e5e7eb;
  border-color: var(--border-dark);
}

.dark #prevBtn:hover {
  background: linear-gradient(135deg, #4b5563 0%, #6b7280 100%);
  color: #f9fafb;
}

.btn-danger:hover {
  background: #dc2626;
  box-shadow: 0 0 20px rgb(239 68 68 / 40%);
}

/* Warning Button */
.btn-warning {
  background: var(--color-warning-yellow);
  color: white;
}

.btn-warning:hover {
  background: #d97706;
  box-shadow: 0 0 20px rgb(245 158 11 / 40%);
}

/* ============================================================================
   BUTTON SIZES
   ============================================================================ */

/* Small Button */
.btn-sm {
  padding: 0.375rem 0.75rem;
  font-size: 0.75rem;
  border-radius: var(--border-radius-sm);
}

/* Large Button */
.btn-lg {
  padding: 0.75rem 1.5rem;
  font-size: 1rem;
  border-radius: var(--border-radius-lg);
}

/* Extra Large Button */
.btn-xl {
  padding: 1rem 2rem;
  font-size: 1.125rem;
  border-radius: var(--border-radius-xl);
}

/* ============================================================================
   BUTTON STATES
   ============================================================================ */

/* Disabled Button */
button:disabled, .btn:disabled,
button.disabled, .btn.disabled {
  opacity: 0.5;
  cursor: not-allowed;
  pointer-events: none;
}

button:disabled:hover, .btn:disabled:hover,
button.disabled:hover, .btn.disabled:hover {
  transform: none;
  box-shadow: none;
}

/* Loading Button */
.btn.loading {
  position: relative;
  color: transparent;
}

.btn.loading::after {
  content: '';
  position: absolute;
  width: 1rem;
  height: 1rem;
  border: 2px solid transparent;
  border-top: 2px solid currentColor;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* ============================================================================
   BUTTON GROUPS
   ============================================================================ */

.btn-group {
  display: inline-flex;
  border-radius: var(--border-radius-base);
  overflow: hidden;
}

.btn-group .btn {
  border-radius: 0;
  border-right: 1px solid rgba(255, 255, 255, 0.2);
}

.btn-group .btn:first-child {
  border-top-left-radius: var(--border-radius-base);
  border-bottom-left-radius: var(--border-radius-base);
}

.btn-group .btn:last-child {
  border-top-right-radius: var(--border-radius-base);
  border-bottom-right-radius: var(--border-radius-base);
  border-right: none;
}

/* ============================================================================
   ENHANCED BUTTON EFFECTS
   ============================================================================ */

/* Enhanced Button with Ripple Effect */
.btn-enhanced {
  position: relative;
  overflow: hidden;
}

.btn-enhanced:active {
  transform: scale(0.98);
}

.btn-enhanced.loading {
  pointer-events: none;
}

/* Ripple Effect */
.btn-enhanced::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.3);
  transform: translate(-50%, -50%);
  transition: width 0.3s, height 0.3s;
}

.btn-enhanced:active::after {
  width: 300px;
  height: 300px;
}

/* ============================================================================
   DARK MODE SUPPORT
   ============================================================================ */

.dark .btn-secondary {
  background: var(--color-dark-surface);
  color: var(--color-dark-text);
  border-color: var(--color-dark-border);
}

.dark .btn-secondary:hover {
  background: var(--color-gray-700);
  border-color: var(--color-gray-600);
  color: var(--color-dark-text);
}

/* ============================================================================
   RESPONSIVE BUTTONS
   ============================================================================ */

@media (width <= 640px) {
  .btn-primary, .btn-secondary {
    padding: 0.75rem 1rem;
    font-size: 1rem;
    min-height: 48px;
  }

  .btn-group {
    flex-direction: column;
  }

  .btn-group .btn {
    border-radius: 0;
    border-right: none;
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
  }

  .btn-group .btn:first-child {
    border-top-left-radius: var(--border-radius-base);
    border-top-right-radius: var(--border-radius-base);
    border-bottom-left-radius: 0;
  }

  .btn-group .btn:last-child {
    border-top-right-radius: 0;
    border-bottom-left-radius: var(--border-radius-base);
    border-bottom-right-radius: var(--border-radius-base);
    border-bottom: none;
  }
}

/* ============================================================================
   ACCESSIBILITY
   ============================================================================ */

/* Focus styles for keyboard navigation */
.btn:focus-visible {
  outline: 2px solid var(--color-primary-blue);
  outline-offset: 2px;
}

/* High contrast mode support */
@media (prefers-contrast: high) {
  .btn {
    border: 2px solid currentColor;
  }

  .btn-primary {
    border-color: white;
  }

  .btn-secondary {
    border-color: var(--color-gray-800);
  }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
  .btn {
    transition: none;
  }

  .btn:hover {
    transform: none;
  }

  .btn-enhanced::after {
    transition: none;
  }
}

/* ============================================================================
   ENHANCED BUTTON STYLES FROM CUSTOM.CSS
   ============================================================================ */

/* Duplicate styles removed - already defined above */

/* Interactive button enhancements from custom.css */
.btn-enhanced {
  position: relative;
  transition: all var(--transition-base);
}

.btn-enhanced:active {
  transform: scale(0.98);
}

.btn-enhanced.loading {
  background-color: var(--color-success-green);
  color: white;
  border-color: var(--color-success-green);
}

/* Success indicator states from custom.css */
.success-state {
  background-color: var(--color-success-green);
  color: white;
  border-color: var(--color-success-green);
}

/* ============================================================================
   RESPONSIVE BUTTON ENHANCEMENTS
   ============================================================================ */

@media (width <= 640px) {
  .btn-primary, .btn-secondary {
    width: 100%;
    padding: 1rem;
    font-size: var(--font-size-lg);
  }
}
