/* ===========================================
   TOP 10 HIGH-IMPACT UX/UI IMPROVEMENTS
   =========================================== */

/* ===========================================
   1. SCROLL PROGRESS BAR - Top Progress Indicator
   =========================================== */
.scroll-progress-top {
  position: fixed;
  top: 0;
  left: 0;
  width: 0%;
  height: 2px !important; /* Reduced from 3px for thinner appearance */
  background: linear-gradient(90deg, #6366f1 0%, #8b5cf6 50%, #d946ef 100%);
  opacity: 0.7 !important; /* Reduced opacity for less prominence */
  z-index: 10000;
  transition: width 0.1s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 0 4px rgba(99, 102, 241, 0.3) !important; /* Reduced glow effect */
  will-change: width;
}

@media (prefers-reduced-motion: reduce) {
  .scroll-progress-top {
    transition: none;
  }
}

/* ===========================================
   2. ENHANCED BUTTON HOVER STATES
   Ripple & Magnetic Effects
   =========================================== */

/* Base button enhancements */
.btn-enhanced {
  position: relative;
  overflow: hidden;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  --magnetic-x: 0px;
  --magnetic-y: 0px;
  transform: translate(var(--magnetic-x), var(--magnetic-y));
  will-change: transform;
}

/* Ripple effect */
.btn-enhanced::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.3);
  transform: translate(-50%, -50%);
  transition: width 0.6s ease, height 0.6s ease, opacity 0.6s ease;
  opacity: 0;
  pointer-events: none;
  z-index: 0;
}

.btn-enhanced:active::before {
  width: 300px;
  height: 300px;
  opacity: 1;
  transition: width 0.3s ease, height 0.3s ease, opacity 0.3s ease;
}

.btn-enhanced > * {
  position: relative;
  z-index: 1;
}

/* Magnetic hover effect (desktop only) */
@media (hover: hover) and (pointer: fine) {
  .btn-enhanced:hover {
    transform: translate(var(--magnetic-x), var(--magnetic-y)) scale(1.05);
  }
}

/* Apply to all buttons */
.btn:not(.btn-enhanced) {
  position: relative;
  overflow: hidden;
}

.btn:not(.btn-enhanced)::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.5s ease, height 0.5s ease, opacity 0.5s ease;
  opacity: 0;
  pointer-events: none;
  z-index: 0;
}

.btn:not(.btn-enhanced):active::before {
  width: 200px;
  height: 200px;
  opacity: 1;
}

.btn:not(.btn-enhanced) > * {
  position: relative;
  z-index: 1;
}

/* ===========================================
   3. CARD HOVER IMPROVEMENTS
   Scale, Glow, Info Reveal
   =========================================== */

/* Enhanced card hover effects */
.card-enhanced {
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  will-change: transform, box-shadow;
  position: relative;
  overflow: hidden;
}

.card-enhanced::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.05) 0%, rgba(139, 92, 246, 0.05) 100%);
  opacity: 0;
  transition: opacity 0.4s ease;
  pointer-events: none;
  z-index: 1;
}

.card-enhanced:hover {
  transform: translateY(-8px) scale(1.02);
  box-shadow: 
    0 20px 40px rgba(0, 0, 0, 0.1),
    0 0 0 1px rgba(99, 102, 241, 0.1),
    0 0 30px rgba(99, 102, 241, 0.15);
}

.card-enhanced:hover::before {
  opacity: 1;
}

/* Card image zoom on hover */
.card-enhanced .card-img-top,
.card-enhanced img {
  transition: transform 0.6s cubic-bezier(0.4, 0, 0.2, 1);
  will-change: transform;
}

.card-enhanced:hover .card-img-top,
.card-enhanced:hover img {
  transform: scale(1.08);
}

/* Card info reveal on hover */
.card-enhanced .card-info-reveal {
  opacity: 0;
  transform: translateY(10px);
  transition: opacity 0.4s ease 0.1s, transform 0.4s ease 0.1s;
}

.card-enhanced:hover .card-info-reveal {
  opacity: 1;
  transform: translateY(0);
}

/* Apply to existing cards */
.card:not(.card-enhanced) {
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.card:not(.card-enhanced):hover {
  transform: translateY(-6px);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.12);
}

/* Collection cards specific */
.collection-card:hover {
  transform: translateY(-8px) scale(1.02);
  box-shadow: 
    0 20px 40px rgba(0, 0, 0, 0.12),
    0 0 0 1px rgba(99, 102, 241, 0.1),
    0 0 30px rgba(99, 102, 241, 0.2);
}

/* Project cards specific */
.project-card-img {
  transition: transform 0.5s cubic-bezier(0.4, 0, 0.2, 1), filter 0.4s ease;
}

.card:hover .project-card-img {
  transform: scale(1.05);
  filter: brightness(1.05) contrast(1.05);
}

/* Art cards specific */
.jfsn-artcard {
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.jfsn-artcard:hover {
  transform: translateY(-6px);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.15);
}

/* ===========================================
   4. SMOOTH SCROLL NAVIGATION
   With Navbar Offset
   =========================================== */

html {
  scroll-behavior: smooth;
  scroll-padding-top: var(--navbar-height, 70px);
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
}

/* Smooth scroll for anchor links */
a[href^="#"] {
  scroll-margin-top: var(--navbar-height, 70px);
}

/* ===========================================
   BACK TO TOP BUTTON
   =========================================== */

/* Back to Top Button - Hidden by default */
.back-to-top {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  width: 48px;
  height: 48px;
  background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
  color: white;
  border: none;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  opacity: 0;
  visibility: hidden;
  transform: translateY(20px);
  transition: opacity 0.3s cubic-bezier(0.4, 0, 0.2, 1),
              visibility 0.3s cubic-bezier(0.4, 0, 0.2, 1),
              transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  z-index: 99999;
  box-shadow: 0 4px 16px rgba(99, 102, 241, 0.4);
  font-size: 1.25rem;
  pointer-events: none;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
}

/* Show when .visible class is present */
.back-to-top.visible {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
  pointer-events: auto;
}

.back-to-top:hover {
  transform: translateY(-4px) scale(1.1);
  box-shadow: 0 8px 24px rgba(99, 102, 241, 0.5);
}

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

@media (prefers-reduced-motion: reduce) {
  .back-to-top {
    transition: opacity 0.2s, visibility 0.2s;
  }
  
  .back-to-top:hover {
    transform: none;
  }
}

/* ===========================================
   5. SKELETON LOADERS
   For All Dynamic Content
   =========================================== */

.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: 4px;
}

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

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

.skeleton-text {
  height: 1rem;
  margin-bottom: 0.5rem;
}

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

.skeleton-title {
  height: 1.5rem;
  width: 80%;
  margin-bottom: 1rem;
}

.skeleton-badge {
  height: 1.5rem;
  width: 80px;
  border-radius: 12px;
}

.skeleton-button {
  height: 2.5rem;
  width: 120px;
  border-radius: 8px;
}

.skeleton-image {
  width: 100%;
  height: 200px;
  border-radius: 8px;
}

.skeleton-card {
  padding: 1.5rem;
  border-radius: 12px;
}

@media (prefers-reduced-motion: reduce) {
  .skeleton {
    animation: none;
    background: #f0f0f0;
  }
  
  [data-bs-theme="dark"] .skeleton {
    background: #2a2a2a;
  }
}

/* ===========================================
   6. SECTION REVEAL ANIMATIONS
   Fade-in on Scroll
   =========================================== */

.reveal-on-scroll {
  opacity: 0;
  transform: translateY(40px);
  transition: opacity 0.8s cubic-bezier(0.4, 0, 0.2, 1),
              transform 0.8s cubic-bezier(0.4, 0, 0.2, 1);
  will-change: opacity, transform;
}

.reveal-on-scroll.revealed {
  opacity: 1;
  transform: translateY(0);
}

/* Staggered reveal for child elements */
.reveal-stagger > * {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.6s cubic-bezier(0.4, 0, 0.2, 1),
              transform 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.reveal-stagger.revealed > *:nth-child(1) {
  transition-delay: 0.1s;
  opacity: 1;
  transform: translateY(0);
}

.reveal-stagger.revealed > *:nth-child(2) {
  transition-delay: 0.2s;
  opacity: 1;
  transform: translateY(0);
}

.reveal-stagger.revealed > *:nth-child(3) {
  transition-delay: 0.3s;
  opacity: 1;
  transform: translateY(0);
}

.reveal-stagger.revealed > *:nth-child(4) {
  transition-delay: 0.4s;
  opacity: 1;
  transform: translateY(0);
}

.reveal-stagger.revealed > *:nth-child(5) {
  transition-delay: 0.5s;
  opacity: 1;
  transform: translateY(0);
}

.reveal-stagger.revealed > *:nth-child(6) {
  transition-delay: 0.6s;
  opacity: 1;
  transform: translateY(0);
}

@media (prefers-reduced-motion: reduce) {
  .reveal-on-scroll,
  .reveal-stagger > * {
    opacity: 1;
    transform: none;
    transition: none;
  }
}

/* ===========================================
   7. TYPOGRAPHY IMPROVEMENTS
   Better Hierarchy & Spacing
   =========================================== */

/* Fluid typography scale */
:root {
  --text-xs: clamp(0.75rem, 0.7rem + 0.25vw, 0.875rem);
  --text-sm: clamp(0.875rem, 0.8rem + 0.375vw, 1rem);
  --text-base: clamp(1rem, 0.95rem + 0.25vw, 1.125rem);
  --text-lg: clamp(1.125rem, 1rem + 0.625vw, 1.5rem);
  --text-xl: clamp(1.25rem, 1.1rem + 0.75vw, 2rem);
  --text-2xl: clamp(1.5rem, 1.3rem + 1vw, 2.5rem);
  --text-3xl: clamp(1.875rem, 1.5rem + 1.875vw, 3.5rem);
  --text-4xl: clamp(2.25rem, 1.8rem + 2.25vw, 4.5rem);
}

/* Improved heading hierarchy */
h1, .h1 {
  font-size: var(--text-4xl);
  line-height: 1.2;
  letter-spacing: -0.02em;
  font-weight: 800;
  margin-bottom: 1.5rem;
}

h2, .h2 {
  font-size: var(--text-3xl);
  line-height: 1.3;
  letter-spacing: -0.01em;
  font-weight: 700;
  margin-bottom: 1.25rem;
}

h3, .h3 {
  font-size: var(--text-2xl);
  line-height: 1.4;
  letter-spacing: -0.005em;
  font-weight: 600;
  margin-bottom: 1rem;
}

h4, .h4 {
  font-size: var(--text-xl);
  line-height: 1.4;
  font-weight: 600;
  margin-bottom: 0.875rem;
}

h5, .h5 {
  font-size: var(--text-lg);
  line-height: 1.5;
  font-weight: 600;
  margin-bottom: 0.75rem;
}

h6, .h6 {
  font-size: var(--text-base);
  line-height: 1.5;
  font-weight: 600;
  margin-bottom: 0.5rem;
}

/* Improved body text */
p, .lead {
  font-size: var(--text-base);
  line-height: 1.7;
  letter-spacing: 0.01em;
  margin-bottom: 1.25rem;
}

.lead {
  font-size: var(--text-lg);
  line-height: 1.6;
  font-weight: 400;
}

/* Better spacing rhythm */
section {
  margin-bottom: 4rem;
}

@media (min-width: 768px) {
  section {
    margin-bottom: 5rem;
  }
}

@media (min-width: 1200px) {
  section {
    margin-bottom: 6rem;
  }
}

/* ===========================================
   8. ENHANCED SHADOWS & DEPTH
   Elevation System
   =========================================== */

:root {
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.07), 0 2px 4px rgba(0, 0, 0, 0.06);
  --shadow-lg: 0 10px 15px rgba(0, 0, 0, 0.1), 0 4px 6px rgba(0, 0, 0, 0.05);
  --shadow-xl: 0 20px 25px rgba(0, 0, 0, 0.1), 0 10px 10px rgba(0, 0, 0, 0.04);
  --shadow-2xl: 0 25px 50px rgba(0, 0, 0, 0.15);
  --shadow-glow: 0 0 20px rgba(99, 102, 241, 0.3);
  --shadow-glow-lg: 0 0 40px rgba(99, 102, 241, 0.4);
}

/* Elevation levels */
.elevation-0 {
  box-shadow: none;
}

.elevation-1 {
  box-shadow: var(--shadow-sm);
}

.elevation-2 {
  box-shadow: var(--shadow-md);
}

.elevation-3 {
  box-shadow: var(--shadow-lg);
}

.elevation-4 {
  box-shadow: var(--shadow-xl);
}

.elevation-5 {
  box-shadow: var(--shadow-2xl);
}

/* Glow effects */
.glow-sm {
  box-shadow: var(--shadow-glow);
}

.glow-lg {
  box-shadow: var(--shadow-glow-lg);
}

/* Apply to cards */
.card {
  box-shadow: var(--shadow-md);
  transition: box-shadow 0.3s ease;
}

.card:hover {
  box-shadow: var(--shadow-xl);
}

.card.elevation-3 {
  box-shadow: var(--shadow-lg);
}

.card.elevation-3:hover {
  box-shadow: var(--shadow-2xl);
}

/* ===========================================
   9. LOADING STATES
   For All Async Operations
   =========================================== */

.loading {
  position: relative;
  pointer-events: none;
  opacity: 0.6;
}

.loading::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 20px;
  height: 20px;
  margin: -10px 0 0 -10px;
  border: 2px solid rgba(99, 102, 241, 0.3);
  border-top-color: #6366f1;
  border-radius: 50%;
  animation: spinner 0.6s linear infinite;
}

@keyframes spinner {
  to {
    transform: rotate(360deg);
  }
}

/* Button loading state */
.btn.loading {
  color: transparent;
  pointer-events: none;
}

.btn.loading::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 16px;
  height: 16px;
  margin: -8px 0 0 -8px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-top-color: white;
  border-radius: 50%;
  animation: spinner 0.6s linear infinite;
}

/* Image loading state */
img.loading {
  background: #f0f0f0;
  opacity: 0.5;
}

[data-bs-theme="dark"] img.loading {
  background: #2a2a2a;
}

@media (prefers-reduced-motion: reduce) {
  .loading::after,
  .btn.loading::after {
    animation: none;
  }
}

/* ===========================================
   10. MOBILE TOUCH TARGETS
   Ensure 44x44px Minimum
   =========================================== */

/* Ensure all interactive elements meet WCAG touch target requirements */
@media (max-width: 768px) {
  /* Buttons */
  .btn,
  button,
  a.btn {
    min-height: 44px;
    min-width: 44px;
    padding: 0.75rem 1.5rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }
  
  /* Links */
  a:not(.btn) {
    min-height: 44px;
    display: inline-flex;
    align-items: center;
    padding: 0.5rem 0;
  }
  
  /* Navigation links */
  .nav-link {
    min-height: 44px;
    display: flex;
    align-items: center;
    padding: 0.75rem 1rem;
  }
  
  /* Form inputs */
  input,
  select,
  textarea {
    min-height: 44px;
    padding: 0.75rem;
  }
  
  /* Card links */
  .card a,
  .card button {
    min-height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
  }
  
  /* Icon buttons */
  .btn-icon,
  button[aria-label] {
    min-width: 44px;
    min-height: 44px;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
  }
  
  /* Badge links */
  .badge[href] {
    min-height: 32px;
    padding: 0.5rem 0.75rem;
    display: inline-flex;
    align-items: center;
  }
}

/* Increase spacing between touch targets */
@media (max-width: 768px) {
  .btn + .btn,
  button + button {
    margin-left: 0.5rem;
  }
  
  .card + .card {
    margin-top: 1rem;
  }
}

