/* UX/UI Improvements - Shared Styles */

/* Back to Top Button */
.back-to-top {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  width: 48px;
  height: 48px;
  background: #6366f1;
  color: white;
  border: none;
  border-radius: 50%;
  cursor: pointer;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
  z-index: 1000;
  box-shadow: 0 4px 12px rgba(99, 102, 241, 0.4);
  display: flex;
  align-items: center;
  justify-content: center;
}

.back-to-top.visible {
  opacity: 1;
  visibility: visible;
}

.back-to-top:hover {
  background: #4f46e5;
  transform: translateY(-4px);
  box-shadow: 0 8px 20px rgba(99, 102, 241, 0.5);
}

.back-to-top:active {
  transform: translateY(-2px);
}

.back-to-top svg {
  width: 24px;
  height: 24px;
}

/* Toast Notifications */
.toast-container {
  position: fixed;
  top: 1rem;
  right: 1rem;
  z-index: 10000;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  max-width: 400px;
  pointer-events: none;
}

.toast {
  padding: 1rem 1.25rem;
  background: white;
  border: 2px solid #e5e7eb;
  border-radius: 0.75rem;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
  display: flex;
  align-items: center;
  gap: 0.75rem;
  pointer-events: auto;
  animation: toastSlideIn 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
  font-weight: 600;
}

.toast.success {
  border-color: #10b981;
  background: linear-gradient(135deg, #f0fdf4 0%, #dcfce7 100%);
  color: #065f46;
}

.toast.error {
  border-color: #ef4444;
  background: linear-gradient(135deg, #fef2f2 0%, #fee2e2 100%);
  color: #991b1b;
}

.toast.info {
  border-color: #6366f1;
  background: linear-gradient(135deg, #eef2ff 0%, #e0e7ff 100%);
  color: #3730a3;
}

@keyframes toastSlideIn {
  from {
    transform: translateX(400px);
    opacity: 0;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}

.toast-close {
  margin-left: auto;
  background: none;
  border: none;
  font-size: 1.25rem;
  cursor: pointer;
  opacity: 0.6;
  padding: 0;
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.toast-close:hover {
  opacity: 1;
}

/* Loading Skeleton */
.skeleton {
  background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
  background-size: 200% 100%;
  animation: skeleton-loading 1.5s ease-in-out infinite;
  border-radius: 0.5rem;
}

@keyframes skeleton-loading {
  0% {
    background-position: 200% 0;
  }
  100% {
    background-position: -200% 0;
  }
}

[data-bs-theme="dark"] .skeleton {
  background: linear-gradient(90deg, #1f2937 25%, #374151 50%, #1f2937 75%);
  background-size: 200% 100%;
}

/* Better Button Hover Effects */
.btn {
  position: relative;
  overflow: hidden;
}

.btn::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.2);
  transform: translate(-50%, -50%);
  transition: width 0.6s, height 0.6s;
}

.btn:hover::before {
  width: 300px;
  height: 300px;
}

/* Improved Form Focus States */
.form-control:focus,
.form-select:focus {
  border-color: #6366f1;
  box-shadow: 0 0 0 0.25rem rgba(99, 102, 241, 0.25);
  transform: translateY(-1px);
  transition: all 0.2s ease;
}

/* Smooth Page Transitions */
@media (prefers-reduced-motion: no-preference) {
  html {
    scroll-behavior: smooth;
  }
}

/* Better Link Hover States */
a:not(.btn):hover {
  text-decoration: underline;
  text-underline-offset: 3px;
}

/* Card Hover Improvements */
.card {
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.card:hover {
  transform: translateY(-4px);
}

/* Empty State Styling */
.empty-state {
  text-align: center;
  padding: 3rem 1rem;
  color: #6b7280;
}

.empty-state-icon {
  font-size: 4rem;
  margin-bottom: 1rem;
  opacity: 0.5;
}

/* Progress Indicator */
.progress-ring {
  width: 48px;
  height: 48px;
}

.progress-ring circle {
  fill: none;
  stroke: #6366f1;
  stroke-width: 4;
  stroke-linecap: round;
  transition: stroke-dashoffset 0.3s;
}

/* Responsive Adjustments */
@media (max-width: 768px) {
  .back-to-top {
    bottom: 1rem;
    right: 1rem;
    width: 44px;
    height: 44px;
  }
  
  .toast-container {
    top: 0.5rem;
    right: 0.5rem;
    left: 0.5rem;
    max-width: none;
  }
}

/* ===== LINK IMPROVEMENTS & UX ENHANCEMENTS ===== */

/* External Link Indicators */
a[href^="http"]:not([href*="localhost"]):not([href*="jfsn.com"]):not([href*="127.0.0.1"])::after {
  content: "↗";
  display: inline-block;
  margin-left: 0.25rem;
  font-size: 0.75em;
  opacity: 0.6;
  transition: all 0.2s ease;
  vertical-align: baseline;
}

a[href^="http"]:not([href*="localhost"]):not([href*="jfsn.com"]):not([href*="127.0.0.1"]):hover::after {
  opacity: 1;
  transform: translate(2px, -2px);
}

/* Enhanced Link Hover States */
a:not(.btn):not(.nav-link):not(.dropdown-item):not(.card-link):not(.navbar-brand) {
  position: relative;
  text-decoration: none;
  transition: color 0.2s ease;
}

a:not(.btn):not(.nav-link):not(.dropdown-item):not(.card-link):not(.navbar-brand):hover {
  color: var(--bs-primary);
}

/* Underline animation on hover */
a:not(.btn):not(.nav-link):not(.dropdown-item):not(.card-link):not(.navbar-brand):not([href^="#"])::before {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 0;
  height: 2px;
  background: var(--bs-primary);
  transition: width 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

a:not(.btn):not(.nav-link):not(.dropdown-item):not(.card-link):not(.navbar-brand):not([href^="#"]):hover::before {
  width: 100%;
}

/* Focus States for Links */
a:focus-visible {
  outline: 2px solid var(--bs-primary);
  outline-offset: 2px;
  border-radius: 2px;
}

/* Smooth Scroll for Anchor Links */
html {
  scroll-behavior: smooth;
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  
  a::before,
  a::after {
    transition: none !important;
  }
}

/* Link Validation - Visual Feedback */
a[href="#"]:not([data-bs-toggle]):not([data-bs-target]):not(.disabled) {
  cursor: not-allowed;
  opacity: 0.6;
}

a[href="#"]:not([data-bs-toggle]):not([data-bs-target]):not(.disabled):hover {
  opacity: 0.8;
}

/* Email Links */
a[href^="mailto:"]::before {
  content: "✉ ";
  margin-right: 0.25rem;
  opacity: 0.7;
}

/* Phone Links */
a[href^="tel:"]::before {
  content: "📞 ";
  margin-right: 0.25rem;
  opacity: 0.7;
}

/* PDF Links */
a[href$=".pdf"]::after {
  content: " 📄";
  margin-left: 0.25rem;
  opacity: 0.6;
  font-size: 0.9em;
}

/* Download Links */
a[download]::after {
  content: " ⬇";
  margin-left: 0.25rem;
  opacity: 0.6;
  font-size: 0.9em;
}

/* Navigation Link Improvements */
.nav-link {
  position: relative;
  transition: color 0.2s ease;
}

.nav-link::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 50%;
  width: 0;
  height: 2px;
  background: var(--bs-primary);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  transform: translateX(-50%);
}

.nav-link:hover::after,
.nav-link.active::after {
  width: 80%;
}

/* Breadcrumb Link Improvements */
.breadcrumb-item a {
  transition: color 0.2s ease;
}

.breadcrumb-item a:hover {
  color: var(--bs-primary);
  text-decoration: underline;
}

/* Footer Link Improvements - Override to ensure clickability */
footer a {
  transition: color 0.2s ease, opacity 0.2s ease;
  pointer-events: auto !important;
  cursor: pointer !important;
  z-index: 100 !important;
  position: relative !important;
}

footer a:hover {
  color: var(--bs-primary);
  opacity: 1;
}

/* Card Link Improvements */
.card-link {
  font-weight: 600;
  transition: all 0.2s ease;
}

.card-link:hover {
  transform: translateX(4px);
}

/* Skip Link Enhancement */
.skip-link {
  position: absolute;
  top: -100px;
  left: 0;
  background: var(--bs-primary);
  color: white;
  padding: 1rem 1.5rem;
  text-decoration: none;
  font-weight: 700;
  z-index: 10000;
  border-radius: 0 0 8px 0;
  transition: top 0.2s ease;
}

.skip-link:focus {
  top: 0;
  outline: 3px solid white;
  outline-offset: 2px;
}

/* Link Loading State */
a.loading {
  pointer-events: none;
  opacity: 0.6;
  position: relative;
}

a.loading::after {
  content: '';
  position: absolute;
  right: -20px;
  top: 50%;
  transform: translateY(-50%);
  width: 12px;
  height: 12px;
  border: 2px solid currentColor;
  border-top-color: transparent;
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
}

@keyframes spin {
  to {
    transform: translateY(-50%) rotate(360deg);
  }
}

/* Print Styles - Remove link decorations */
@media print {
  a[href^="http"]::after {
    content: " (" attr(href) ")";
    font-size: 0.8em;
    opacity: 0.7;
  }
  
  a::before {
    display: none;
  }
  
  .skip-link {
    display: none;
  }
}

/* ===== INLINE STYLES MOVED TO CSS ===== */

/* Artwork of the Day Image */
.artwork-of-day-image {
  object-fit: cover;
}

/* Collection Icons */
.collection-icon-large {
  font-size: 3rem;
}

/* Sticky Filter Bar */
.sticky-filter-bar {
  z-index: 100;
  top: 56px;
}

/* Search Icon Position */
.search-icon-position {
  right: 1rem;
  top: 50%;
  transform: translateY(-50%);
  color: #6b7280;
  pointer-events: none;
}

/* Progress Bar Height */
.progress-bar-height {
  height: 4px;
}

/* Skeleton Grid Layout */
.skeleton-grid-layout {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 1.5rem;
}

/* Skeleton Card Height */
.skeleton-card-height {
  height: 300px;
  border-radius: 0.5rem;
}

