/* Button Base Styles */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-family: inherit;
  font-weight: 600;
  text-decoration: none;
  border: 1.5px solid transparent;
  border-radius: 59px;
  cursor: pointer;
  line-height: 1;
  text-align: center;
  position: relative;
  overflow: hidden;
  isolation: isolate;
  transition: 
    background-color 0.3s ease,
    border-color 0.3s ease,
    color 0.3s ease,
    transform 0.2s ease;
  --circle-fill-color: rgba(0, 0, 0, 0.1);
  user-select: none;
  background-size: 100% 100%;
  background-position: center;
  background-repeat: no-repeat;
  transition: all 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.btn-scale-effect {
  position: relative;
  overflow: hidden;
  z-index: 1;
}

.btn-scale-effect::before { 
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 200px;
  height: 200px;
  border-radius: 50%;
  background-color: var(--circle-fill-color, rgba(0, 0, 0, 0.1));
  will-change: transform;
  transform: translate3d(-50%, -50%, 0) scale(0);
  transition: transform 0.6s cubic-bezier(0.4, 0, 0.2, 1);
  z-index: -1;
}

.btn-scale-effect:hover::before {
  transform: translate(-50%, -50%) scale(4);
}

/* Button Sizes */
.btn-sm {
  padding: 8px 16px;
  font-size: 14px;
  min-height: 36px;
}

.btn-md {
  padding: 12px 25px;
  font-size: 16px;
}

.btn-lg {
  padding: 16px 32px;
  font-size: 18px;
  min-height: 52px;
}

/* Button Color Variants */

/* Primary Button */
.btn-primary-color {
  background-color: #007cba;
  color: #ffffff !important;
  --circle-fill-color: #005a87;
}

/* .btn-primary-color:hover {
  background-color: #005a87;
} */

/* Secondary Button */
.btn-secondary-color {
  background-color: #6c757d;
  color: #ffffff;
  --circle-fill-color: rgba(255, 255, 255, 0.15);
}

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

/* Outline White Button */
.btn-outline-white-color {
  background-color: transparent;
  color: #fff !important;
  border: 1.5px solid #fff;
  --circle-fill-color: #fff;
}

.btn-outline-white-color:hover {
  color: #1e1b18 !important;
  background-color: transparent; /* Keep transparent to see circle effect */
}

/* Outline Black Button */
.btn-outline-black-color {
  background-color: transparent;
  color: #1e1b18 !important;
  border: 1.5px solid #1e1b18;
  --circle-fill-color: #1e1b18;
}

.btn-outline-black-color:hover {
  color: #ffffff !important;
  background-color: transparent;
}

/* Solid Black Button */
.btn-black-color {
  background: #1e1b18;
  color: #fff !important;
  --circle-fill-color: rgba(255, 255, 255, 0.2);
}

.btn-black-color:hover {
  background: #1e1b18; /* Keep solid color */
}

/* CTA Yellow Button */
.btn-cta-color {
  background: #feed30;
  color: #1e1b18 !important;
  --circle-fill-color: rgba(0, 0, 0, 0.2);
}

.btn-cta-color:hover {
  background: #feed30; /* Keep solid color */
}

/* Ensure text stays on top of circle effect */
.btn-circle-effect span,
.btn-scale-effect span,
.btn-circle-effect .btn-icon,
.btn-scale-effect .btn-icon {
  position: relative;
  z-index: 2;
}

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

/* Button States */

/* Active/Pressed State */
.btn:active {
  transform: translateY(1px);
  transition-duration: 0.1s;
}

/* Focus States for Accessibility */
.btn:focus {
  outline: 2px solid #007cba;
  outline-offset: 2px;
}

.btn:focus:not(:focus-visible) {
  outline: none;
}

.btn:focus-visible {
  outline: 2px solid currentColor;
  outline-offset: 2px;
}

/* Disabled State */
.btn:disabled,
.btn[disabled],
.btn.disabled {
  opacity: 0.65;
  cursor: not-allowed;
  pointer-events: none;
  background-image: none !important;
  transform: none !important;
}

/* Remove circle effect on disabled buttons */
.btn:disabled::before,
.btn[disabled]::before,
.btn.disabled::before {
  display: none;
}

/* Icon Styles */
.btn-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.3s ease;
}

.btn-icon-left {
  margin-right: 4px;
}

.btn-icon-right {
  margin-left: 4px;
}

.btn:hover .btn-icon-right {
  transform: translateX(4px);
}

.btn:hover .btn-icon-left {
  transform: translateX(-4px);
}

/* Loading State */
.btn-loading {
  position: relative;
  color: transparent !important;
  pointer-events: none;
}

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

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

/* Reduced Motion Preference */
@media (prefers-reduced-motion: reduce) {
  .btn,
  .btn:hover,
  .btn:active {
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
  }
  
  .btn::before {
    transition: none !important;
  }
  
  .btn-icon-right,
  .btn-icon-left {
    transform: none !important;
    transition: none !important;
  }
}