/* ============================================================ */
/* 🔹 CSS CUSTOM PROPERTIES (VARIABLES) */
/* ============================================================ */
:root {
  /* Colors - Success */
  --color-success: #10b981;
  --color-success-dark: #059669;

  /* Colors - Error */
  --color-error: #ef4444;
  --color-error-dark: #dc2626;

  /* Colors - Warning */
  --color-warning: #f59e0b;
  --color-warning-dark: #d97706;

  /* Colors - Info */
  --color-info: #3b82f6;
  --color-info-dark: #2563eb;

  /* Grays */
  --color-gray-50: #f9fafb;
  --color-gray-100: #f3f4f6;
  --color-gray-200: #e5e7eb;
  --color-gray-300: #d1d5db;
  --color-gray-400: #9ca3af;
  --color-gray-500: #6b7280;
  --color-gray-600: #4b5563;
  --color-gray-700: #374151;
  --color-gray-800: #1f2937;

  /* Animation Durations */
  --duration-fast: 0.15s;
  --duration-normal: 0.3s;
  --duration-slow: 2s;

  /* Spacing */
  --spacing-xs: 0.25rem;
  --spacing-sm: 0.5rem;
  --spacing-md: 0.75rem;
  --spacing-lg: 1rem;
  --spacing-xl: 1.25rem;

  /* Border Radius */
  --radius-sm: 0.5rem;
  --radius-md: 0.75rem;
  --radius-lg: 1rem;

  /* Shadows */
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
  --shadow-xl: 0 10px 25px rgba(0, 0, 0, 0.15);

  /* Z-Index Layers */
  --z-base: 1;
  --z-dropdown: 10;
  --z-sticky: 20;
  --z-modal: 50;
  --z-toast: 60;
}

/* ============================================================ */
/* 🔹 BASE ANIMATIONS */
/* ============================================================ */

/* Fade In/Out */
@keyframes fadeIn {
  from {
    opacity: 0;
    transform: scale(0.9);
  }

  to {
    opacity: 1;
    transform: scale(1);
  }
}

@keyframes fadeOut {
  from {
    opacity: 1;
    transform: scale(1);
  }

  to {
    opacity: 0;
    transform: scale(0.9);
  }
}

.animate-fadeIn {
  animation: fadeIn var(--duration-normal) ease-out forwards;
}

.animate-fadeOut {
  animation: fadeOut var(--duration-normal) ease-in forwards;
}

/* ============================================================ */
/* 🔹 SHIMMER LOADING ANIMATION */
/* ============================================================ */
@keyframes shimmer {
  0% {
    background-position: -1000px 0;
  }

  100% {
    background-position: 1000px 0;
  }
}

.shimmer {
  background: linear-gradient(90deg,
      var(--color-gray-100) 0%,
      var(--color-gray-200) 20%,
      #d0d0d0 40%,
      var(--color-gray-200) 60%,
      var(--color-gray-100) 100%);
  background-size: 1000px 100%;
  animation: shimmer var(--duration-slow) ease-in-out infinite;
}

/* ============================================================ */
/* 🔹 TOAST NOTIFICATION COMPONENT */
/* ============================================================ */

/* Toast Slide Animations */
@keyframes slideInRight {
  from {
    transform: translateX(400px);
    opacity: 0;
  }

  to {
    transform: translateX(0);
    opacity: 1;
  }
}

@keyframes slideOutRight {
  from {
    transform: translateX(0);
    opacity: 1;
  }

  to {
    transform: translateX(400px);
    opacity: 0;
  }
}

/* Toast Base Styles */
.toast {
  min-width: 280px;
  max-width: 360px;
  padding: var(--spacing-lg) var(--spacing-xl);
  background: white;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-xl);
  border-left: 4px solid;
  display: flex;
  align-items: center;
  gap: var(--spacing-md);
  animation: slideInRight var(--duration-normal) ease-out forwards;
}

/* Toast Type Modifiers */
.toast--success,
.toast.toast-success {
  border-left-color: var(--color-success);
}

.toast--error,
.toast.toast-error {
  border-left-color: var(--color-error);
}

.toast--warning,
.toast.toast-warning {
  border-left-color: var(--color-warning);
}

.toast--info,
.toast.toast-info {
  border-left-color: var(--color-info);
}

/* Toast Removing State */
.toast.removing {
  animation: slideOutRight var(--duration-normal) ease-in forwards;
}

/* Toast Elements */
.toast-icon {
  font-size: 1.5rem;
  flex-shrink: 0;
}

.toast-content {
  flex: 1;
  min-width: 0;
}

.toast-title {
  font-weight: 600;
  font-size: 0.875rem;
  color: var(--color-gray-800);
  margin-bottom: 0.125rem;
}

.toast-message {
  font-size: 0.8125rem;
  color: var(--color-gray-500);
  line-height: 1.4;
}

.toast-close {
  background: transparent;
  border: none;
  color: var(--color-gray-400);
  font-size: 1.25rem;
  cursor: pointer;
  padding: 0;
  line-height: 1;
  transition: color var(--duration-fast);
  flex-shrink: 0;
}

.toast-close:hover {
  color: var(--color-gray-600);
}

/* ============================================================ */
/* 🔹 COPY BUTTON COMPONENT */
/* ============================================================ */
.copy-btn {
  display: inline-flex;
  align-items: center;
  gap: var(--spacing-xs);
  padding: 0.375rem 0.625rem;
  background: var(--color-gray-100);
  border: 1px solid var(--color-gray-300);
  border-radius: var(--radius-sm);
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--color-gray-600);
  cursor: pointer;
  transition: all var(--duration-fast);
}

.copy-btn:hover {
  background: var(--color-gray-200);
  border-color: var(--color-gray-400);
  color: var(--color-gray-800);
}

.copy-btn:active {
  transform: scale(0.95);
}

.copy-btn.copied {
  background: #dcfce7;
  border-color: #86efac;
  color: #166534;
}

/* ============================================================ */
/* 🔹 SCROLL INDICATOR */
/* ============================================================ */
.scroll-indicator {
  position: absolute;
  right: 0;
  top: 0;
  bottom: 0;
  width: 2rem;
  background: linear-gradient(to left, rgba(229, 231, 235, 0.8), transparent);
  pointer-events: none;
  opacity: 0;
  transition: opacity var(--duration-normal);
  z-index: var(--z-dropdown);
}

.scroll-indicator.show {
  opacity: 1;
}

/* ============================================================ */
/* 🔹 UTILITY CLASSES */
/* ============================================================ */

/* State Classes */
.is-loading {
  opacity: 0.7;
  cursor: not-allowed;
  pointer-events: none;
}

.is-disabled {
  opacity: 0.5;
  cursor: not-allowed;
  pointer-events: none;
}

.is-hidden {
  display: none !important;
}

/* ============================================================ */
/* 🔹 RESPONSIVE DESIGN */
/* ============================================================ */

/* Mobile Optimizations (Small Screens) */
@media (max-width: 640px) {
  :root {
    --spacing-lg: 0.875rem;
    --spacing-xl: 1rem;
  }

  .toast {
    min-width: 260px;
    max-width: calc(100vw - 2rem);
    padding: var(--spacing-lg);
  }

  .toast-title {
    font-size: 0.8125rem;
  }

  .toast-message {
    font-size: 0.75rem;
  }
}

/* Tablet Optimizations (Medium Screens) */
@media (min-width: 641px) and (max-width: 1024px) {
  .toast {
    max-width: 340px;
  }
}

/* Reduce Motion for Accessibility */
@media (prefers-reduced-motion: reduce) {

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }

  .shimmer {
    animation: none;
    background: var(--color-gray-200);
  }
}

/* ============================================================ */
/* 🔹 PRINT STYLES */
/* ============================================================ */
@media print {

  .toast-container,
  .scroll-indicator,
  .copy-btn {
    display: none !important;
  }
}