/* ================================================================
   M3 EXPRESSIVE ENHANCEMENTS — March 2026
   Inspired by m3.material.io design language
   Additional styling layered on top of extra.css
   ================================================================ */

/* ---- Floating Action Button style for primary CTAs ---- */
.md-typeset .md-button--primary.fab-style {
  border-radius: var(--sv-shape-lg) !important;
  padding: 1rem 2.5rem;
  font-size: 1rem;
  font-weight: 700;
  box-shadow: 0 3px 12px rgba(103, 80, 164, 0.3), 0 1px 4px rgba(103, 80, 164, 0.15);
  transition: box-shadow 0.3s cubic-bezier(0.2, 0, 0, 1), transform 0.2s cubic-bezier(0.2, 0, 0, 1);
}

.md-typeset .md-button--primary.fab-style:hover {
  box-shadow: 0 6px 20px rgba(103, 80, 164, 0.35), 0 2px 8px rgba(103, 80, 164, 0.2);
  transform: translateY(-1px);
}

.md-typeset .md-button--primary.fab-style:active {
  transform: translateY(0);
  box-shadow: 0 1px 6px rgba(103, 80, 164, 0.2);
}

/* ---- M3 Expressive Motion — spring easing curves ---- */
@keyframes m3-spring-enter {
  0% { transform: scale(0.85) translateY(16px); opacity: 0; }
  60% { transform: scale(1.02) translateY(-2px); opacity: 1; }
  100% { transform: scale(1) translateY(0); opacity: 1; }
}

@keyframes m3-emphasis-enter {
  0% { transform: scale(0.92); opacity: 0; }
  40% { transform: scale(1.04); opacity: 0.8; }
  70% { transform: scale(0.98); opacity: 1; }
  100% { transform: scale(1); opacity: 1; }
}

/* ---- Enhanced card elevation system (M3 5-level) ---- */
.grid.cards > ul > li {
  transition: border-color 0.3s cubic-bezier(0.2, 0, 0, 1),
              box-shadow 0.3s cubic-bezier(0.2, 0, 0, 1),
              transform 0.2s cubic-bezier(0.2, 0, 0, 1);
}

.grid.cards > ul > li:hover {
  border-color: var(--sv-primary);
  box-shadow: 0 1px 3px rgba(103, 80, 164, 0.05),
              0 4px 8px rgba(103, 80, 164, 0.08),
              0 8px 24px rgba(103, 80, 164, 0.06);
  transform: translateY(-2px);
}

/* ---- M3 Expressive segmented button style tabs ---- */
.md-typeset .tabbed-labels {
  box-shadow: inset 0 0 0 1px var(--sv-outline);
}

/* ---- Enhanced stat pills with M3 tonal coloring ---- */
.stat-pill {
  transition: transform 0.2s cubic-bezier(0.2, 0, 0, 1),
              box-shadow 0.2s cubic-bezier(0.2, 0, 0, 1);
}

.stat-pill:hover {
  transform: translateY(-1px);
  box-shadow: 0 2px 8px rgba(103, 80, 164, 0.1);
}

/* ---- M3 Expressive surface tint overlays ---- */
.hero-tagline {
  background: linear-gradient(135deg, var(--sv-on-surface) 0%, var(--sv-primary) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* ---- M3 Navigation rail style for desktop sidebar ---- */
@media screen and (min-width: 76.25em) {
  .md-sidebar--primary .md-nav__item--active > .md-nav__link {
    position: relative;
  }

  .md-sidebar--primary .md-nav__item--active > .md-nav__link::before {
    content: '';
    position: absolute;
    left: -4px;
    top: 50%;
    transform: translateY(-50%);
    width: 4px;
    height: 70%;
    background: var(--sv-primary);
    border-radius: var(--sv-shape-full);
    animation: m3-emphasis-enter 0.3s cubic-bezier(0.2, 0, 0, 1) both;
  }
}

/* ---- M3 Expressive bottom sheet style for mobile nav ---- */
@media screen and (max-width: 76.1875em) {
  .md-sidebar {
    border-radius: var(--sv-shape-xl) var(--sv-shape-xl) 0 0;
    box-shadow: 0 -4px 24px rgba(0, 0, 0, 0.08);
  }
}

/* ---- Enhanced platform badges with M3 tonal animation ---- */
.platform-badge {
  transition: background 0.2s cubic-bezier(0.2, 0, 0, 1),
              border-color 0.2s cubic-bezier(0.2, 0, 0, 1),
              transform 0.15s cubic-bezier(0.2, 0, 0, 1),
              box-shadow 0.2s cubic-bezier(0.2, 0, 0, 1);
}

.platform-badge:hover {
  transform: translateY(-1px);
  box-shadow: 0 2px 8px rgba(103, 80, 164, 0.12);
}

/* ---- M3 Expressive loading shimmer for async content ---- */
@keyframes m3-shimmer {
  0% { background-position: -200% 0; }
  100% { background-position: 200% 0; }
}

.loading-shimmer {
  background: linear-gradient(90deg,
    var(--sv-surface-container) 25%,
    var(--sv-surface-container-high) 50%,
    var(--sv-surface-container) 75%);
  background-size: 200% 100%;
  animation: m3-shimmer 1.5s ease-in-out infinite;
  border-radius: var(--sv-shape-lg);
}

/* ---- M3 Expressive focus indicators (accessibility) ---- */
.md-typeset .md-button:focus-visible,
.md-tabs__link:focus-visible,
.platform-badge:focus-visible {
  outline: 3px solid var(--sv-primary);
  outline-offset: 2px;
  border-radius: var(--sv-shape-full);
}

/* ---- Improved dark mode contrast for M3 compliance ---- */
[data-md-color-scheme="slate"] .grid.cards > ul > li {
  background: var(--sv-surface-container);
  border-color: var(--sv-outline);
}

[data-md-color-scheme="slate"] .grid.cards > ul > li:hover {
  box-shadow: 0 1px 3px rgba(167, 139, 250, 0.08),
              0 4px 8px rgba(167, 139, 250, 0.12),
              0 8px 24px rgba(167, 139, 250, 0.08);
}

[data-md-color-scheme="slate"] .stat-pill:hover {
  box-shadow: 0 2px 8px rgba(167, 139, 250, 0.15);
}

/* ---- M3 Expressive icon containers ---- */
.icon-container {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 56px;
  height: 56px;
  border-radius: var(--sv-shape-lg);
  background: var(--sv-primary-container);
  color: var(--sv-primary);
  font-size: 1.5rem;
  margin-bottom: 1rem;
}

[data-md-color-scheme="slate"] .icon-container {
  background: var(--sv-primary-container);
  color: var(--sv-primary);
}

/* ---- M3 Expressive responsive typography scale ---- */
@media screen and (min-width: 76.25em) {
  .md-typeset h1 { font-size: 2.5rem; }
  .bottom-cta h2 { font-size: 2.2rem; }
}

@media screen and (min-width: 100em) {
  .md-typeset h1 { font-size: 3rem; letter-spacing: -0.03em; }
  .bottom-cta h2 { font-size: 2.5rem; }
}

/* ---- Smooth page transitions ---- */
.md-content__inner {
  animation: spring-in 0.3s cubic-bezier(0.2, 0, 0, 1) both;
}

/* ---- M3 Chip component for tag-like elements ---- */
.m3-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.4rem 1.1rem;
  border-radius: var(--sv-shape-full);
  font-size: 0.82rem;
  font-weight: 600;
  background: var(--sv-surface-container);
  border: 1px solid var(--sv-outline);
  color: var(--sv-on-surface);
  transition: background 0.2s ease, border-color 0.2s ease;
  cursor: pointer;
}

.m3-chip:hover {
  background: var(--sv-primary-container);
  border-color: var(--sv-primary);
  color: var(--sv-primary);
}

.m3-chip--selected {
  background: var(--sv-primary);
  border-color: var(--sv-primary);
  color: var(--sv-on-primary);
}

/* ---- M3 Divider with decorative dot ---- */
.m3-divider {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin: 2.5rem 0;
  color: var(--sv-outline);
}

.m3-divider::before,
.m3-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--sv-outline-variant);
}

.m3-divider__dot {
  width: 6px;
  height: 6px;
  border-radius: var(--sv-shape-full);
  background: var(--sv-primary);
}

/* ---- Print styles ---- */
@media print {
  .md-header, .md-footer, .md-sidebar, .md-tabs {
    display: none !important;
  }
  
  .md-content {
    max-width: 100% !important;
    margin: 0 !important;
  }
  
  .hero-tagline {
    -webkit-text-fill-color: var(--sv-on-surface-variant);
    background: none;
  }
}

/* ---- Reduced motion preference ---- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
