/* Unified Button Design System for Monia Website */

/* Main brand gradient using the three brand colors */
:root {
  --monia-gradient: linear-gradient(45deg, #ff4ecd, #7b6cff, #00c3ff);
  --monia-gradient-animated: linear-gradient(45deg, #ff4ecd 0%, #7b6cff 50%, #00c3ff 100%);
}

/* Base button component - Default state: outline with gradient border */
.monia-button {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 12px 24px;
  border-radius: 25px;
  font-weight: 600;
  font-size: 16px;
  text-decoration: none;
  cursor: pointer;
  border: none;
  background: transparent;
  color: white;
  transition: all 0.3s cubic-bezier(0.2, 0.8, 0.2, 1);
  overflow: hidden;
  z-index: 1;
  min-height: 48px;
  font-family: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
}

/* Gradient border effect */
.monia-button::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  border-radius: inherit;
  padding: 2px;
  background: var(--monia-gradient);
  mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  mask-composite: exclude;
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  z-index: -1;
}

/* Hover state: fill with gradient background */
.monia-button:hover {
  color: white;
  transform: translateY(-1px);
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

.monia-button:hover::before {
  background: var(--monia-gradient);
  mask: none;
  -webkit-mask: none;
}

/* Active state */
.monia-button:active {
  transform: translateY(0);
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

/* Focus state for accessibility */
.monia-button:focus-visible {
  outline: 2px solid #00c3ff;
  outline-offset: 2px;
}

/* Size variants */
.monia-button--small {
  padding: 8px 16px;
  font-size: 14px;
  min-height: 36px;
  border-radius: 18px;
}

.monia-button--large {
  padding: 16px 32px;
  font-size: 18px;
  min-height: 56px;
  border-radius: 28px;
}

/* Animated variant for header buttons */
.monia-button--animated::before {
  background: linear-gradient(45deg, #ff4ecd, #7b6cff, #00c3ff, #ff4ecd);
  background-size: 300% 300%;
  animation: gradientShift 3s ease-in-out infinite;
}

@keyframes gradientShift {
  0%, 100% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
}

.monia-button--animated:hover::before {
  animation-duration: 1.5s;
}

/* Mobile optimizations */
@media (max-width: 768px) {
  .monia-button {
    padding: 14px 20px;
    font-size: 16px;
    min-height: 48px;
  }
  
  .monia-button--small {
    padding: 10px 16px;
    font-size: 14px;
    min-height: 40px;
  }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
  .monia-button,
  .monia-button:hover,
  .monia-button:active {
    transition: none;
    transform: none;
  }
  
  .monia-button--animated::before {
    animation: none;
  }
}

/* High contrast mode support */
@media (prefers-contrast: high) {
  .monia-button {
    border: 2px solid white;
  }
  
  .monia-button::before {
    background: white;
  }
  
  .monia-button:hover {
    background: white;
    color: black;
  }
}

/* Loading state */
.monia-button--loading {
  pointer-events: none;
  color: transparent;
}

.monia-button--loading::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 20px;
  height: 20px;
  margin: -10px 0 0 -10px;
  border: 2px solid transparent;
  border-top: 2px solid currentColor;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

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

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

/* Legacy SVG button compatibility - for gradual migration */
.monia-svg-button {
  background: transparent;
  border: none;
  padding: 0;
  cursor: pointer;
  outline: none;
  display: block;
  transition: all 0.3s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.monia-svg-button:hover {
  transform: translateY(-1px);
  filter: drop-shadow(0 8px 25px rgba(0, 0, 0, 0.15));
}

.monia-svg-button svg {
  display: block;
}

/* Specific button variants for different contexts */

/* Primary CTA button */
.monia-button--primary {
  background: var(--monia-gradient);
  color: white;
}

.monia-button--primary::before {
  display: none;
}

.monia-button--primary:hover {
  background: linear-gradient(45deg, #e63db8, #6b5ce6, #00b0e6);
  transform: translateY(-1px) scale(1.02);
}

/* Secondary button */
.monia-button--secondary {
  background: rgba(255, 255, 255, 0.1);
  color: white;
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.monia-button--secondary::before {
  display: none;
}

.monia-button--secondary:hover {
  background: rgba(255, 255, 255, 0.2);
  border-color: rgba(255, 255, 255, 0.3);
}

/* Ghost button (transparent with border) */
.monia-button--ghost {
  background: transparent;
  color: white;
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.monia-button--ghost::before {
  display: none;
}

.monia-button--ghost:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.3);
}