/**
 * Visual Enhancements
 * Additional polish for a premium, refined appearance
 */

/* Improved card designs with premium depth and glow */
.item,
.resume-card {
  position: relative;
  background: linear-gradient(145deg, var(--color-surface) 0%, var(--color-surface-alt) 100%);
  border: 1px solid var(--color-border);
  transition: all 0.5s cubic-bezier(0.16, 1, 0.3, 1);
  will-change: transform, box-shadow, border-color;
  overflow: hidden;
}

/* Static gradient overlay on hover - NO ROTATION */
.item::before,
.resume-card::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(
    135deg,
    rgba(96, 165, 250, 0.05),
    rgba(139, 92, 246, 0.03)
  );
  opacity: 0;
  transition: opacity 0.6s ease;
  pointer-events: none;
  border-radius: inherit;
}

.item:hover::before,
.resume-card:hover::before {
  opacity: 1;
}

/* Subtle glow overlay */
.item::after,
.resume-card::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: radial-gradient(
    circle at 50% 0%,
    rgba(96, 165, 250, 0.08),
    transparent 50%
  );
  opacity: 0;
  transition: opacity 0.5s ease;
  pointer-events: none;
}

.item:hover,
.resume-card:hover {
  transform: translateY(-2px);
  border-color: rgba(96, 165, 250, 0.3);
  box-shadow:
    0 12px 32px rgba(2, 6, 23, 0.15),
    0 0 0 1px rgba(96, 165, 250, 0.12),
    0 0 24px rgba(96, 165, 250, 0.06),
    inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

.item:hover::after,
.resume-card:hover::after {
  opacity: 1;
}

/* Refined stat cards */
.hero-stats li {
  background: linear-gradient(135deg, rgba(37, 99, 235, 0.08), rgba(139, 92, 246, 0.06));
  border: 1px solid rgba(96, 165, 250, 0.15);
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.hero-stats li:hover {
  background: linear-gradient(135deg, rgba(37, 99, 235, 0.12), rgba(139, 92, 246, 0.1));
  border-color: rgba(96, 165, 250, 0.3);
  box-shadow:
    0 8px 24px rgba(37, 99, 235, 0.15),
    inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

/* Smoother button effects */
.button,
button {
  position: relative;
  overflow: hidden;
  background: linear-gradient(135deg, var(--color-accent) 0%, var(--color-accent-strong) 100%);
  box-shadow:
    0 4px 14px rgba(96, 165, 250, 0.25),
    inset 0 1px 0 rgba(255, 255, 255, 0.2);
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.button::before,
button::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.2), transparent);
  opacity: 0;
  transition: opacity 0.3s ease;
}

.button:hover,
button:hover {
  transform: translateY(-2px);
  box-shadow:
    0 8px 24px rgba(96, 165, 250, 0.4),
    0 0 0 1px rgba(96, 165, 250, 0.5),
    inset 0 1px 0 rgba(255, 255, 255, 0.3);
}

.button:hover::before,
button:hover::before {
  opacity: 1;
}

.button:active,
button:active {
  transform: translateY(0);
}

/* Enhanced portrait card */
.portrait-card {
  position: relative;
  overflow: hidden;
  border: 2px solid rgba(96, 165, 250, 0.2);
  background: linear-gradient(135deg, var(--color-surface) 0%, var(--color-surface-alt) 100%);
  box-shadow:
    0 20px 60px rgba(2, 6, 23, 0.3),
    0 0 0 1px rgba(96, 165, 250, 0.1),
    inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

.portrait-card::before {
  content: '';
  position: absolute;
  inset: -2px;
  background: linear-gradient(135deg, var(--color-accent), var(--color-accent-purple));
  opacity: 0;
  transition: opacity 0.4s ease;
  z-index: -1;
  border-radius: inherit;
}

.portrait-card:hover::before {
  opacity: 0.15;
}

/* Refined social icons */
.hero-social li a {
  background: rgba(37, 99, 235, 0.08);
  border: 1px solid rgba(96, 165, 250, 0.2);
  box-shadow:
    0 4px 12px rgba(2, 6, 23, 0.2),
    inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

.hero-social li a:hover {
  background: rgba(37, 99, 235, 0.15);
  border-color: rgba(96, 165, 250, 0.4);
  box-shadow:
    0 8px 20px rgba(96, 165, 250, 0.3),
    inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

/* Improved section headers */
h2 {
  position: relative;
  padding-bottom: 0.5rem;
}

h2::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 60px;
  height: 3px;
  background: linear-gradient(90deg, var(--color-accent), var(--color-accent-purple));
  border-radius: 2px;
  box-shadow: 0 2px 8px rgba(96, 165, 250, 0.4);
}

/* Smooth scrollbar */
::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}

::-webkit-scrollbar-track {
  background: var(--color-background-alt);
}

::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, var(--color-accent), var(--color-accent-purple));
  border-radius: 5px;
  border: 2px solid var(--color-background-alt);
}

::-webkit-scrollbar-thumb:hover {
  background: linear-gradient(180deg, var(--color-accent-strong), var(--color-accent-purple));
}

/* Selection styling */
::selection {
  background: rgba(96, 165, 250, 0.3);
  color: var(--color-text);
}

::-moz-selection {
  background: rgba(96, 165, 250, 0.3);
  color: var(--color-text);
}

/* Refined backdrop blur for modals/overlays */
.backdrop-blur {
  -webkit-backdrop-filter: blur(12px) saturate(180%);
  backdrop-filter: blur(12px) saturate(180%);
  background: rgba(11, 17, 32, 0.8);
}

/* Improved link underlines */
a {
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
  transition: all 0.2s ease;
}

a:hover {
  text-decoration-thickness: 2px;
  text-underline-offset: 4px;
}

/* Enhanced focus rings for better accessibility */
*:focus-visible {
  outline: 2px solid var(--color-accent);
  outline-offset: 3px;
  border-radius: 4px;
  box-shadow: 0 0 0 4px rgba(96, 165, 250, 0.1);
}

/* Subtle page glow effect */
body::before {
  content: '';
  position: fixed;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: radial-gradient(
    circle at 50% 0%,
    rgba(96, 165, 250, 0.03) 0%,
    transparent 50%
  );
  pointer-events: none;
  z-index: -1;
}

/* Award badge refinements */
.award-badge {
  background: linear-gradient(135deg, rgba(37, 99, 235, 0.1), rgba(139, 92, 246, 0.08));
  border: 1px solid rgba(96, 165, 250, 0.25);
  box-shadow:
    0 8px 24px rgba(37, 99, 235, 0.2),
    inset 0 1px 0 rgba(255, 255, 255, 0.1);
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.award-badge:hover {
  border-color: rgba(96, 165, 250, 0.4);
  box-shadow:
    0 12px 32px rgba(37, 99, 235, 0.3),
    inset 0 1px 0 rgba(255, 255, 255, 0.15);
}

/* Light theme adjustments */
html[data-theme="light"] .item,
html[data-theme="light"] .resume-card {
  background: linear-gradient(135deg, #ffffff 0%, var(--color-surface-alt) 100%);
  border-color: var(--color-border);
  box-shadow: 0 4px 12px rgba(15, 23, 42, 0.06);
}

html[data-theme="light"] .item:hover,
html[data-theme="light"] .resume-card:hover {
  border-color: rgba(59, 130, 246, 0.3);
  box-shadow:
    0 12px 32px rgba(15, 23, 42, 0.1),
    0 0 0 1px rgba(59, 130, 246, 0.2);
}

html[data-theme="light"] ::selection {
  background: rgba(59, 130, 246, 0.2);
  color: var(--color-text);
}

/* Enhanced typography with better spacing */
h1, h2, h3, h4, h5, h6 {
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

p, li {
  text-rendering: optimizeLegibility;
}

/* Improved image rendering */
img {
  image-rendering: -webkit-optimize-contrast;
  image-rendering: crisp-edges;
}

/* Premium glass morphism for navigation */
.nav {
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  backdrop-filter: blur(20px) saturate(180%);
  background: rgba(11, 17, 32, 0.85) !important;
  border-radius: var(--radius-pill);
  box-shadow:
    0 8px 32px rgba(2, 6, 23, 0.3),
    inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

/* Enhanced hero section depth */
header.site-hero {
  position: relative;
  overflow: hidden;
}

header.site-hero::before {
  content: '';
  position: absolute;
  top: -50%;
  right: -20%;
  width: 100%;
  height: 150%;
  background: radial-gradient(
    ellipse at 70% 30%,
    rgba(96, 165, 250, 0.15),
    transparent 50%
  );
  pointer-events: none;
  animation: float-glow 20s ease-in-out infinite;
}

@keyframes float-glow {
  0%, 100% {
    transform: translate(0, 0) scale(1);
    opacity: 0.5;
  }
  50% {
    transform: translate(-10%, 10%) scale(1.1);
    opacity: 0.8;
  }
}

/* Premium portfolio item images */
.item img {
  transition: all 0.6s cubic-bezier(0.16, 1, 0.3, 1);
  filter: brightness(0.95) contrast(1.05);
}

.item:hover img {
  filter: brightness(1) contrast(1.1);
  transform: scale(1.03);
}

/* Enhanced publication items */
.item h3 {
  color: var(--color-text);
  transition: all 0.3s ease;
}

.item:hover h3 {
  color: var(--color-accent);
  text-shadow: 0 0 20px rgba(96, 165, 250, 0.4);
}

/* Refined footer with subtle gradient */
footer {
  background: linear-gradient(
    180deg,
    var(--color-background) 0%,
    var(--color-background-alt) 100%
  );
  border-top: 1px solid rgba(96, 165, 250, 0.1);
  box-shadow: inset 0 1px 0 rgba(96, 165, 250, 0.05);
}

/* Enhanced code blocks */
code, pre {
  background: linear-gradient(135deg, var(--color-surface-alt), var(--color-surface));
  border: 1px solid rgba(96, 165, 250, 0.1);
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.1);
}

/* Smooth loading states */
.loading {
  background: linear-gradient(
    90deg,
    var(--color-surface) 0%,
    var(--color-surface-alt) 50%,
    var(--color-surface) 100%
  );
  background-size: 200% 100%;
  animation: shimmer 2s ease-in-out infinite;
}

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

/* Enhanced quote/testimonial styling */
blockquote {
  border-left: 4px solid var(--color-accent);
  background: linear-gradient(
    90deg,
    rgba(96, 165, 250, 0.05),
    transparent
  );
  box-shadow:
    0 8px 24px rgba(2, 6, 23, 0.1),
    inset 4px 0 0 var(--color-accent);
}

/* Premium tag/badge styling */
.tag, .badge {
  background: linear-gradient(135deg, rgba(96, 165, 250, 0.15), rgba(139, 92, 246, 0.1));
  border: 1px solid rgba(96, 165, 250, 0.25);
  padding: 0.25rem 0.75rem;
  border-radius: var(--radius-pill);
  font-size: 0.85rem;
  font-weight: 500;
  box-shadow: 0 2px 8px rgba(96, 165, 250, 0.1);
  transition: all 0.3s ease;
}

.tag:hover, .badge:hover {
  background: linear-gradient(135deg, rgba(96, 165, 250, 0.25), rgba(139, 92, 246, 0.15));
  border-color: rgba(96, 165, 250, 0.4);
  box-shadow: 0 4px 12px rgba(96, 165, 250, 0.2);
  transform: translateY(-1px);
}

/* Reduced motion overrides */
@media (prefers-reduced-motion: reduce) {
  .item,
  .resume-card,
  .button,
  button,
  .hero-stats li {
    transition: none;
  }

  .item::before,
  .item::after,
  .resume-card::before,
  .resume-card::after,
  .button::before,
  button::before {
    display: none;
    animation: none;
  }

  header.site-hero::before {
    animation: none;
  }

  @keyframes rotate-gradient,
  @keyframes float-glow,
  @keyframes shimmer {
    to {
      transform: none;
      background-position: 0 0;
    }
  }
}
