/*!
 * SP_THEME Theme - Button Widget Styles
 * Comprehensive button styling for widgets and components
 * @package SP_THEME
 * @version 1.2.0
 */

/* ==========================================================================
   Base Button Styles
   ========================================================================== */

.btn,
.button,
.wp-block-button__link,
.widget-button {
  display: inline-block;
  padding: 0.72em 1.3em;
  font-family: var(--primaryFont);
  text-align: center;
  text-decoration: none;
  border-radius: var(--borderRadiusMd);
  cursor: pointer;
  transition: var(--transition);
  user-select: none;
  vertical-align: middle;
  white-space: nowrap;
  min-width: 100px;
  font-weight: 500;
  font-size: var(--fontBody);
  line-height: 1rem;
  border: 1px solid transparent;
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
  font-weight: 500;
}

.btn:focus,
.button:focus,
.wp-block-button__link:focus,
.widget-button:focus {
  outline: 2px solid var(--primaryColor);
  outline-offset: 2px;
}

.btn-link {
  color: var(--textColor );
  padding: 0 !important;
  font-size: var(--font-nl) !important;
  margin-top: 0px !important;
  text-decoration: underline !important;
  border-radius: 0 !important;
}

/* ==========================================================================
   Primary Button Styles
   ========================================================================== */

.btn-primary,
.button-primary,
.wp-block-button__link {
  color: var(--whiteColor);
  border-color: var(--primaryColor);
  background-color: var(--primaryColor);
}

.btn-primary:hover,
.btn-primary:focus,
.button-primary:hover,
.button-primary:focus,
.wp-block-button__link:hover,
.wp-block-button__link:focus {
  color: var(--whiteColor);
  background-color: var(--primaryColor-dark);
  border-color: var(--primaryColor-dark);
  transition: var(--transition);
}

.btn-primary:active,
.button-primary:active,
.wp-block-button__link:active {
  color: var(--whiteColor);
  background-color: var(--primaryColor-dark);
  border-color: var(--primaryColor-dark);
  transition: var(--transition);
}

/* ==========================================================================
   Secondary Button Styles
   ========================================================================== */

.btn-secondary,
.button-secondary {
  color: var(--whiteColor);
  border-color: var(--darkColor);
  background-color: var(--darkColor);
  text-transform: uppercase;
}

.btn-secondary:hover,
.btn-secondary:focus,
.button-secondary:hover,
.button-secondary:focus {
  color: var(--whiteColor);
  background-color: var(--primaryColor);
  border-color: var(--primaryColor);
  transition: var(--transition);
}

.btn-secondary:active,
.button-secondary:active {
  color: var(--whiteColor);
  background-color: var(--primaryColor);
  border-color: var(--primaryColor);
  box-shadow: 0 0 0 0.25rem rgba(251, 173, 2, 0.25);
  opacity: 0.8;
  transition: var(--transition);
}

/* ==========================================================================
   Outline Button Styles
   ========================================================================== */

.btn-outline,
.button-outline,
.wp-block-button.is-style-outline .wp-block-button__link {
  color: var(--darkColor);
  border-color: var(--darkColor);
  background-color: transparent;
}

.btn-outline:hover,
.btn-outline:focus,
.button-outline:hover,
.button-outline:focus,
.wp-block-button.is-style-outline .wp-block-button__link:hover,
.wp-block-button.is-style-outline .wp-block-button__link:focus {
  color: var(--whiteColor);
  background-color: var(--primaryColor);
  border-color: var(--primaryColor);
  transition: var(--transition);
}

.btn-outline:active,
.button-outline:active,
.wp-block-button.is-style-outline .wp-block-button__link:active {
  color: var(--whiteColor);
  background-color: var(--primaryColor);
  border-color: var(--primaryColor);
  box-shadow: 0 0 0 0.25rem rgba(251, 173, 2, 0.25);
  transition: var(--transition);
}

/* ==========================================================================
   Ghost Button Styles
   ========================================================================== */

.btn-ghost,
.button-ghost {
  background-color: transparent;
  color: #333;
  border-color: transparent;
  box-shadow: none;
}

.btn-ghost:hover,
.btn-ghost:focus,
.button-ghost:hover,
.button-ghost:focus {
  background-color: #f8f9fa;
  color: #007cba;
  border-color: #e9ecef;
  transform: none;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.btn-ghost:active,
.button-ghost:active {
  background-color: #e9ecef;
  color: #005a87;
}

/* ==========================================================================
   Button Sizes
   ========================================================================== */

.btn-small,
.button-small {
  padding: 0.5em 1em;
  font-size: 0.875em;
}

.btn-large,
.button-large {
  padding: 1em 2em;
  font-size: var(--fontBody);
}

.btn-xl,
.button-xl {
  padding: 1.25em 2.5em;
  font-size: 1.25em;
}

/* ==========================================================================
   Button States
   ========================================================================== */

.btn:disabled,
.button:disabled,
.btn.disabled,
.button.disabled {
  opacity: 0.6;
  cursor: not-allowed;
  pointer-events: none;
  transform: none;
  box-shadow: none;
}

.btn.loading,
.button.loading {
  position: relative;
  color: transparent;
  pointer-events: none;
}

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

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

/* ==========================================================================
   Button Groups
   ========================================================================== */

.btn-group,
.button-group {
  display: inline-flex;
  vertical-align: middle;
}

.btn-group .btn,
.btn-group .button,
.button-group .btn,
.button-group .button {
  margin: 0;
  border-radius: 0;
}

.btn-group .btn:first-child,
.btn-group .button:first-child,
.button-group .btn:first-child,
.button-group .button:first-child {
  border-top-left-radius: 4px;
  border-bottom-left-radius: 4px;
}

.btn-group .btn:last-child,
.btn-group .button:last-child,
.button-group .btn:last-child,
.button-group .button:last-child {
  border-top-right-radius: 4px;
  border-bottom-right-radius: 4px;
}

.btn-group .btn + .btn,
.btn-group .button + .button,
.button-group .btn + .btn,
.button-group .button + .button {
  border-left-width: 0;
}

/* ==========================================================================
   Widget-Specific Button Styles
   ========================================================================== */

/* Widget Submit Buttons */
/* .widget .button,
.widget input[type="submit"],
.widget button[type="submit"] {
  width: 100%;
  margin-top: 1em;
} */

/* Search Widget Button */
.widget_search .search-submit {
  background-color: #007cba;
  color: #fff;
  border: none;
  padding: 0.75em 1.5em;
  border-radius: 4px;
  cursor: pointer;
  font-weight: var(--fontWeightSimeBold);
  transition: all 0.3s ease;
}

.widget_search .search-submit:hover,
.widget_search .search-submit:focus {
  background-color: #005a87;
  transform: translateY(-1px);
  box-shadow: 0 2px 4px rgba(0, 124, 186, 0.3);
}

/* Custom Widget Buttons */
.widget_sp_theme_widget .theme-button {
  background: linear-gradient(135deg, #007cba 0%, #005a87 100%);
  color: #fff;
  padding: 0.75em 1.5em;
  border: none;
  border-radius: 25px;
  text-decoration: none;
  display: inline-block;
  font-weight: var(--fontWeightSimeBold);
  transition: all 0.3s ease;
  box-shadow: 0 2px 4px rgba(0, 124, 186, 0.3);
  position: relative;
  overflow: hidden;
}

.widget_sp_theme_widget .theme-button::before {
  content: "";
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(255, 255, 255, 0.2),
    transparent
  );
  transition: left 0.5s;
}

.widget_sp_theme_widget .theme-button:hover::before {
  left: 100%;
}

.widget_sp_theme_widget .theme-button:hover,
.widget_sp_theme_widget .theme-button:focus {
  background: linear-gradient(135deg, #005a87 0%, #004a73 100%);
  color: #fff;
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(0, 124, 186, 0.4);
}

/* ==========================================================================
   Icon Buttons
   ========================================================================== */

.btn-icon,
.button-icon {
  display: inline-flex;
  align-items: center;
  gap: 0.5em;
}

.btn-icon-only,
.button-icon-only {
  width: 2.5em;
  height: 2.5em;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
}

.btn-icon-only.btn-small,
.button-icon-only.button-small {
  width: 2em;
  height: 2em;
}

.btn-icon-only.btn-large,
.button-icon-only.button-large {
  width: 3em;
  height: 3em;
}

/* ==========================================================================
   Responsive Design
   ========================================================================== */

@media (max-width: 768px) {
  .btn,
  .button,
  .wp-block-button__link {
    padding: 0.625em 1.25em;
    font-size: 0.95em;
  }

  .btn-large,
  .button-large {
    padding: 0.875em 1.75em;
    font-size: 1.05em;
  }

  .btn-xl,
  .button-xl {
    padding: 1em 2em;
    font-size: 1.125em;
  }

  .btn-group,
  .button-group {
    flex-direction: column;
  }

  .btn-group .btn,
  .btn-group .button,
  .button-group .btn,
  .button-group .button {
    border-radius: 4px;
    margin-bottom: 0.5em;
  }

  .btn-group .btn:last-child,
  .btn-group .button:last-child,
  .button-group .btn:last-child,
  .button-group .button:last-child {
    margin-bottom: 0;
  }
}

/* ==========================================================================
   Accessibility
   ========================================================================== */

/* High contrast mode */
@media (prefers-contrast: high) {
  .btn,
  .button,
  .wp-block-button__link {
    border-width: 2px;
  }
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  .btn,
  .button,
  .wp-block-button__link,
  .theme-button {
    transition: none;
  }

  .btn:hover,
  .button:hover,
  .wp-block-button__link:hover,
  .theme-button:hover {
    transform: none;
  }

  .btn.loading::after,
  .button.loading::after {
    animation: none;
  }
}

/* Focus visible for keyboard navigation */
.btn:focus-visible,
.button:focus-visible,
.wp-block-button__link:focus-visible {
  outline: 2px solid var(--primaryColor);
  outline-offset: 2px;
}

/* ==========================================================================
   Print Styles
   ========================================================================== */

@media print {
  .btn,
  .button,
  .wp-block-button__link {
    background: transparent !important;
    color: #000 !important;
    border: 1px solid #000 !important;
    box-shadow: none !important;
    text-decoration: underline;
  }
}
