/* ==========================================================================
   Button Component - ボタンコンポーネント
   ========================================================================== */

/* Base Button Styles */
:where(.c-button) {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 14px 32px;
  font-size: 1.6rem;
  font-weight: 500;
  letter-spacing: 0.05em;
  text-decoration: none;
  border-radius: 999px;
  transition: all 0.3s ease;
  cursor: pointer;
  position: relative;
  border: 2px solid transparent;
}

/* Outline Style (Default) - White background with colored border */
:where(.c-button--outline) {
  background: white;
  border: 2px solid currentColor;
}

:where(.c-button--outline:hover) {
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.1);
  opacity: 0.9;
}

/* Primary Color Variants */
:where(.c-button--primary) {
  color: var(--wp--preset--color--primary);
  border-color: var(--wp--preset--color--primary);
}

:where(.c-button--primary.c-button--filled) {
  background: var(--wp--preset--color--primary);
  color: white;
  border-color: var(--wp--preset--color--primary);
}

:where(.c-button--primary:hover) {
  box-shadow: 0 6px 20px rgba(118, 197, 118, 0.3);
}

/* Text Color Border Variant - White background with text color border */
:where(.c-button--text-border) {
  background: white;
  color: var(--wp--preset--color--basic-text);
  border-color: var(--wp--preset--color--basic-text);
}

:where(.c-button--text-border:hover) {
  background: var(--wp--preset--color--gray-lighter);
}

/* Accent Color Variants */
:where(.c-button--accent) {
  color: var(--wp--preset--color--secondary);
  border-color: var(--wp--preset--color--secondary);
}

:where(.c-button--accent.c-button--filled) {
  background: var(--wp--preset--color--secondary);
  color: white;
  border-color: var(--wp--preset--color--secondary);
}

:where(.c-button--accent:hover) {
  box-shadow: 0 6px 20px rgba(219, 87, 165, 0.3);
}

/* Secondary Color Variants */
:where(.c-button--secondary) {
  color: var(--wp--preset--color--basic-text);
  border-color: var(--wp--preset--color--gray-400);
}

:where(.c-button--secondary.c-button--filled) {
  background: var(--wp--preset--color--gray-600);
  color: white;
  border-color: var(--wp--preset--color--gray-600);
}

:where(.c-button--secondary:hover) {
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.15);
}

/* Filled Style */
:where(.c-button--filled) {
  border: 2px solid transparent;
}

:where(.c-button--filled:hover) {
  opacity: 0.9;
}

/* Arrow Icon */
:where(.c-button__arrow) {
  display: inline-block;
  transition: transform 0.3s ease;
  font-size: 1.2em;
}

:where(.c-button:hover .c-button__arrow) {
  transform: translateX(4px);
}

/* Icon Support */
:where(.c-button__icon) {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
}

:where(.c-button .material-symbols-outlined) {
  font-size: 20px;
}

/* Size Variants */
:where(.c-button--small) {
  padding: 10px 24px;
  font-size: 1.4rem;
}

:where(.c-button--large) {
  padding: 18px 40px;
  font-size: 1.8rem;
}

:where(.c-button--large .material-symbols-outlined) {
  font-size: 24px;
}

/* Link Style - Text link with subtle border */
:where(.c-button--link) {
  background: transparent;
  color: var(--wp--preset--color--primary-700);
  border: 1px solid rgba(46, 91, 138, 0.2);
  padding: 8px 16px;
  font-size: 1.4rem;
  font-weight: 500;
  position: relative;
}

:where(.c-button--link::after) {
  content: "";
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 0;
  height: 1px;
  background: var(--wp--preset--color--primary-700);
  transition: width 0.3s ease;
}

:where(.c-button--link:hover) {
  color: var(--wp--preset--color--primary-500);
  background: rgba(118, 197, 118, 0.05);
  border-color: var(--wp--preset--color--primary-500);
  box-shadow: none;
}

:where(.c-button--link:hover::after) {
  width: 100%;
}

/* Full Width */
:where(.c-button--full) {
  width: 100%;
}

/* Disabled State */
:where(.c-button:disabled),
:where(.c-button--disabled) {
  opacity: 0.5;
  cursor: not-allowed;
  pointer-events: none;
}

/* Loading State */
:where(.c-button--loading) {
  color: transparent;
}

:where(.c-button--loading::after) {
  content: "";
  position: absolute;
  width: 16px;
  height: 16px;
  top: 50%;
  left: 50%;
  margin-left: -8px;
  margin-top: -8px;
  border: 2px solid currentColor;
  border-radius: 50%;
  border-top-color: transparent;
  animation: button-loading-spinner 0.6s linear infinite;
}

@keyframes button-loading-spinner {
  from {
    transform: rotate(0turn);
  }
  to {
    transform: rotate(1turn);
  }
}
