/**
 * Final Polish & Transform Override
 * Ensures NO tilting and adds ultimate visual refinement
 */

/* CRITICAL: Disable ALL animations that use rotation */
@keyframes rotate-gradient {
  to {
    transform: none !important;
  }
}

.item::before,
.resume-card::before {
  animation: none !important;
  opacity: 0 !important;
  display: none !important;
}

/* CRITICAL: Override any transforms that cause tilting */
.item,
.item *,
.resume-card,
.resume-card *,
.award-badge,
.award-badge * {
  /* Remove any rotation transforms */
  transform: none !important;
  animation: none !important;
}

/* Allow ONLY vertical lift and scale on hover - NO rotation */
.item:hover {
  transform: translateY(-3px) !important;
  animation: none !important;
}

.resume-card:hover {
  transform: translateY(-3px) !important;
  animation: none !important;
}

/* Allow nested image zoom ONLY - NO rotation */
.item:hover img {
  transform: scale(1.02) !important;
  animation: none !important;
}

.resume-card:hover img {
  transform: scale(1.02) !important;
  animation: none !important;
}

/* Enhanced visual depth without any rotation */
.item,
.resume-card {
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  transform-style: flat;
  -webkit-transform-style: flat;
}

/* Premium glow enhancement on hover */
.item:hover,
.resume-card:hover {
  box-shadow:
    0 16px 40px rgba(2, 6, 23, 0.18),
    0 0 0 1px rgba(96, 165, 250, 0.15),
    0 0 32px rgba(96, 165, 250, 0.08),
    inset 0 1px 0 rgba(255, 255, 255, 0.05),
    inset 0 -1px 0 rgba(96, 165, 250, 0.06) !important;
}

/* Enhanced border glow */
.item {
  border: 1px solid var(--color-border);
  background: linear-gradient(150deg, var(--color-surface) 0%, var(--color-surface-alt) 100%);
}

.item:hover {
  border-color: rgba(96, 165, 250, 0.35) !important;
  background: linear-gradient(150deg, var(--color-surface-alt) 0%, var(--color-surface) 100%);
}

/* Refined stat cards with better glow */
.hero-stats li {
  position: relative;
  overflow: hidden;
}

.hero-stats li::before {
  content: '';
  position: absolute;
  inset: -1px;
  background: linear-gradient(
    135deg,
    rgba(96, 165, 250, 0.1),
    rgba(139, 92, 246, 0.05)
  );
  opacity: 0;
  transition: opacity 0.4s ease;
  border-radius: inherit;
  z-index: -1;
}

.hero-stats li:hover::before {
  opacity: 1;
}

.hero-stats li:hover {
  transform: translateY(-2px);
  border-color: rgba(96, 165, 250, 0.35);
}

/* Premium button shimmer effect */
.button::after,
button::after {
  content: '';
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: linear-gradient(
    45deg,
    transparent 30%,
    rgba(255, 255, 255, 0.2) 50%,
    transparent 70%
  );
  transform: translateX(-100%);
  transition: transform 0.6s ease;
}

.button:hover::after,
button:hover::after {
  transform: translateX(100%);
}

/* Enhanced hero badge with pulse */
.hero-badge {
  position: relative;
  box-shadow: 0 4px 16px rgba(96, 165, 250, 0.2);
}

.hero-badge::before {
  content: '';
  position: absolute;
  inset: -2px;
  background: linear-gradient(
    135deg,
    rgba(96, 165, 250, 0.3),
    rgba(139, 92, 246, 0.2)
  );
  border-radius: inherit;
  opacity: 0;
  transition: opacity 0.4s ease;
  z-index: -1;
  filter: blur(8px);
}

.hero-badge:hover::before {
  opacity: 1;
}

/* Refined publication links with better glow */
.publication-links a {
  position: relative;
  z-index: 1;
}

.publication-links a::after {
  content: '';
  position: absolute;
  inset: -4px;
  background: radial-gradient(
    circle at center,
    rgba(96, 165, 250, 0.15),
    transparent 70%
  );
  opacity: 0;
  transition: opacity 0.3s ease;
  border-radius: inherit;
  z-index: -1;
  filter: blur(6px);
}

.publication-links a:hover::after {
  opacity: 1;
}

/* Enhanced social icons with premium glow */
.hero-social li a {
  position: relative;
  overflow: visible;
}

.hero-social li a::after {
  content: '';
  position: absolute;
  inset: -6px;
  background: radial-gradient(
    circle,
    rgba(96, 165, 250, 0.3),
    transparent 60%
  );
  opacity: 0;
  transition: opacity 0.3s ease;
  border-radius: 50%;
  z-index: -1;
  filter: blur(10px);
}

.hero-social li a:hover::after {
  opacity: 1;
}

/* Premium section dividers */
section + section::before {
  content: '';
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 100px;
  height: 1px;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(96, 165, 250, 0.3),
    transparent
  );
}

/* Enhanced scrollbar with better colors */
::-webkit-scrollbar {
  width: 12px;
  height: 12px;
}

::-webkit-scrollbar-track {
  background: var(--color-background-alt);
  border-left: 1px solid var(--color-border);
}

::-webkit-scrollbar-thumb {
  background: linear-gradient(
    180deg,
    rgba(96, 165, 250, 0.6),
    rgba(139, 92, 246, 0.6)
  );
  border-radius: 6px;
  border: 2px solid var(--color-background-alt);
  box-shadow: 0 0 6px rgba(96, 165, 250, 0.3);
}

::-webkit-scrollbar-thumb:hover {
  background: linear-gradient(
    180deg,
    rgba(96, 165, 250, 0.8),
    rgba(139, 92, 246, 0.8)
  );
  box-shadow: 0 0 10px rgba(96, 165, 250, 0.5);
}

/* Refined h2 underline with glow */
h2::after {
  box-shadow: 0 0 12px rgba(96, 165, 250, 0.5);
}

/* Premium glass effect for cards with enhanced depth */
.item::after,
.resume-card::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(
    180deg,
    rgba(255, 255, 255, 0.05) 0%,
    transparent 40%,
    transparent 60%,
    rgba(0, 0, 0, 0.03) 100%
  );
  border-radius: inherit;
  pointer-events: none;
  z-index: 10;
}

/* Stunning hover glow aura */
.item,
.resume-card {
  position: relative;
  isolation: isolate;
}

.item::after,
.resume-card::after {
  transition: all 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}

.item:hover::after,
.resume-card:hover::after {
  background: linear-gradient(
    180deg,
    rgba(255, 255, 255, 0.08) 0%,
    rgba(96, 165, 250, 0.02) 50%,
    rgba(0, 0, 0, 0.03) 100%
  );
}

/* Improved portrait image with border glow */
.portrait-card img {
  box-shadow:
    0 8px 32px rgba(2, 6, 23, 0.3),
    0 0 0 1px rgba(96, 165, 250, 0.1),
    inset 0 0 20px rgba(0, 0, 0, 0.1);
}

.portrait-card:hover img {
  box-shadow:
    0 12px 40px rgba(2, 6, 23, 0.4),
    0 0 0 2px rgba(96, 165, 250, 0.3),
    0 0 30px rgba(96, 165, 250, 0.2),
    inset 0 0 20px rgba(0, 0, 0, 0.1);
}

/* Enhanced footer with subtle glow */
footer {
  position: relative;
}

footer::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(96, 165, 250, 0.3),
    transparent
  );
  box-shadow: 0 0 10px rgba(96, 165, 250, 0.2);
}

/* Smooth page transitions */
* {
  transition-timing-function: cubic-bezier(0.16, 1, 0.3, 1);
}

/* Ensure no transforms interfere */
@media (prefers-reduced-motion: no-preference) {
  /* Allow ONLY safe transforms */
  .item:hover {
    transform: translateY(-6px) !important;
  }

  .resume-card:hover {
    transform: translateY(-6px) !important;
  }

  .item:hover img {
    transform: scale(1.04) !important;
  }
}

/* Completely disable transforms for reduced motion */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    transform: none !important;
    animation: none !important;
    transition: none !important;
  }
}

/* ========================================
   ULTIMATE VISUAL ENHANCEMENTS
   ======================================== */

/* Stunning card borders with double-layer glow */
.item,
.resume-card {
  border: 1px solid rgba(96, 165, 250, 0.15);
  background:
    linear-gradient(150deg, var(--color-surface) 0%, var(--color-surface-alt) 100%),
    radial-gradient(circle at 50% 0%, rgba(96, 165, 250, 0.03), transparent 60%);
  background-blend-mode: normal, screen;
}

.item:hover,
.resume-card:hover {
  border-color: rgba(96, 165, 250, 0.5) !important;
  background:
    linear-gradient(150deg, var(--color-surface-alt) 0%, var(--color-surface) 100%),
    radial-gradient(circle at 50% 0%, rgba(96, 165, 250, 0.08), transparent 60%);
  background-blend-mode: normal, screen;
}

/* Enhanced text shadows for depth */
h1, h2, h3 {
  text-shadow: 0 2px 20px rgba(96, 165, 250, 0.15);
}

.hero-content h1 {
  text-shadow:
    0 2px 30px rgba(96, 165, 250, 0.3),
    0 4px 60px rgba(96, 165, 250, 0.2);
}

/* Premium link hover effects */
a:not(.button):not(.btn) {
  position: relative;
  transition: color 0.3s ease;
}

a:not(.button):not(.btn)::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 100%;
  height: 2px;
  background: linear-gradient(90deg, var(--color-accent), var(--color-accent-purple));
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  border-radius: 1px;
}

a:not(.button):not(.btn):hover::after {
  transform: scaleX(1);
}

/* Remove underlines from Impact section links (resume cards, project links) */
.resume-card a,
.item h3 a,
.item a,
#portfolio a,
#resume a {
  text-decoration: none !important;
}

.resume-card a::after,
.item h3 a::after,
.item a::after,
#portfolio a::after,
#resume a::after {
  display: none !important;
}

/* Elegant stat card enhancements */
.hero-stats li {
  position: relative;
  background: linear-gradient(135deg, rgba(37, 99, 235, 0.08), rgba(139, 92, 246, 0.06));
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.hero-stats li::after {
  content: '';
  position: absolute;
  inset: -1px;
  background: linear-gradient(
    135deg,
    rgba(96, 165, 250, 0.2),
    rgba(139, 92, 246, 0.1)
  );
  opacity: 0;
  transition: opacity 0.4s ease;
  border-radius: inherit;
  z-index: -1;
  filter: blur(8px);
}

.hero-stats li:hover::after {
  opacity: 1;
}

/* Sophisticated badge styling */
.hero-badge {
  position: relative;
  background: linear-gradient(135deg, rgba(96, 165, 250, 0.15), rgba(139, 92, 246, 0.12));
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  box-shadow:
    0 4px 16px rgba(96, 165, 250, 0.2),
    inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

.hero-badge::before {
  filter: blur(12px);
}

/* Publication links with radiant glow */
.publication-links a {
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.publication-links a:hover {
  text-shadow: 0 0 20px rgba(96, 165, 250, 0.6);
  transform: translateY(-1px) !important;
}

/* Social icons with pulsing effect */
.hero-social li a {
  transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.hero-social li a:hover {
  transform: translateY(-3px) scale(1.08) !important;
  box-shadow:
    0 12px 28px rgba(96, 165, 250, 0.4),
    inset 0 1px 0 rgba(255, 255, 255, 0.15);
}

/* Enhanced section spacing with subtle dividers */
section {
  position: relative;
}

section + section::before {
  content: '';
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 120px;
  height: 2px;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(96, 165, 250, 0.4),
    rgba(139, 92, 246, 0.3),
    transparent
  );
  box-shadow: 0 0 12px rgba(96, 165, 250, 0.3);
}

/* Premium code styling */
code, pre {
  background: linear-gradient(135deg, rgba(37, 99, 235, 0.08), rgba(139, 92, 246, 0.05));
  border: 1px solid rgba(96, 165, 250, 0.15);
  box-shadow:
    inset 0 1px 3px rgba(0, 0, 0, 0.1),
    0 2px 8px rgba(96, 165, 250, 0.05);
}

/* Refined tag/badge styling */
.tag, .badge {
  background: linear-gradient(135deg, rgba(96, 165, 250, 0.15), rgba(139, 92, 246, 0.12));
  border: 1px solid rgba(96, 165, 250, 0.3);
  box-shadow:
    0 2px 8px rgba(96, 165, 250, 0.15),
    inset 0 1px 0 rgba(255, 255, 255, 0.1);
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.tag:hover, .badge:hover {
  transform: translateY(-2px) scale(1.02) !important;
  background: linear-gradient(135deg, rgba(96, 165, 250, 0.25), rgba(139, 92, 246, 0.18));
  box-shadow:
    0 6px 16px rgba(96, 165, 250, 0.3),
    inset 0 1px 0 rgba(255, 255, 255, 0.15);
}

/* Cinematic header with atmospheric glow */
header.site-hero {
  position: relative;
  overflow: hidden;
}

header.site-hero::after {
  content: '';
  position: absolute;
  top: -30%;
  left: 20%;
  width: 60%;
  height: 100%;
  background: radial-gradient(
    ellipse at 50% 50%,
    rgba(96, 165, 250, 0.08),
    transparent 60%
  );
  pointer-events: none;
  filter: blur(60px);
}

/* Enhanced navigation with premium backdrop */
.nav {
  backdrop-filter: blur(24px) saturate(180%);
  -webkit-backdrop-filter: blur(24px) saturate(180%);
  background: rgba(11, 17, 32, 0.88) !important;
  border-radius: var(--radius-pill);
}

/* Footer elegance */
footer {
  position: relative;
  background: linear-gradient(
    180deg,
    var(--color-background) 0%,
    rgba(11, 17, 32, 0.95) 100%
  );
  border-top: 1px solid rgba(96, 165, 250, 0.2);
}

footer::before {
  box-shadow: 0 0 20px rgba(96, 165, 250, 0.3);
}

/* Smooth fade-in animation */
@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Light theme refinements */
html[data-theme="light"] .item,
html[data-theme="light"] .resume-card {
  background:
    linear-gradient(150deg, #ffffff 0%, var(--color-surface-alt) 100%),
    radial-gradient(circle at 50% 0%, rgba(59, 130, 246, 0.03), transparent 60%);
  box-shadow:
    0 4px 12px rgba(15, 23, 42, 0.08),
    0 0 0 1px rgba(59, 130, 246, 0.08);
}

html[data-theme="light"] .item:hover,
html[data-theme="light"] .resume-card:hover {
  box-shadow:
    0 16px 40px rgba(15, 23, 42, 0.12),
    0 0 0 1px rgba(59, 130, 246, 0.3),
    0 0 30px rgba(59, 130, 246, 0.15);
}
