/* CSS Variables for theming */
:root {
  /* Light mode (default) */
  --bg-primary: #ffffff;
  --bg-secondary: #f5f5f5;
  --bg-tertiary: #e0e0e0;
  
  --text-primary: #000000;
  --text-secondary: #333333;
  --text-muted: #666666;
  
  --border-color: #ddd;
  --shadow-color: rgba(0, 0, 0, 0.2);
  
  --accent-primary: #007BFF;
  --accent-hover: #0056b3;
  
  --table-even: lightgrey;
  --table-odd: white;
  
  --success-color: #28a745;
  --error-color: #dc3545;
  
  --spinner-border: #f3f3f3;
  
  --link-color: rgb(0,0,238);
  --link-hover: #0000CC;
  
  /* Animation durations for consistent timing */
  --transition-fast: 0.15s;
  --transition-normal: 0.3s;
  --transition-slow: 0.5s;
  --transition-theme: 0.35s;
}

[data-theme="dark"] {
  /* Dark mode */
  --bg-primary: #1a1a1a;
  --bg-secondary: #2d2d2d;
  --bg-tertiary: #3a3a3a;
  
  --text-primary: #ffffff;
  --text-secondary: #e0e0e0;
  --text-muted: #a0a0a0;
  
  --border-color: #444;
  --shadow-color: rgba(0, 0, 0, 0.5);
  
  --accent-primary: #4a9eff;
  --accent-hover: #6bb0ff;
  
  --table-even: #2d2d2d;
  --table-odd: #242424;
  
  --success-color: #4caf50;
  --error-color: #f44336;
  
  --spinner-border: #444;
  
  --link-color: #4a9eff;
  --link-hover: #6bb0ff;
  
  /* Animation durations inherited from :root */
}

/* Smooth scrolling for the entire application */
html {
  scroll-behavior: smooth;
}

/* Page fade-in animation on load */
body {
  animation: fadeIn var(--transition-slow) ease-in;
  /* Smooth theme transitions - using individual properties for better performance */
  transition: 
    background-color var(--transition-theme) ease-in-out,
    color var(--transition-theme) ease-in-out;
}

/* Enable smooth theme transitions on all elements that use CSS variables */
*,
*::before,
*::after {
  transition: 
    background-color var(--transition-theme) ease-in-out,
    color var(--transition-theme) ease-in-out,
    border-color var(--transition-theme) ease-in-out,
    box-shadow var(--transition-theme) ease-in-out;
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

/* Accessibility: Respect user's motion preferences */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
  
  /* Ensure theme changes are instant for motion-sensitive users */
  body {
    transition: none !important;
  }
}

.leaderboard-container {
    display: flex;
    flex-direction: column;  
    border: 1vh solid var(--border-color);
    padding: 1vh;
    margin: 1vh;
    box-shadow: 0 0 1vh var(--shadow-color);
    background-color: var(--bg-secondary);
}

.leaderboard-table {
    width: 100%;
    border-collapse: collapse;
    background-color: var(--bg-primary);
    color: var(--text-primary);
    margin: 1%;
}


.leaderboard-table tbody tr {
    /* Keep explicit transitions for hover effects which are different from theme transitions */
    transition: transform 0.3s ease, opacity 0.3s ease;
    cursor: pointer;
}

.leaderboard-table tbody tr:hover {
    background-color: var(--bg-tertiary) !important;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px var(--shadow-color);
}

.leaderboard-table tbody tr:nth-child(even) {
    background-color: var(--table-even);
}

.leaderboard-table tbody tr:nth-child(odd) {
    background-color: var(--table-odd);
}

/* Shuffle animation for sorting */
.leaderboard-table tbody tr.shuffling {
    animation: shuffle 0.3s ease-in-out;
}

@keyframes shuffle {
    0% {
        transform: translateX(0);
        opacity: 1;
    }
    25% {
        transform: translateX(-8px);
        opacity: 0.7;
    }
    75% {
        transform: translateX(8px);
        opacity: 0.7;
    }
    100% {
        transform: translateX(0);
        opacity: 1;
    }
}

/* Staggered entry animation */
.leaderboard-table tbody tr.entering {
    animation: slideIn 0.4s ease-out forwards;
    opacity: 0;
    transform: translateY(-20px);
}

@keyframes slideIn {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.Leaderboard-header {
    display: flex;
    justify-content: center;
    align-items: center;
    text-align: center;
    color: var(--text-primary);
    font-weight: bold;
    font-size: 2rem;
}

#header-text {
    margin-right: 10vw;
    margin-left: 9vw;
}

#brown-logo img, #putr-logo img {
    width: 10vw;
    height: auto;
}

#putr-logo img {
    width: 14vw;
    height: auto;
}

.flag-container {
    display: flex;
    align-items: center;
    justify-content: center;
    /* width: 6vw; */
}

.player-flag {
    width: 5vw;
    margin: 1.5%;
    /* border: 0.2vh solid black; */
    /* box-shadow: 0 0 0.2vh 0.2vh rgba(243, 243, 243, 0.5); */
    
}

.player-putr {
    font-size: 2rem;
    text-align: center;
}

.player-net {
    font-size: 2rem;
    text-align: center;
}

.player-name {
    font-size: 2rem;
    text-align: center;
}

.player-name a {
    text-decoration: none;
    color: var(--link-color);
    /* Keep explicit transition for hover effect */
    transition: color 0.3s ease;
}

.player-name a:visited {
    text-decoration: none;
    color: var(--link-color);
}

.player-name a:hover {
    color: var(--link-hover);
}

#table-header th {
    background-color: var(--accent-primary);
    color: #fff;
    font-weight: bold;
    padding: 2vh;
    text-align: center;
    transition: all var(--transition-normal) ease;
    cursor: pointer;
}

#table-header th:hover {
    background-color: var(--accent-hover);
    transform: translateY(-2px);
    box-shadow: 0 4px 8px var(--shadow-color);
}

#table-header th:active {
    transform: translateY(0);
    transition-duration: var(--transition-fast);
}

body {
    background-color: var(--bg-secondary);
    color: var(--text-primary);
}

/* Loading spinner styles (deprecated - use skeleton screens instead) */
.spinner-container {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 4vh;
    text-align: center;
}

.spinner {
    border: 0.8vh solid var(--spinner-border);
    border-top: 0.8vh solid var(--accent-primary);
    border-radius: 50%;
    width: 8vh;
    height: 8vh;
    animation: spin 1s linear infinite;
}

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

.spinner-container p {
    margin-top: 2vh;
    font-size: 2rem;
    color: var(--text-secondary);
}

/* Skeleton Loading Animations */
/* Shimmer effect for loading states */
@keyframes shimmer {
    0% {
        background-position: -1000px 0;
    }
    100% {
        background-position: 1000px 0;
    }
}

/* Base skeleton styles */
.skeleton {
    background: linear-gradient(
        90deg,
        var(--bg-tertiary) 0%,
        var(--bg-secondary) 50%,
        var(--bg-tertiary) 100%
    );
    background-size: 1000px 100%;
    animation: shimmer 2s infinite linear;
    border-radius: 4px;
    display: inline-block;
    position: relative;
    overflow: hidden;
}

/* Skeleton utility classes for different shapes and sizes */
.skeleton-text {
    height: 1em;
    width: 100%;
    margin-bottom: 0.5em;
}

.skeleton-text-short {
    width: 60%;
}

.skeleton-text-medium {
    width: 80%;
}

.skeleton-circle {
    border-radius: 50%;
    width: 40px;
    height: 40px;
}

.skeleton-rect {
    width: 100%;
    height: 100px;
}

/* Skeleton table loading */
.skeleton-table {
    width: 100%;
    border-collapse: collapse;
    background-color: var(--bg-primary);
    color: var(--text-primary);
    margin: 1%;
}

.skeleton-table tbody tr {
    height: 60px;
}

.skeleton-table tbody tr:nth-child(even) {
    background-color: var(--table-even);
}

.skeleton-table tbody tr:nth-child(odd) {
    background-color: var(--table-odd);
}

.skeleton-table td {
    padding: 2vh;
    text-align: center;
}

.skeleton-flag {
    width: 5vw;
    height: 3vw;
    margin: 0 auto;
}

.skeleton-name {
    height: 1.5em;
    width: 80%;
    margin: 0 auto;
}

.skeleton-stat {
    height: 1.5em;
    width: 60%;
    margin: 0 auto;
}

/* Skeleton for profile page */
.skeleton-header {
    width: 300px;
    height: 3em;
    margin: 20px auto;
}

.skeleton-stat-card {
    flex: 1 1 24%;
    background-color: var(--bg-primary);
    border-radius: 10px;
    box-shadow: 0 2px 4px var(--shadow-color);
    padding: 20px;
    text-align: center;
    /* Keep explicit hover transition */
    transition: box-shadow 0.3s ease-in-out;
}

.skeleton-stat-value {
    height: 2em;
    width: 80%;
    margin: 10px auto;
}

.skeleton-stat-label {
    height: 1em;
    width: 60%;
    margin: 10px auto;
}

.skeleton-chart {
    width: 100%;
    height: 400px;
    margin-top: 20px;
}

/* Accessibility: Respect user's motion preferences for skeleton animations */
@media (prefers-reduced-motion: reduce) {
    .skeleton {
        animation: none;
        background: var(--bg-tertiary);
    }
}


.profile-container {
  text-align: center;
  padding: 20px;
}

button {
    padding: 1vh 4vh;
    text-decoration: none;
    color: #3498db;
    border: 1px solid #2980b9;
    border-radius: 5px;
    margin: 0.5%;
    font-size: 2vh;
    background-color: var(--bg-primary);
    cursor: pointer;
    transition: all var(--transition-normal) ease;
}

button:hover:not(:disabled) {
    background-color: #3498db;
    color: #fff;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px var(--shadow-color);
}

button:active:not(:disabled) {
    transform: translateY(0) scale(0.98);
    box-shadow: 0 2px 4px var(--shadow-color);
    transition-duration: var(--transition-fast);
}

button.highlight {
    border-color: #e67e22;
    color: #e67e22;
}

button.highlight:hover:not(:disabled) {
    background-color: #e67e22;
    color: #fff;
}

button.selected {
    background-color: #2980b9;
    color: #fff;
}

button.selected:hover:not(:disabled) {
    background-color: #21618c;
}

button.disabled,
button:disabled {
    color: #999;
    border-color: #ccc;
    cursor: not-allowed;
    background-color: #f4f4f4;
}

#lineChart {
    width: 100%;
    height: auto;
}

.range-bar {
    display: flex;
    flex-direction: column;
    margin-bottom: 20px;
}

.range-row {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 16px;
}

.range-option {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    min-width: 140px;
}

.range-metric {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.9em;
    font-weight: 600;
    color: var(--text-muted);
    background-color: var(--bg-tertiary);
    border-radius: 999px;
    padding: 4px 12px;
    min-height: 1.6em;
    min-width: 96px;
    /* Keep explicit transform transition for interactive effects */
    transition: transform 0.2s ease;
}

.range-metric.positive {
    background-color: rgba(46, 204, 113, 0.15);
    color: var(--success-color);
}

.range-metric.negative {
    background-color: rgba(231, 76, 60, 0.15);
    color: var(--error-color);
}

.range-metric.neutral {
    background-color: rgba(149, 165, 166, 0.15);
    color: var(--text-muted);
}

.range-option .range-btn.selected + .range-metric {
    transform: translateY(-1px);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.08);
}

.range-preview {
    margin-top: 12px;
    text-align: center;
    color: var(--text-muted);
    font-size: 0.95em;
    min-height: 1.5em;
}



/* 
#playerStats {
    display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
}

#playerStats .stat-card {
    flex: 0 1 25%;
} */


#stats-container {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 15px;
    margin-bottom: 50px;
  }
  
  .stat-card {
    flex: 1 1 24%;
    background-color: var(--bg-primary);
    border-radius: 10px;
    box-shadow: 0 2px 4px var(--shadow-color);
    padding: 20px;
    text-align: center;
    /* Keep explicit hover transition */
    transition: box-shadow 0.3s ease-in-out;
  }
  
  .stat-card:hover {
    box-shadow: 0 5px 15px var(--shadow-color);
  }
  
  .stat-value {
    font-size: 2em;
    font-weight: bold;
    color: var(--text-primary);
    margin: 10px 0;
  }
  
  .stat-label {
    font-size: 1em;
    color: var(--text-muted);
  }

/* Theme Toggle Button (for profile.html) */
.theme-toggle {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 1000;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 2px solid var(--border-color);
  background-color: var(--bg-primary);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 4px var(--shadow-color);
  padding: 8px;
  /* Explicit transitions for interactive effects */
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.theme-toggle:hover {
  background-color: var(--bg-tertiary);
  box-shadow: 0 3px 6px var(--shadow-color);
  transform: scale(1.05);
}

.theme-toggle:active {
  transform: scale(0.95);
  box-shadow: 0 1px 2px var(--shadow-color);
  transition-duration: 0.1s;
}

/* Theme Toggle Switch (for index.html) */
.theme-toggle-wrapper {
  display: flex;
  align-items: center;
  justify-content: center;
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 1000;
  padding: 0;
}

.theme-switch {
  position: relative;
  display: inline-block;
  width: 80px;
  height: 36px;
}

.theme-switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.theme-slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: var(--accent-primary);
  border-radius: 34px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 6px;
  box-shadow: 0 2px 4px var(--shadow-color);
  /* Explicit transition for the slider itself */
  transition: box-shadow 0.2s ease;
}

/* Sliding indicator */
.theme-slider:before {
  position: absolute;
  content: "";
  height: 28px;
  width: 28px;
  left: 4px;
  top: 50%;
  transform: translateY(-50%);
  background-color: white;
  border-radius: 50%;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
  z-index: 2;
  /* Smooth sliding animation */
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.2s ease;
}

.theme-switch input:checked + .theme-slider {
  background-color: var(--bg-tertiary);
}

.theme-switch input:checked + .theme-slider:before {
  transform: translate(44px, -50%);
}

/* Active state for press animation */
.theme-switch input:active + .theme-slider:before {
  transform: translateY(-50%) scale(0.95);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

.theme-switch input:checked:active + .theme-slider:before {
  transform: translate(44px, -50%) scale(0.95);
}

.theme-slider-label {
  font-size: 1.2rem;
  z-index: 1;
  transition: opacity 0.3s ease;
  user-select: none;
  line-height: 1;
  pointer-events: none;
}

.theme-slider-label.light {
  opacity: 1;
}

.theme-slider-label.dark {
  opacity: 0.4;
}

.theme-switch input:checked + .theme-slider .theme-slider-label.light {
  opacity: 0.4;
}

.theme-switch input:checked + .theme-slider .theme-slider-label.dark {
  opacity: 1;
}

.theme-switch:hover .theme-slider {
  box-shadow: 0 3px 6px var(--shadow-color);
}

.theme-switch:hover .theme-slider:before {
  box-shadow: 0 3px 6px rgba(0, 0, 0, 0.3);
}

.theme-toggle:hover .theme-icon {
  color: #ffffff;
}

.theme-icon {
  transition: all 0.3s ease;
  color: var(--text-primary);
  position: absolute;
}

.moon-icon {
  opacity: 1;
  transform: rotate(0deg) scale(1);
}

.sun-icon {
  opacity: 0;
  transform: rotate(180deg) scale(0);
}

[data-theme="dark"] .moon-icon {
  opacity: 0;
  transform: rotate(-180deg) scale(0);
}

[data-theme="dark"] .sun-icon {
  opacity: 1;
  transform: rotate(0deg) scale(1);
}

/* Slightly dim logos in dark mode */
[data-theme="dark"] #brown-logo img,
[data-theme="dark"] #putr-logo img {
  filter: brightness(0.9);
}

/* ============================================================================
   MODAL AND NOTIFICATION ANIMATIONS FRAMEWORK
   ============================================================================
   
   Story #93 - Comprehensive reusable animation framework for modal dialogs 
   and toast notifications. Combines features from both implementation approaches.
   
   FEATURES:
   - Modal animations with backdrop blur effects
   - 10 toast notification positions (6 edge-based + 4 corner-based)
   - Type-based styling (success, error, info)
   - GPU-accelerated properties only (transform + opacity)
   - Full accessibility support (prefers-reduced-motion)
   - Theme-agnostic (works with light/dark modes)
   
   USAGE EXAMPLES:
   
   Modal:
     overlay.classList.add('modal-backdrop', 'backdrop-enter');
     dialog.classList.add('modal-content', 'modal-enter');
   
   Toast:
     toast.classList.add('toast', 'toast-slide-top-right', 'success');
   
   Exit animations:
     element.classList.remove('modal-enter');
     element.classList.add('modal-exit');
   
   ============================================================================ */

/* ----------------------------------------------------------------------------
   MODAL DIALOG ANIMATIONS
   ---------------------------------------------------------------------------- */

/* Modal container - fixed positioned wrapper for centering */
.modal-container {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  pointer-events: none;
}

.modal-container.active {
  pointer-events: auto;
}

/* Modal content wrapper - the actual modal box */
.modal-content {
  background-color: var(--bg-primary);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  box-shadow: 0 10px 40px var(--shadow-color);
  padding: 24px;
  max-width: 90vw;
  max-height: 90vh;
  overflow: auto;
  position: relative;
  z-index: 10000;
}

/* Modal backdrop - semi-transparent overlay with blur */
.modal-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(0, 0, 0, 0.5);
  z-index: 9998;
  backdrop-filter: blur(4px);
}

/* Modal overlay animations (backdrop) */
.modal-overlay-enter,
.backdrop-enter {
  animation: backdropFadeIn 300ms ease-out forwards;
}

.modal-overlay-exit,
.backdrop-exit {
  animation: backdropFadeOut 300ms ease-in forwards;
}

@keyframes backdropFadeIn {
  from {
    opacity: 0;
    backdrop-filter: blur(0px);
  }
  to {
    opacity: 1;
    backdrop-filter: blur(4px);
  }
}

@keyframes backdropFadeOut {
  from {
    opacity: 1;
    backdrop-filter: blur(4px);
  }
  to {
    opacity: 0;
    backdrop-filter: blur(0px);
  }
}

/* Modal dialog enter/exit animations - fade + scale */
.modal-enter {
  animation: modalFadeIn 300ms ease-out forwards;
}

.modal-exit {
  animation: modalFadeOut 300ms ease-in forwards;
}

@keyframes modalFadeIn {
  from {
    opacity: 0;
    transform: scale(0.9);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

@keyframes modalFadeOut {
  from {
    opacity: 1;
    transform: scale(1);
  }
  to {
    opacity: 0;
    transform: scale(0.9);
  }
}

/* Modal helper classes for structure */
.modal-header {
  font-size: 1.5em;
  font-weight: bold;
  margin-bottom: 16px;
  color: var(--text-primary);
}

.modal-body {
  color: var(--text-secondary);
  margin-bottom: 20px;
  line-height: 1.6;
}

.modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
}

/* ----------------------------------------------------------------------------
   TOAST NOTIFICATION ANIMATIONS
   ---------------------------------------------------------------------------- */

/* Toast base styles */
.toast {
  position: fixed;
  background-color: var(--bg-primary);
  color: var(--text-primary);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  box-shadow: 0 4px 12px var(--shadow-color);
  padding: 16px 20px;
  min-width: 250px;
  max-width: 400px;
  z-index: 10001;
  pointer-events: auto;
}

/* Toast type variants - color-coded borders */
.toast.success {
  border-left: 4px solid var(--success-color);
}

.toast.error {
  border-left: 4px solid var(--error-color);
}

.toast.info {
  border-left: 4px solid var(--accent-primary);
}

/* ----------------------------------------------------------------------------
   TOAST EDGE POSITIONS (6 positions)
   ---------------------------------------------------------------------------- */

/* Slide down from top center */
.toast-slide-top,
.toast-slide-down {
  top: 20px;
  left: 50%;
  transform: translateX(-50%);
  animation: slideDownFromTop 400ms ease-out forwards;
}

.toast-slide-down-exit {
  animation: slideDownFromTopExit 400ms ease-in forwards;
}

@keyframes slideDownFromTop {
  from {
    opacity: 0;
    transform: translate(-50%, -100%);
  }
  to {
    opacity: 1;
    transform: translate(-50%, 0);
  }
}

@keyframes slideDownFromTopExit {
  from {
    opacity: 1;
    transform: translate(-50%, 0);
  }
  to {
    opacity: 0;
    transform: translate(-50%, -100%);
  }
}

/* Slide up from bottom center */
.toast-slide-bottom,
.toast-slide-up {
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  animation: slideUpFromBottom 400ms ease-out forwards;
}

.toast-slide-up-exit {
  animation: slideUpFromBottomExit 400ms ease-in forwards;
}

@keyframes slideUpFromBottom {
  from {
    opacity: 0;
    transform: translate(-50%, 100%);
  }
  to {
    opacity: 1;
    transform: translate(-50%, 0);
  }
}

@keyframes slideUpFromBottomExit {
  from {
    opacity: 1;
    transform: translate(-50%, 0);
  }
  to {
    opacity: 0;
    transform: translate(-50%, 100%);
  }
}

/* Slide left from right side */
.toast-slide-left {
  top: 20px;
  right: 20px;
  animation: slideLeftFromRight 400ms ease-out forwards;
}

.toast-slide-left-exit {
  animation: slideLeftFromRightExit 400ms ease-in forwards;
}

@keyframes slideLeftFromRight {
  from {
    opacity: 0;
    transform: translateX(100%);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes slideLeftFromRightExit {
  from {
    opacity: 1;
    transform: translateX(0);
  }
  to {
    opacity: 0;
    transform: translateX(100%);
  }
}

/* Slide right from left side */
.toast-slide-right {
  top: 20px;
  left: 20px;
  animation: slideRightFromLeft 400ms ease-out forwards;
}

.toast-slide-right-exit {
  animation: slideRightFromLeftExit 400ms ease-in forwards;
}

@keyframes slideRightFromLeft {
  from {
    opacity: 0;
    transform: translateX(-100%);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes slideRightFromLeftExit {
  from {
    opacity: 1;
    transform: translateX(0);
  }
  to {
    opacity: 0;
    transform: translateX(-100%);
  }
}

/* ----------------------------------------------------------------------------
   TOAST CORNER POSITIONS (4 corners)
   ---------------------------------------------------------------------------- */

/* Top-left corner - diagonal slide */
.toast-slide-top-left,
.toast-corner-top-left {
  top: 20px;
  left: 20px;
  animation: slideInFromTopLeft 400ms ease-out forwards;
}

.toast-corner-top-left-exit {
  animation: slideInFromTopLeftExit 400ms ease-in forwards;
}

@keyframes slideInFromTopLeft {
  from {
    opacity: 0;
    transform: translate(-100%, -100%);
  }
  to {
    opacity: 1;
    transform: translate(0, 0);
  }
}

@keyframes slideInFromTopLeftExit {
  from {
    opacity: 1;
    transform: translate(0, 0);
  }
  to {
    opacity: 0;
    transform: translate(-100%, -100%);
  }
}

/* Top-right corner - diagonal slide */
.toast-slide-top-right,
.toast-corner-top-right {
  top: 20px;
  right: 20px;
  animation: slideInFromTopRight 400ms ease-out forwards;
}

.toast-corner-top-right-exit {
  animation: slideInFromTopRightExit 400ms ease-in forwards;
}

@keyframes slideInFromTopRight {
  from {
    opacity: 0;
    transform: translate(100%, -100%);
  }
  to {
    opacity: 1;
    transform: translate(0, 0);
  }
}

@keyframes slideInFromTopRightExit {
  from {
    opacity: 1;
    transform: translate(0, 0);
  }
  to {
    opacity: 0;
    transform: translate(100%, -100%);
  }
}

/* Bottom-left corner - diagonal slide */
.toast-slide-bottom-left,
.toast-corner-bottom-left {
  bottom: 20px;
  left: 20px;
  animation: slideInFromBottomLeft 400ms ease-out forwards;
}

.toast-corner-bottom-left-exit {
  animation: slideInFromBottomLeftExit 400ms ease-in forwards;
}

@keyframes slideInFromBottomLeft {
  from {
    opacity: 0;
    transform: translate(-100%, 100%);
  }
  to {
    opacity: 1;
    transform: translate(0, 0);
  }
}

@keyframes slideInFromBottomLeftExit {
  from {
    opacity: 1;
    transform: translate(0, 0);
  }
  to {
    opacity: 0;
    transform: translate(-100%, 100%);
  }
}

/* Bottom-right corner - diagonal slide */
.toast-slide-bottom-right,
.toast-corner-bottom-right {
  bottom: 20px;
  right: 20px;
  animation: slideInFromBottomRight 400ms ease-out forwards;
}

.toast-corner-bottom-right-exit {
  animation: slideInFromBottomRightExit 400ms ease-in forwards;
}

@keyframes slideInFromBottomRight {
  from {
    opacity: 0;
    transform: translate(100%, 100%);
  }
  to {
    opacity: 1;
    transform: translate(0, 0);
  }
}

@keyframes slideInFromBottomRightExit {
  from {
    opacity: 1;
    transform: translate(0, 0);
  }
  to {
    opacity: 0;
    transform: translate(100%, 100%);
  }
}

/* Universal toast exit animation - fade + scale */
.toast-exit {
  animation: toastFadeOut 300ms ease-in forwards;
}

@keyframes toastFadeOut {
  from {
    opacity: 1;
    transform: scale(1);
  }
  to {
    opacity: 0;
    transform: scale(0.9);
  }
}

/* ----------------------------------------------------------------------------
   ACCESSIBILITY: PREFERS-REDUCED-MOTION SUPPORT
   ---------------------------------------------------------------------------- */

/*
   For users with motion sensitivity, all animations are disabled and replaced
   with instant transitions. This ensures full functionality without causing
   discomfort or vestibular issues.
   
   Testing: Enable "Reduce motion" in system accessibility settings or use
   Chrome DevTools to emulate prefers-reduced-motion.
*/
@media (prefers-reduced-motion: reduce) {
  /* Disable all modal animations */
  .modal-enter,
  .modal-exit,
  .modal-overlay-enter,
  .modal-overlay-exit,
  .backdrop-enter,
  .backdrop-exit {
    animation: none !important;
  }
  
  /* Instant show states */
  .modal-enter {
    opacity: 1;
    transform: scale(1);
  }
  
  .modal-overlay-enter,
  .backdrop-enter {
    opacity: 1;
    backdrop-filter: blur(4px);
  }
  
  /* Instant hide states */
  .modal-exit {
    opacity: 0;
  }
  
  .modal-overlay-exit,
  .backdrop-exit {
    opacity: 0;
  }
  
  /* Disable all toast animations */
  .toast-slide-top,
  .toast-slide-down,
  .toast-slide-bottom,
  .toast-slide-up,
  .toast-slide-left,
  .toast-slide-right,
  .toast-slide-top-left,
  .toast-slide-top-right,
  .toast-slide-bottom-left,
  .toast-slide-bottom-right,
  .toast-corner-top-left,
  .toast-corner-top-right,
  .toast-corner-bottom-left,
  .toast-corner-bottom-right,
  .toast-exit,
  .toast-slide-down-exit,
  .toast-slide-up-exit,
  .toast-slide-left-exit,
  .toast-slide-right-exit,
  .toast-corner-top-left-exit,
  .toast-corner-top-right-exit,
  .toast-corner-bottom-left-exit,
  .toast-corner-bottom-right-exit {
    animation: none !important;
  }
  
  /* Instant show states for toasts */
  .toast-slide-top,
  .toast-slide-down,
  .toast-slide-bottom,
  .toast-slide-up,
  .toast-slide-left,
  .toast-slide-right,
  .toast-slide-top-left,
  .toast-slide-top-right,
  .toast-slide-bottom-left,
  .toast-slide-bottom-right,
  .toast-corner-top-left,
  .toast-corner-top-right,
  .toast-corner-bottom-left,
  .toast-corner-bottom-right {
    opacity: 1;
  }
  
  /* Maintain proper positioning for center-aligned toasts */
  .toast-slide-top,
  .toast-slide-down {
    transform: translateX(-50%);
  }
  
  .toast-slide-bottom,
  .toast-slide-up {
    transform: translateX(-50%);
  }
  
  /* Corner and edge toasts use default positioning */
  .toast-slide-left,
  .toast-slide-right,
  .toast-slide-top-left,
  .toast-slide-top-right,
  .toast-slide-bottom-left,
  .toast-slide-bottom-right,
  .toast-corner-top-left,
  .toast-corner-top-right,
  .toast-corner-bottom-left,
  .toast-corner-bottom-right {
    transform: translate(0, 0);
  }
  
  /* Instant hide state for all toast exits */
  .toast-exit,
  .toast-slide-down-exit,
  .toast-slide-up-exit,
  .toast-slide-left-exit,
  .toast-slide-right-exit,
  .toast-corner-top-left-exit,
  .toast-corner-top-right-exit,
  .toast-corner-bottom-left-exit,
  .toast-corner-bottom-right-exit {
    opacity: 0;
  }
}




















