/**
 * Material Design 3 - Button Components
 *
 * Includes filled, outlined, text, and icon button styles.
 * All buttons include proper hover, focus, active, and disabled states.
 */

/* ===== MD3 Filled Button ===== */
/* Primary action button with solid background */
.md-filled-button {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 48px;
  height: 40px;
  padding: 0 24px;
  font-family: 'Roboto', sans-serif;
  font-size: 14px;
  font-weight: 500;
  letter-spacing: 0.1px;
  line-height: 40px;
  text-align: center;
  text-decoration: none;
  color: var(--md-sys-color-on-primary);
  background-color: var(--md-sys-color-primary);
  border: none;
  border-radius: 20px;
  cursor: pointer;
  overflow: hidden;
  transition: box-shadow var(--md-sys-motion-duration-short) var(--md-sys-motion-easing-standard);
}

/* Hover state overlay */
.md-filled-button::before {
  content: '';
  position: absolute;
  inset: 0;
  background: var(--md-sys-color-on-primary);
  opacity: 0;
  transition: opacity var(--md-sys-motion-duration-short) var(--md-sys-motion-easing-standard);
}

.md-filled-button:hover {
  box-shadow: var(--md-sys-elevation-1);
}

.md-filled-button:hover::before {
  opacity: 0.08;
}

.md-filled-button:focus::before {
  opacity: 0.12;
}

.md-filled-button:active {
  box-shadow: none;
}

/* Ripple effect */
.md-filled-button::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  background: rgba(255, 255, 255, 0.3);
  border-radius: 50%;
  transform: translate(-50%, -50%);
  opacity: 0;
}

.md-filled-button:active::after {
  width: 200%;
  height: 200%;
  opacity: 1;
  transition: width 0.3s ease-out, height 0.3s ease-out, opacity 0.3s ease-out;
}

/* Button text should be above overlays */
.md-filled-button span {
  position: relative;
  z-index: 1;
}

/* Disabled state */
.md-filled-button:disabled {
  background-color: rgba(0, 0, 0, 0.12);
  color: rgba(0, 0, 0, 0.38);
  cursor: not-allowed;
  box-shadow: none;
}

.md-filled-button:disabled::before,
.md-filled-button:disabled::after {
  display: none;
}

/* Full width modifier */
.md-filled-button.full-width {
  width: 100%;
}


/* ===== MD3 Outlined Button ===== */
/* Secondary action button with border */
.md-outlined-button {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 48px;
  height: 40px;
  padding: 0 24px;
  font-family: 'Roboto', sans-serif;
  font-size: 14px;
  font-weight: 500;
  letter-spacing: 0.1px;
  line-height: 40px;
  text-align: center;
  text-decoration: none;
  color: var(--md-sys-color-primary);
  background: transparent;
  border: 1px solid var(--md-sys-color-outline);
  border-radius: 20px;
  cursor: pointer;
  overflow: hidden;
  transition: background-color var(--md-sys-motion-duration-short) var(--md-sys-motion-easing-standard);
}

.md-outlined-button:hover {
  background-color: rgba(139, 90, 43, 0.08);
}

.md-outlined-button:focus {
  background-color: rgba(139, 90, 43, 0.12);
}

.md-outlined-button:active {
  background-color: rgba(139, 90, 43, 0.12);
}

.md-outlined-button span {
  position: relative;
  z-index: 1;
}

/* Disabled state */
.md-outlined-button:disabled {
  color: rgba(0, 0, 0, 0.38);
  border-color: rgba(0, 0, 0, 0.12);
  cursor: not-allowed;
}

.md-outlined-button:disabled:hover {
  background: transparent;
}


/* ===== MD3 Text Button ===== */
/* Low-emphasis button without background */
.md-text-button {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 48px;
  height: 40px;
  padding: 0 12px;
  font-family: 'Roboto', sans-serif;
  font-size: 14px;
  font-weight: 500;
  letter-spacing: 0.1px;
  color: var(--md-sys-color-primary);
  background: transparent;
  border: none;
  border-radius: 20px;
  cursor: pointer;
  text-decoration: none;
  transition: background-color var(--md-sys-motion-duration-short) var(--md-sys-motion-easing-standard);
}

.md-text-button:hover {
  background-color: rgba(139, 90, 43, 0.08);
}

.md-text-button:focus {
  background-color: rgba(139, 90, 43, 0.12);
}

.md-text-button:active {
  background-color: rgba(139, 90, 43, 0.12);
}

/* Disabled state */
.md-text-button:disabled {
  color: rgba(0, 0, 0, 0.38);
  cursor: not-allowed;
}

.md-text-button:disabled:hover {
  background: transparent;
}


/* ===== Icon Button ===== */
/* Round button containing only an icon */
.icon-button {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  border: none;
  background: transparent;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--md-sys-color-on-surface);
  transition: background-color var(--md-sys-motion-duration-short) var(--md-sys-motion-easing-standard);
}

.icon-button:hover {
  background-color: rgba(32, 26, 23, 0.08);
}

.icon-button:focus {
  background-color: rgba(32, 26, 23, 0.12);
}

.icon-button:active {
  background-color: rgba(32, 26, 23, 0.12);
}

.icon-button .material-symbols-outlined {
  font-size: 24px;
}

/* Icon button in primary container context */
.icon-button.on-primary-container {
  color: var(--md-sys-color-on-primary-container);
}

.icon-button.on-primary-container:hover {
  background-color: rgba(0, 0, 0, 0.08);
}

/* Disabled state */
.icon-button:disabled {
  color: rgba(0, 0, 0, 0.38);
  cursor: not-allowed;
}

.icon-button:disabled:hover {
  background: transparent;
}


/* ===== Filled Tonal Button ===== */
/* Medium-emphasis button with tonal background */
.md-filled-tonal-button {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 48px;
  height: 40px;
  padding: 0 24px;
  font-family: 'Roboto', sans-serif;
  font-size: 14px;
  font-weight: 500;
  letter-spacing: 0.1px;
  line-height: 40px;
  text-align: center;
  text-decoration: none;
  color: var(--md-sys-color-on-secondary-container);
  background-color: var(--md-sys-color-secondary-container);
  border: none;
  border-radius: 20px;
  cursor: pointer;
  overflow: hidden;
  transition: box-shadow var(--md-sys-motion-duration-short) var(--md-sys-motion-easing-standard);
}

.md-filled-tonal-button:hover {
  box-shadow: var(--md-sys-elevation-1);
}

.md-filled-tonal-button:active {
  box-shadow: none;
}

.md-filled-tonal-button span {
  position: relative;
  z-index: 1;
}

/* Disabled state */
.md-filled-tonal-button:disabled {
  background-color: rgba(0, 0, 0, 0.12);
  color: rgba(0, 0, 0, 0.38);
  cursor: not-allowed;
}
