/* ============================================
   BUTTONS.CSS - Button Components
   Primary, Secondary, with ripple effects
   ============================================ */

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

.btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  pointer-events: none;
}

/* Primary Button */
.btn-primary {
  background: var(--accent-primary);
  color: white;
  box-shadow: 0 4px 14px 0 rgba(255, 0, 0, 0.3);
}

.btn-primary:hover {
  background: var(--accent-hover);
  transform: translateY(-2px);
  box-shadow: 0 6px 20px 0 rgba(255, 0, 0, 0.4);
}

.btn-primary:active {
  transform: translateY(0);
  box-shadow: 0 2px 8px 0 rgba(255, 0, 0, 0.3);
}

/* Dark mode glow */
.dark .btn-primary {
  box-shadow: var(--digital-glow-red-md);
}

.dark .btn-primary:hover {
  box-shadow: var(--digital-glow-red-lg);
}

/* Secondary Button */
.btn-secondary {
  background: transparent;
  color: var(--text-primary);
  border: 2px solid var(--accent-primary);
}

.btn-secondary:hover {
  background: var(--accent-primary);
  color: white;
  transform: translateY(-2px);
  box-shadow: 0 4px 14px 0 rgba(255, 0, 0, 0.3);
}

.btn-secondary:active {
  transform: translateY(0);
}

/* Outline Button */
.btn-outline {
  background: transparent;
  color: var(--accent-primary);
  border: 2px solid var(--border-medium);
}

.btn-outline:hover {
  border-color: var(--accent-primary);
  color: var(--accent-hover);
}

/* Ghost Button */
.btn-ghost {
  background: transparent;
  color: var(--text-primary);
  border: none;
}

.btn-ghost:hover {
  background: var(--bg-secondary);
}

/* Size Variants */
.btn-sm {
  padding: 0.5rem 1.25rem;
  font-size: 0.875rem;
}

.btn-lg {
  padding: 1.125rem 2.5rem;
  font-size: 1.125rem;
}

/* Full Width */
.btn.w-full {
  width: 100%;
}

/* Icon Buttons */
.btn i {
  transition: transform var(--transition-fast);
}

.btn:hover i {
  transform: translateX(3px);
}

/* Button with Loader */
.btn-loader {
  display: none;
}

.btn .btn-text,
.btn .btn-loader {
  transition: opacity var(--transition-fast);
}

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

.btn:active::after {
  width: 300px;
  height: 300px;
  transition: 0s;
}

/* Button Group */
.btn-group {
  display: inline-flex;
  gap: 1rem;
  flex-wrap: wrap;
}

.btn-group .btn {
  flex: 1;
  min-width: max-content;
}

@media (max-width: 768px) {
  .btn-group {
    flex-direction: column;
  }

  .btn-group .btn {
    width: 100%;
  }
}

/* Special: Submit Button States */
.btn-submit.loading .btn-text {
  display: none;
}

.btn-submit.loading .btn-loader {
  display: inline-block;
}

.btn-submit .btn-loader i {
  animation: spin 1s linear infinite;
}

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

/* Back to Top Button */
.back-to-top {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  width: 50px;
  height: 50px;
  border-radius: 50%;
  background: var(--accent-primary);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 14px 0 rgba(255, 0, 0, 0.3);
  opacity: 0;
  visibility: hidden;
  transition: all var(--transition-base);
  z-index: 1000;
}

.back-to-top.visible {
  opacity: 1;
  visibility: visible;
}

.back-to-top:hover {
  transform: translateY(-4px);
  box-shadow: 0 6px 20px 0 rgba(255, 0, 0, 0.4);
}

.dark .back-to-top {
  box-shadow: var(--digital-glow-red-md);
}

.dark .back-to-top:hover {
  box-shadow: var(--digital-glow-red-lg);
}

@media (max-width: 768px) {
  .back-to-top {
    bottom: 1rem;
    right: 1rem;
    width: 45px;
    height: 45px;
  }
}
