/* Moving Arrow Button Animations for OTE Child Theme
   Adds animated arrow icons to "View Details" buttons and OTE Primary buttons */

/* Club button base styles are handled in design-system.css */

/* Add moving arrow via pseudo-element */
.wp-block-button__link.wp-element-button[href*="clubs/"]:not([class*="no-arrow"])::after {
  content: '';
  display: inline-block;
  width: 16px;
  height: 16px;
  background-image: url("data:image/svg+xml,%3Csvg width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='2' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M5 12h14M12 5l7 7-7 7'/%3E%3C/svg%3E");
  background-size: contain;
  background-repeat: no-repeat;
  background-position: center;
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  transform: translateX(0);
  margin-left: 6px;
  flex-shrink: 0;
}

/* Hover animations */
.wp-block-button__link.wp-element-button[href*="clubs/"]:not([class*="no-arrow"]):hover::after {
  transform: translateX(6px);
}

/* Club button hover styles are handled in design-system.css */

/* Active state handled in design-system.css */

/* Focus state for accessibility */
.wp-block-button__link.wp-element-button[href*="clubs/"]:not([class*="no-arrow"]):focus-visible {
  outline: 2px solid #2d5f3f;
  outline-offset: 2px;
}

/* Make sure the arrow doesn't interfere with text selection */
.wp-block-button__link.wp-element-button[href*="clubs/"]:not([class*="no-arrow"])::after {
  pointer-events: none;
}

/* ================== DARK MODE SUPPORT ================== */
/* Dark Mode for Club Buttons */
@media (prefers-color-scheme: dark) {
  .wp-block-button__link.wp-element-button[href*="clubs/"] {
    background: var(--button-primary-bg-hover) !important;
    color: var(--text-inverse) !important;
  }
  
  .wp-block-button__link.wp-element-button[href*="clubs/"]:hover {
    background: #5a8c69 !important;
  }
}

/* WordPress Dark Mode Data Attribute Support */
[data-theme="dark"] .wp-block-button__link.wp-element-button[href*="clubs/"],
.dark-theme .wp-block-button__link.wp-element-button[href*="clubs/"],
.dark-mode .wp-block-button__link.wp-element-button[href*="clubs/"],
body.dark .wp-block-button__link.wp-element-button[href*="clubs/"] {
  background: var(--button-primary-bg-hover) !important;
  color: #ffffff !important;
}

[data-theme="dark"] .wp-block-button__link.wp-element-button[href*="clubs/"]:hover,
.dark-theme .wp-block-button__link.wp-element-button[href*="clubs/"]:hover,
.dark-mode .wp-block-button__link.wp-element-button[href*="clubs/"]:hover,
body.dark .wp-block-button__link.wp-element-button[href*="clubs/"]:hover {
  background: #5a8c69 !important;
  box-shadow: 0 4px 12px rgba(74, 124, 89, 0.4);
}

/* Alternative targeting dark mode */
[data-theme="dark"] a[href*="/clubs/"].wp-element-button,
[data-theme="dark"] .wp-block-button a[href*="/clubs/"],
.dark-theme a[href*="/clubs/"].wp-element-button,
.dark-theme .wp-block-button a[href*="/clubs/"],
.dark-mode a[href*="/clubs/"].wp-element-button,
.dark-mode .wp-block-button a[href*="/clubs/"],
body.dark a[href*="/clubs/"].wp-element-button,
body.dark .wp-block-button a[href*="/clubs/"] {
  background: var(--button-primary-bg-hover) !important;
  color: #ffffff !important;
}

[data-theme="dark"] a[href*="/clubs/"].wp-element-button:hover,
[data-theme="dark"] .wp-block-button a[href*="/clubs/"]:hover,
.dark-theme a[href*="/clubs/"].wp-element-button:hover,
.dark-theme .wp-block-button a[href*="/clubs/"]:hover,
.dark-mode a[href*="/clubs/"].wp-element-button:hover,
.dark-mode .wp-block-button a[href*="/clubs/"]:hover,
body.dark a[href*="/clubs/"].wp-element-button:hover,
body.dark .wp-block-button a[href*="/clubs/"]:hover {
  background: #5a8c69 !important;
  box-shadow: 0 4px 12px rgba(74, 124, 89, 0.4);
}

/* ================== OTE PRIMARY BUTTONS WITH ARROWS ================== */
/* Target OTE Primary buttons and add moving arrow animation */
.wp-block-button.is-style-ote-primary .wp-block-button__link.wp-element-button {
  position: relative !important;
  display: inline-flex !important;
  align-items: center !important;
  gap: 8px !important;
}

/* Add moving arrow to OTE Primary buttons (but not if they already have one from clubs href) */
.wp-block-button.is-style-ote-primary .wp-block-button__link.wp-element-button:not([href*="clubs/"])::after {
  content: '';
  display: inline-flex;
  align-items: center;
  width: 16px;
  height: 16px;
  background-image: url("data:image/svg+xml,%3Csvg width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='2' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M5 12h14M12 5l7 7-7 7'/%3E%3C/svg%3E");
  background-size: contain;
  background-repeat: no-repeat;
  background-position: center;
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  transform: translateX(0);
  flex-shrink: 0;
  pointer-events: none;
}

/* Hover animation for OTE Primary buttons (but not if they already have one from clubs href) */
.wp-block-button.is-style-ote-primary .wp-block-button__link.wp-element-button:not([href*="clubs/"]):hover::after {
  transform: translateX(6px);
}

/* Enhanced hover effects for OTE Primary buttons */
.wp-block-button.is-style-ote-primary .wp-block-button__link.wp-element-button:hover {
  transform: translateY(-1px);
  filter: brightness(1.08);
  box-shadow: 0 6px 16px rgba(45, 95, 63, 0.25);
}

/* Club button base styles are handled in design-system.css 
   Only arrow animations are defined here */

a[href*="/clubs/"].wp-element-button::after,
.wp-block-button a[href*="/clubs/"]::after {
  content: '';
  display: inline-block;
  width: 16px;
  height: 16px;
  background-image: url("data:image/svg+xml,%3Csvg width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='2' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M5 12h14M12 5l7 7-7 7'/%3E%3C/svg%3E");
  background-size: contain;
  background-repeat: no-repeat;
  background-position: center;
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  transform: translateX(0);
  margin-left: 4px;
}

a[href*="/clubs/"].wp-element-button:hover::after,
.wp-block-button a[href*="/clubs/"]:hover::after {
  transform: translateX(6px);
}

/* Club button hover styles are handled in design-system.css */

/* Mobile styling to match organization-grid */
@media (max-width: 639px) {
  .wp-block-button__link.wp-element-button[href*="clubs/"],
  a[href*="/clubs/"].wp-element-button,
  .wp-block-button a[href*="/clubs/"] {
    padding: 6px 8px !important;
    font-size: 13px !important;
  }
}