/* Performance Optimizations & Lazy Loading */
/* Font Loading Optimization */
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 300 700;
  font-display: swap;
  src: url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap');
}

/* Lazy Loading States */
img[data-src] {
  opacity: 0;
  transition: opacity 0.3s ease;
  background: linear-gradient(90deg, 
    var(--bg-secondary) 25%, 
    rgba(139, 92, 246, 0.1) 50%, 
    var(--bg-secondary) 75%
  );
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
}

img.loading {
  opacity: 0.6;
  filter: blur(2px);
}

img.loaded {
  opacity: 1;
  filter: none;
}

img.error {
  opacity: 0.5;
  background: var(--bg-secondary);
  position: relative;
}

img.error::after {
  content: '🖼️';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 2rem;
  opacity: 0.6;
}

/* Shimmer animation for loading states */
@keyframes shimmer {
  0% {
    background-position: -200% 0;
  }
  100% {
    background-position: 200% 0;
  }
}

/* Background lazy loading */
[data-bg] {
  background: linear-gradient(90deg, 
    var(--bg-secondary) 25%, 
    rgba(139, 92, 246, 0.1) 50%, 
    var(--bg-secondary) 75%
  );
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
}

/* Critical CSS - Above the fold content */
.critical-content {
  contain: layout style paint;
}

/* Performance optimized animations */
.performance-animation {
  will-change: transform;
  transform: translateZ(0);
}

/* 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;
    scroll-behavior: auto !important;
  }
  
  img[data-src],
  [data-bg],
  .shimmer {
    animation: none !important;
  }
}

/* Resource hints for better loading */
.preload-hint {
  visibility: hidden;
  position: absolute;
  width: 1px;
  height: 1px;
}

/* Content loading states */
.content-loading {
  opacity: 0.7;
  pointer-events: none;
  position: relative;
}

.content-loading::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(90deg, 
    transparent 25%, 
    rgba(139, 92, 246, 0.1) 50%, 
    transparent 75%
  );
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  z-index: 1;
}

/* Optimized grid layouts */
.optimized-grid {
  display: grid;
  contain: layout style;
  content-visibility: auto;
  contain-intrinsic-size: 0 400px;
}

/* Virtual scrolling support */
.virtual-item {
  content-visibility: auto;
  contain-intrinsic-size: 0 200px;
}

/* CSS Variables for Theme - Updated July 2025 with Lila Color Scheme */
:root {
  /* Primary Lila/Purple Colors */
  --primary-color: #8b5cf6;
  --primary-hover: #7c3aed;
  --primary-light: #a78bfa;
  --primary-gradient: linear-gradient(135deg, #8b5cf6 0%, #a855f7 50%, #c084fc 100%);
  
  /* Text Colors */
  --text-color: #1f2937;
  --text-secondary: #6b7280;
  --secondary-text: #6b7280;
  
  /* Background Colors */
  --bg-color: #ffffff;
  --bg-secondary: #f9fafb;
  --card-bg: #ffffff;
  --border-color: #e5e7eb;
  --accent-color: #8b5cf6;
  --accent-hover: #7c3aed;
  
  /* Shadows with Lila Tint */
  --shadow: 0 1px 3px 0 rgba(139, 92, 246, 0.1), 0 1px 2px 0 rgba(139, 92, 246, 0.06);
  --shadow-lg: 0 10px 15px -3px rgba(139, 92, 246, 0.1), 0 4px 6px -2px rgba(139, 92, 246, 0.05);
  --transition: all 0.3s ease;
}

/* Dark Theme with Enhanced Lila Colors */
[data-theme="dark"] {
  --primary-color: #a78bfa;
  --primary-hover: #8b5cf6;
  --primary-light: #c4b5fd;
  --primary-gradient: linear-gradient(135deg, #a78bfa 0%, #c084fc 50%, #ddd6fe 100%);
  --text-color: #f9fafb;
  --text-secondary: #d1d5db;
  --secondary-text: #d1d5db;
  --bg-color: #111827;
  --bg-secondary: #1f2937;
  --card-bg: #1f2937;
  --border-color: #374151;
  --accent-color: #a78bfa;
  --accent-hover: #8b5cf6;
  --text-secondary: #d1d5db;
  --bg-color: #111827;
  --bg-secondary: #1f2937;
  --border-color: #374151;
  --shadow: 0 1px 3px 0 rgba(167, 139, 250, 0.4), 0 1px 2px 0 rgba(167, 139, 250, 0.3);
  --shadow-lg: 0 10px 15px -3px rgba(167, 139, 250, 0.4), 0 4px 6px -2px rgba(167, 139, 250, 0.3);
}

/* Reset and Base Styles */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  line-height: 1.6;
  color: var(--text-color);
  background-color: var(--bg-color);
  transition: var(--transition);
}

/* Global Link Styles with Lila Theme */
a {
  color: var(--primary-color);
  text-decoration: underline;
  text-decoration-color: rgba(139, 92, 246, 0.3);
  text-underline-offset: 2px;
  transition: var(--transition);
}

a:hover {
  color: var(--primary-hover);
  text-decoration-color: var(--primary-hover);
  text-decoration-thickness: 2px;
}

a:visited {
  color: #9333ea; /* Slightly different purple for visited links */
}

a:active {
  color: var(--primary-hover);
}

/* Specific link styles for different contexts */
.post-content a,
.cv-section a,
.card a:not(.btn),
.project-content a:not(.btn) {
  color: var(--primary-color);
  font-weight: 500;
  text-decoration: underline;
  text-decoration-color: rgba(139, 92, 246, 0.4);
  text-underline-offset: 3px;
}

.post-content a:hover,
.cv-section a:hover,
.card a:not(.btn):hover,
.project-content a:hover:not(.btn) {
  color: var(--primary-hover);
  text-decoration-color: var(--primary-hover);
  text-decoration-thickness: 2px;
}

.wrapper {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1rem;
  animation: fadeInUp 0.8s ease forwards;
}

/* Header Styles */
.site-header {
  background-color: var(--bg-color);
  border-bottom: 1px solid var(--border-color);
  position: sticky;
  top: 0;
  z-index: 100;
  backdrop-filter: blur(10px);
  transition: var(--transition);
  animation: slideDown 0.6s ease forwards;
}

.site-nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 0;
}

.nav-brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.nav-brand a {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text-color);
  text-decoration: none;
  transition: var(--transition);
}

.nav-brand a:hover {
  color: var(--primary-color);
}

.nav-avatar {
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--border-color);
  transition: var(--transition);
}

.nav-avatar:hover {
  border-color: var(--primary-color);
  transform: scale(1.05);
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 2rem;
}

.nav-links a {
  color: var(--text-secondary);
  text-decoration: none;
  font-weight: 500;
  transition: var(--transition);
  position: relative;
  animation: fadeInRight 0.6s ease forwards;
}

.nav-links a:hover,
.nav-links a.active {
  color: var(--primary-color);
}

.nav-links a.active::after {
  content: '';
  position: absolute;
  bottom: -0.5rem;
  left: 0;
  right: 0;
  height: 2px;
  background-color: var(--primary-color);
}

.theme-toggle {
  background: none;
  border: 1px solid var(--border-color);
  border-radius: 50%;
  width: 2.5rem;
  height: 2.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: var(--transition);
  color: var(--text-color);
}

.theme-toggle:hover {
  background-color: var(--bg-secondary);
  border-color: var(--primary-color);
}

.nav-toggle {
  display: none;
  flex-direction: column;
  cursor: pointer;
  gap: 4px;
}

.nav-toggle span {
  width: 25px;
  height: 3px;
  background-color: var(--text-color);
  transition: var(--transition);
}

/* Main Content */
.page-content {
  min-height: calc(100vh - 200px);
  padding: 2rem 0;
}

/* Hero Section */
.hero {
  text-align: center;
  padding: 4rem 0;
  background: linear-gradient(135deg, var(--bg-color) 0%, rgba(139, 92, 246, 0.03) 50%, var(--bg-secondary) 100%);
  margin-bottom: 3rem;
  border-radius: 1rem;
  border: 1px solid rgba(139, 92, 246, 0.1);
  position: relative;
  overflow: hidden;
  animation: fadeInUp 1s ease 0.2s both;
}

.hero::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(45deg, transparent, rgba(139, 92, 246, 0.05), transparent);
  animation: heroGlow 8s ease-in-out infinite;
  pointer-events: none;
  z-index: 0;
}

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

@keyframes heroGlow {
  0%, 100% {
    transform: translateX(-100%);
    opacity: 0;
  }
  50% {
    transform: translateX(100%);
    opacity: 1;
  }
}

.hero h1 {
  font-size: 3rem;
  font-weight: 700;
  margin-bottom: 1rem;
  background: linear-gradient(135deg, var(--primary-color), var(--primary-hover));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  position: relative;
  display: inline-block;
}

.hero h1::after {
  content: '';
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  height: 2px;
  background: var(--primary-gradient);
  transform: scaleX(0);
  transition: transform 0.6s ease;
}

.hero h1:hover::after {
  transform: scaleX(1);
}

.hero p {
  font-size: 1.25rem;
  color: var(--text-secondary);
  max-width: 600px;
  margin: 0 auto 2rem;
}

.hero-buttons {
  display: flex;
  gap: 1rem;
  justify-content: center;
  flex-wrap: wrap;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1.5rem;
  border-radius: 0.5rem;
  text-decoration: none;
  font-weight: 500;
  transition: var(--transition);
  border: none;
  cursor: pointer;
  position: relative;
  overflow: hidden;
  transform: translateZ(0); /* Enable hardware acceleration */
}

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

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

.btn-primary {
  background: var(--primary-gradient);
  color: #ffffff !important;
  border: none;
  position: relative;
  overflow: hidden;
  text-decoration: none !important;
}

.btn-primary::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
  transition: left 0.5s;
}

.btn-primary:hover::before {
  left: 100%;
}

.btn-primary:hover {
  background: linear-gradient(135deg, #7c3aed 0%, #8b5cf6 50%, #a855f7 100%);
  transform: translateY(-2px);
  box-shadow: 0 10px 25px rgba(139, 92, 246, 0.3);
  color: #ffffff !important;
}

.btn-secondary {
  background-color: transparent;
  color: var(--text-color) !important;
  border: 1px solid var(--border-color);
  text-decoration: none !important;
}

.btn-secondary:hover {
  background-color: var(--bg-secondary);
  transform: translateY(-2px);
  border-color: var(--primary-color);
  color: var(--primary-color) !important;
}

/* Grid System */
.grid {
  display: grid;
  gap: 2rem;
  width: 100%;
}

.grid-2 {
  grid-template-columns: repeat(2, 1fr);
}

.grid-3 {
  grid-template-columns: repeat(3, 1fr);
}

.grid-4 {
  grid-template-columns: repeat(4, 1fr);
}

/* Home page section styling with improved spacing */
.home-sections .grid {
  gap: 3rem;
}

.home-sections .card {
  position: relative;
  background: var(--bg-color);
  border-radius: 12px;
  overflow: hidden;
  box-shadow: var(--shadow);
  transition: var(--transition);
  border: 1px solid var(--border-color);
  animation: float 6s ease-in-out infinite;
  padding: 2.5rem;
  min-height: 200px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.home-sections .card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
}

.home-sections .card:nth-child(2n) {
  animation-delay: -2s;
}

.home-sections .card h3 {
  font-size: 1.5rem;
  margin-bottom: 1.5rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.home-sections .card h3 i {
  color: var(--primary-color);
  font-size: 1.25rem;
}

.home-sections .card p {
  font-size: 1.1rem;
  line-height: 1.7;
  margin-bottom: 2rem;
  flex-grow: 1;
}

.home-sections .card .read-more {
  margin-top: auto;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  transition: var(--transition);
}

.home-sections .card .read-more:hover {
  transform: translateX(5px);
}

/* Enhanced mobile spacing */
@media (max-width: 768px) {
  .home-sections .grid {
    gap: 2rem;
  }
  
  .home-sections .card {
    padding: 2rem;
    min-height: auto;
  }
  
  .home-sections .card h3 {
    font-size: 1.25rem;
    margin-bottom: 1rem;
  }
  
  .home-sections .card p {
    font-size: 1rem;
    margin-bottom: 1.5rem;
  }
}

/* Projects Page Styles */
.projects-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
  gap: 2rem;
  margin-top: 2rem;
}

.project-card {
  background: var(--bg-color);
  border-radius: 12px;
  overflow: hidden;
  box-shadow: var(--shadow);
  transition: var(--transition);
  border: 1px solid var(--border-color);
  animation: float 6s ease-in-out infinite;
}

.project-card:nth-child(2n) {
  animation-delay: -2s;
}

.project-card:nth-child(3n) {
  animation-delay: -4s;
}

@keyframes float {
  0%, 100% {
    transform: translateY(0px);
  }
  50% {
    transform: translateY(-10px);
  }
}

.project-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
}

.project-card.featured {
  grid-column: span 2;
}

.project-image {
  position: relative;
  height: 200px;
  background: linear-gradient(135deg, var(--primary-color), var(--primary-hover));
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 3rem;
  overflow: hidden;
}

.project-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.project-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.8);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: var(--transition);
}

.project-card:hover .project-overlay {
  opacity: 1;
}

.project-links {
  display: flex;
  gap: 1rem;
}

.project-content {
  padding: 1.5rem;
}

.project-badge {
  background: var(--primary-color);
  color: white;
  padding: 0.25rem 0.75rem;
  border-radius: 12px;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.project-content h3 {
  margin: 1rem 0 0.5rem 0;
  color: var(--text-color);
}

.project-content p {
  color: var(--text-secondary);
  line-height: 1.6;
  margin-bottom: 1rem;
}

.tech-stack {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.tech-tag {
  background: var(--bg-secondary);
  color: var(--text-secondary);
  padding: 0.25rem 0.75rem;
  border-radius: 6px;
  font-size: 0.875rem;
  font-weight: 500;
  border: 1px solid var(--border-color);
  transition: var(--transition);
  cursor: default;
}

.tech-tag:hover {
  background: rgba(139, 92, 246, 0.1);
  border-color: var(--primary-color);
  color: var(--primary-color);
  transform: translateY(-1px);
}

.project-stats {
  display: flex;
  gap: 1rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border-color);
}

.stat {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--text-secondary);
  font-size: 0.875rem;
}

.stat i {
  color: var(--primary-color);
}

/* CV Specific Styles */
.skill-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.75rem;
}

.skill-tag {
  background: var(--bg-secondary);
  color: var(--text-secondary);
  padding: 0.375rem 0.875rem;
  border-radius: 8px;
  font-size: 0.875rem;
  font-weight: 500;
  border: 1px solid var(--border-color);
  transition: var(--transition);
  cursor: default;
}

.skill-tag:hover {
  background: rgba(139, 92, 246, 0.1);
  border-color: var(--primary-color);
  color: var(--primary-color);
  transform: translateY(-1px);
}

.skill-category {
  margin-bottom: 1.5rem;
}

.skill-category h4 {
  color: var(--text-color);
  margin-bottom: 0.5rem;
  font-size: 1.1rem;
  font-weight: 600;
}

.skills-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 2rem;
  margin-top: 1.5rem;
}

.cv-section {
  margin-bottom: 3rem;
}

.cv-section h2 {
  color: var(--text-color);
  margin-bottom: 1.5rem;
  padding-bottom: 0.75rem;
  border-bottom: 2px solid var(--primary-color);
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.cv-section h2 i {
  color: var(--primary-color);
}

.experience-item, .education-item {
  margin-bottom: 2rem;
  padding: 1.5rem;
  background: var(--bg-secondary);
  border-radius: 8px;
  border-left: 4px solid var(--primary-color);
}

.experience-item h3, .education-item h3 {
  color: var(--text-color);
  margin-bottom: 0.5rem;
}

.experience-meta, .education-meta {
  color: var(--text-secondary);
  margin-bottom: 1rem;
  font-size: 0.9rem;
}

.experience-meta i, .education-meta i {
  color: var(--primary-color);
  margin-right: 0.25rem;
}

.experience-item ul {
  margin-left: 1rem;
}

.experience-item li {
  margin-bottom: 0.5rem;
  color: var(--text-secondary);
}

/* Specific Link Styles */
.read-more {
  color: var(--primary-color) !important;
  text-decoration: none !important;
  font-weight: 600;
  font-size: 0.9rem;
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  transition: var(--transition);
  border-bottom: 1px solid transparent;
}

.read-more:hover {
  color: var(--primary-hover) !important;
  border-bottom-color: var(--primary-hover);
  transform: translateX(2px);
}

/* Post and Blog Links */
.post-preview h2 a,
.post-preview h3 a {
  color: var(--text-color) !important;
  text-decoration: none !important;
  transition: var(--transition);
}

.post-preview h2 a:hover,
.post-preview h3 a:hover {
  color: var(--primary-color) !important;
}

/* Footer Links */
.footer-links a,
.social-links a {
  color: var(--text-secondary) !important;
  text-decoration: none !important;
  transition: var(--transition);
}

.footer-links a:hover,
.social-links a:hover {
  color: var(--primary-color) !important;
}

/* Email and Contact Links */
a[href^="mailto:"] {
  color: var(--primary-color) !important;
  text-decoration: none !important;
  font-weight: 500;
  border-bottom: 1px solid rgba(139, 92, 246, 0.3);
}

a[href^="mailto:"]:hover {
  color: var(--primary-hover) !important;
  border-bottom-color: var(--primary-hover);
}

/* External Links (LinkedIn, GitHub, etc) */
a[href*="linkedin.com"],
a[href*="github.com"],
a[href*="twitter.com"] {
  color: var(--primary-color) !important;
  text-decoration: none !important;
  font-weight: 500;
}

a[href*="linkedin.com"]:hover,
a[href*="github.com"]:hover,
a[href*="twitter.com"]:hover {
  color: var(--primary-hover) !important;
}

/* Enhanced background animations */
[data-theme="light"] body {
  background: 
    radial-gradient(circle at 20% 20%, rgba(139, 92, 246, 0.03) 0%, transparent 50%),
    radial-gradient(circle at 80% 80%, rgba(168, 85, 247, 0.04) 0%, transparent 50%),
    radial-gradient(circle at 60% 40%, rgba(192, 132, 252, 0.02) 0%, transparent 50%),
    var(--bg-color);
  animation: backgroundShift 20s ease-in-out infinite;
}

[data-theme="dark"] body {
  background: 
    radial-gradient(circle at 30% 30%, rgba(167, 139, 250, 0.08) 0%, transparent 40%),
    radial-gradient(circle at 70% 70%, rgba(196, 181, 253, 0.06) 0%, transparent 40%),
    radial-gradient(circle at 50% 10%, rgba(139, 92, 246, 0.04) 0%, transparent 50%),
    var(--bg-color);
  animation: backgroundShiftDark 25s ease-in-out infinite;
}

@keyframes backgroundShift {
  0%, 100% {
    background-position: 0% 0%, 100% 100%, 50% 50%;
  }
  33% {
    background-position: 30% 20%, 70% 80%, 20% 60%;
  }
  66% {
    background-position: 80% 60%, 20% 30%, 60% 20%;
  }
}

@keyframes backgroundShiftDark {
  0%, 100% {
    background-position: 0% 0%, 100% 100%, 50% 10%;
  }
  25% {
    background-position: 20% 30%, 80% 70%, 70% 50%;
  }
  50% {
    background-position: 70% 80%, 30% 20%, 40% 80%;
  }
  75% {
    background-position: 90% 40%, 10% 60%, 20% 30%;
  }
}

/* Floating particles effect */
body::before {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-image: 
    radial-gradient(2px 2px at 20px 30px, rgba(139, 92, 246, 0.3), transparent),
    radial-gradient(2px 2px at 40px 70px, rgba(168, 85, 247, 0.2), transparent),
    radial-gradient(1px 1px at 90px 40px, rgba(192, 132, 252, 0.4), transparent),
    radial-gradient(1px 1px at 130px 80px, rgba(139, 92, 246, 0.2), transparent),
    radial-gradient(2px 2px at 160px 30px, rgba(168, 85, 247, 0.3), transparent);
  background-repeat: repeat;
  background-size: 200px 100px;
  animation: particlesFloat 30s linear infinite;
  pointer-events: none;
  z-index: -1;
  opacity: 0.6;
}

[data-theme="dark"] body::before {
  background-image: 
    radial-gradient(2px 2px at 20px 30px, rgba(167, 139, 250, 0.4), transparent),
    radial-gradient(2px 2px at 40px 70px, rgba(196, 181, 253, 0.3), transparent),
    radial-gradient(1px 1px at 90px 40px, rgba(221, 214, 254, 0.5), transparent),
    radial-gradient(1px 1px at 130px 80px, rgba(167, 139, 250, 0.3), transparent),
    radial-gradient(2px 2px at 160px 30px, rgba(196, 181, 253, 0.4), transparent);
  opacity: 0.8;
}

@keyframes particlesFloat {
  0% {
    transform: translateY(0px) translateX(0px);
  }
  100% {
    transform: translateY(-100px) translateX(50px);
  }
}

/* Animated gradient borders for hero section */
.hero {
  position: relative;
  overflow: hidden;
}

/* Animated underline for navigation links */
.nav-links a::before {
  content: '';
  position: absolute;
  bottom: -0.5rem;
  left: 50%;
  width: 0;
  height: 2px;
  background: var(--primary-gradient);
  transition: all 0.3s ease;
  transform: translateX(-50%);
}

.nav-links a:hover::before {
  width: 100%;
}

.nav-links a.active::before {
  width: 100%;
}

@media (max-width: 768px) {
  .nav-links {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background-color: var(--bg-color);
    border-top: 1px solid var(--border-color);
    flex-direction: column;
    padding: 1rem;
    gap: 1rem;
  }

  .nav-links.active {
    display: flex;
  }

  .nav-toggle {
    display: flex;
  }

  .hero h1 {
    font-size: 2rem;
  }

  .hero p {
    font-size: 1rem;
  }

  .hero-buttons {
    flex-direction: column;
    align-items: center;
  }

  .post-title {
    font-size: 2rem;
  }

  .post-navigation {
    flex-direction: column;
    gap: 1rem;
  }

  .wrapper {
    padding: 0 0.5rem;
  }

  .projects-grid {
    grid-template-columns: 1fr;
  }
  
  .project-card.featured {
    grid-column: span 1;
  }
  
  .project-links {
    flex-direction: column;
  }
  
  .project-stats {
    flex-direction: column;
    gap: 0.5rem;
  }
}

/* Enhanced JavaScript-powered animations */
.theme-transitioning * {
  transition: all 0.5s ease !important;
}

.animate-in {
  animation: slideInUp 0.6s ease forwards;
}

@keyframes slideInUp {
  from {
    opacity: 0;
    transform: translateY(50px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Ripple effect for buttons */
.ripple {
  position: absolute;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.6);
  transform: scale(0);
  animation: rippleEffect 0.6s linear;
  pointer-events: none;
}

@keyframes rippleEffect {
  to {
    transform: scale(4);
    opacity: 0;
  }
}

/* Loading state */
body:not(.loaded) {
  overflow: hidden;
}

body:not(.loaded) .wrapper {
  opacity: 0;
}

body.loaded .wrapper {
  opacity: 1;
  animation: pageReveal 1s ease forwards;
}

@keyframes pageReveal {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Enhanced theme toggle button */
.theme-toggle {
  position: relative;
  transition: all 0.3s ease;
}

.theme-toggle:hover {
  transform: scale(1.1);
  box-shadow: 0 4px 12px rgba(139, 92, 246, 0.3);
}

.theme-toggle i {
  transition: transform 0.3s ease;
}

/* Performance optimizations */
.card,
.project-card,
.btn {
  will-change: transform;
}

.hero,
.nav-links a {
  will-change: transform, opacity;
}

/* High contrast mode support */
@media (prefers-contrast: high) {
  .card::before,
  .hero::before,
  body::before {
    display: none;
  }
  
  .btn {
    border: 2px solid var(--primary-color);
  }
}

/* Advanced button animations */
.btn {
  position: relative;
  overflow: hidden;
  transform: translateZ(0); /* Enable hardware acceleration */
}

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

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

/* Typing animation for hero text */
@keyframes typing {
  from { width: 0; }
  to { width: 100%; }
}

@keyframes blink {
  0%, 50% { border-color: var(--primary-color); }
  51%, 100% { border-color: transparent; }
}

.hero h1 {
  position: relative;
  display: inline-block;
}

/* Floating animation for project cards */
.project-card {
  animation: float 6s ease-in-out infinite;
}

.project-card:nth-child(2n) {
  animation-delay: -2s;
}

.project-card:nth-child(3n) {
  animation-delay: -4s;
}

@keyframes float {
  0%, 100% {
    transform: translateY(0px);
  }
  50% {
    transform: translateY(-10px);
  }
}

/* Blog page post list spacing */
.post-list {
  display: flex;
  flex-direction: column;
  gap: 2rem;
  margin-top: 2rem;
}

.post-list .post-preview {
  margin-bottom: 0; /* Remove any default margin since we're using gap */
}

/* Skill tags pulse animation on hover */
.skill-tag:hover,
.tech-tag:hover {
  animation: pulse 0.6s ease;
}

@keyframes pulse {
  0% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.05);
  }
  100% {
    transform: scale(1);
  }
}

/* Smooth scroll behavior */
html {
  scroll-behavior: smooth;
}

/* Loading animation for images */
.project-image,
.nav-avatar {
  transition: all 0.3s ease;
}

.project-image:hover {
  transform: scale(1.02);
}

.nav-avatar:hover {
  transform: scale(1.1) rotate(5deg);
}

/* Parallax effect for sections */
.hero,
.cv-section,
.projects-grid {
  transform: translateZ(0); /* Enable hardware acceleration */
}

/* Enhanced focus animations */
*:focus {
  outline: none;
  box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.3);
  transition: box-shadow 0.3s ease;
}

/* Reduced 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;
  }
  
  body::before {
    animation: none;
  }
  
  .hero::before {
    animation: none;
  }
  
  .project-card {
    animation: none;
  }
}

/* Page load animations */
.wrapper {
  animation: fadeInUp 0.8s ease forwards;
}

.hero {
  animation: fadeInUp 1s ease 0.2s both;
}

.card {
  animation: fadeInUp 0.8s ease forwards;
}

.card:nth-child(2) {
  animation-delay: 0.1s;
}

.card:nth-child(3) {
  animation-delay: 0.2s;
}

.card:nth-child(4) {
  animation-delay: 0.3s;
}

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Header animation */
.site-header {
  animation: slideDown 0.6s ease forwards;
}

@keyframes slideDown {
  from {
    opacity: 0;
    transform: translateY(-100%);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Footer animation */
.site-footer {
  animation: fadeIn 1s ease 0.5s both;
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

/* Stagger animation for navigation links */
.nav-links a {
  animation: fadeInRight 0.6s ease forwards;
}

.nav-links a:nth-child(1) { animation-delay: 0.1s; }
.nav-links a:nth-child(2) { animation-delay: 0.2s; }
.nav-links a:nth-child(3) { animation-delay: 0.3s; }
.nav-links a:nth-child(4) { animation-delay: 0.4s; }

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

/* Theme transition animations */
[data-theme="dark"] * {
  transition: background-color 0.5s ease, color 0.5s ease, border-color 0.5s ease;
}

/* Interactive hover effects for social links */
.social-links a {
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
}

.social-links a::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: var(--primary-gradient);
  transition: left 0.3s ease;
  z-index: -1;
}

.social-links a:hover::before {
  left: 0;
}

.social-links a:hover {
  color: white !important;
  transform: translateY(-2px) scale(1.1);
}

/* Footer Styles */
.site-footer {
  background-color: var(--bg-secondary);
  border-top: 1px solid var(--border-color);
  margin-top: 4rem;
  padding: 3rem 0 1rem;
  animation: fadeIn 1s ease 0.5s both;
}

.footer-content {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  gap: 2rem;
  margin-bottom: 2rem;
}

.footer-info h3 {
  color: var(--text-color);
  margin-bottom: 0.5rem;
  font-size: 1.25rem;
}

.footer-info p {
  color: var(--text-secondary);
  line-height: 1.6;
}

.footer-links h4,
.footer-social h4 {
  color: var(--text-color);
  margin-bottom: 1rem;
  font-size: 1.1rem;
  font-weight: 600;
}

.footer-links ul {
  list-style: none;
  padding: 0;
}

.footer-links li {
  margin-bottom: 0.5rem;
}

.footer-links a {
  color: var(--text-secondary) !important;
  text-decoration: none !important;
  transition: var(--transition);
  font-weight: 400;
}

.footer-links a:hover {
  color: var(--primary-color) !important;
  transform: translateX(3px);
}

/* Social Links Styling */
.social-links {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
}

.social-links a {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2.5rem;
  height: 2.5rem;
  background-color: var(--bg-color);
  border: 1px solid var(--border-color);
  border-radius: 50%;
  color: var(--text-secondary) !important;
  text-decoration: none !important;
  transition: var(--transition);
  font-size: 1.1rem;
}

.social-links a:hover {
  background-color: var(--primary-color) !important;
  border-color: var(--primary-color) !important;
  color: white !important;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(139, 92, 246, 0.3);
}

.social-links a:visited {
  color: var(--text-secondary) !important;
}

.social-links a:visited:hover {
  color: white !important;
}

/* Specific social platform colors on hover */
.social-links a[href*="github.com"]:hover {
  background-color: #333 !important;
  border-color: #333 !important;
  box-shadow: 0 4px 12px rgba(51, 51, 51, 0.3);
}

.social-links a[href*="linkedin.com"]:hover {
  background-color: #0077b5 !important;
  border-color: #0077b5 !important;
  box-shadow: 0 4px 12px rgba(0, 119, 181, 0.3);
}

.social-links a[href*="twitter.com"]:hover {
  background-color: #1da1f2 !important;
  border-color: #1da1f2 !important;
  box-shadow: 0 4px 12px rgba(29, 161, 242, 0.3);
}

.social-links a[href^="mailto:"]:hover {
  background-color: var(--primary-color) !important;
  border-color: var(--primary-color) !important;
  box-shadow: 0 4px 12px rgba(139, 92, 246, 0.3);
}

.footer-bottom {
  border-top: 1px solid var(--border-color);
  padding-top: 1.5rem;
  text-align: center;
}

.footer-bottom p {
  color: var(--text-secondary);
  font-size: 0.9rem;
}

/* Responsive Footer */
@media (max-width: 768px) {
  .footer-content {
    grid-template-columns: 1fr;
    gap: 2rem;
    text-align: center;
  }
  
  .social-links {
    justify-content: center;
  }
}

/* =============================================================================
   UTILITY CLASSES - CODE CLEANUP
   ============================================================================= */

/* Spacing utilities to replace inline styles */
.mt-3 {
  margin-top: 3rem;
}

.mt-4 {
  margin-top: 4rem;
}

.mt-2 {
  margin-top: 2rem;
}

.mb-2 {
  margin-bottom: 2rem;
}

/* Text alignment utilities */
.text-center {
  text-align: center;
}

/* Animation delay utilities */
.anim-delay-0 {
  animation-delay: 0s;
}

.anim-delay-1 {
  animation-delay: 0.1s;
}

.anim-delay-2 {
  animation-delay: 0.2s;
}

.anim-delay-3 {
  animation-delay: 0.3s;
}

/* Section spacing for better organization */
.section-spaced {
  margin-top: 4rem;
}

.section-title {
  text-align: center;
  margin-bottom: 2rem;
}

.btn-container {
  text-align: center;
  margin-top: 2rem;
}

/* Additional utility classes for text styling */
.intro-text {
  font-size: 1.2rem;
  color: var(--text-secondary);
  max-width: 600px;
  margin: 0 auto;
}

/* Margin top utility classes */
.mt-1 {
  margin-top: 1rem;
}

.mt-2 {
  margin-top: 2rem;
}

/* Margin bottom utility classes */
.mb-3 {
  margin-bottom: 3rem;
}

/* Text alignment utility classes */
.text-center {
  text-align: center;
}

/* No content message styling */
.no-content-card {
  text-align: center;
  padding: 3rem;
  background: var(--bg-secondary);
  border-radius: 1rem;
  margin: 2rem 0;
}

.no-content-icon {
  font-size: 3rem;
  color: var(--text-secondary);
  margin-bottom: 1rem;
}

.no-content-title {
  color: var(--text-color);
  margin-bottom: 1rem;
}

.no-content-text {
  color: var(--text-secondary);
}

/* Social links container */
.social-links-card {
  background: var(--bg-secondary);
  padding: 2rem;
  border-radius: 1rem;
  margin-top: 3rem;
  text-align: center;
}

.social-links-title {
  color: var(--text-color);
  margin-bottom: 1rem;
}

.social-links-text {
  color: var(--text-secondary);
  margin-bottom: 1.5rem;
}

.social-buttons {
  display: flex;
  gap: 1rem;
  justify-content: center;
  flex-wrap: wrap;
}

/* Collaboration section */
.collaboration-section {
  text-align: center;
  margin-top: 4rem;
}

.collaboration-text {
  font-size: 1.1rem;
  color: var(--text-secondary);
  margin-bottom: 2rem;
}

/* Margin bottom utilities */
.mb-1 {
  margin-bottom: 1rem;
}

.mb-1-5 {
  margin-bottom: 1.5rem;
}

/* Margin top utilities */
.mt-4 {
  margin-top: 4rem;
}

/* Progress bar styling */
.progress-fill-75 {
  width: 75%;
}

/* Under Construction Banner */
.construction-banner {
  background: linear-gradient(135deg, var(--primary-color), var(--primary-hover));
  color: white;
  padding: 1rem 0;
  position: relative;
  overflow: hidden;
  box-shadow: var(--shadow-lg);
  border-bottom: 2px solid var(--primary-hover);
}

.construction-content {
  display: flex;
  align-items: center;
  justify-content: space-between;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1rem;
  flex-wrap: wrap;
  gap: 1rem;
}

.construction-icon {
  font-size: 1.5rem;
  animation: bounce 2s infinite;
}

.construction-text h4 {
  margin: 0 0 0.25rem 0;
  font-size: 1.1rem;
  font-weight: 600;
}

.construction-text p {
  margin: 0;
  font-size: 0.9rem;
  opacity: 0.9;
}

.construction-close {
  background: rgba(255, 255, 255, 0.2);
  border: none;
  color: white;
  padding: 0.5rem;
  border-radius: 50%;
  cursor: pointer;
  transition: var(--transition);
  width: 2rem;
  height: 2rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

.construction-close:hover {
  background: rgba(255, 255, 255, 0.3);
  transform: scale(1.1);
}

.construction-progress {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  margin-top: 0.75rem;
  padding: 0 1rem;
}

.progress-bar {
  flex: 1;
  max-width: 200px;
  height: 6px;
  background: rgba(255, 255, 255, 0.3);
  border-radius: 3px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  background: rgba(255, 255, 255, 0.8);
  border-radius: 3px;
  transition: width 0.3s ease;
}

.progress-text {
  font-size: 0.8rem;
  font-weight: 500;
  white-space: nowrap;
}

@keyframes bounce {
  0%, 20%, 50%, 80%, 100% {
    transform: translateY(0);
  }
  40% {
    transform: translateY(-10px);
  }
  60% {
    transform: translateY(-5px);
  }
}

/* Hide banner when dismissed */
.construction-banner.hidden {
  display: none;
}

/* Language Selector */
.language-selector {
  position: relative;
  display: inline-block;
}

.language-toggle {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  color: var(--text-color);
  padding: 0.5rem 1rem;
  border-radius: 0.5rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.9rem;
  transition: var(--transition);
}

.language-toggle:hover {
  background: var(--primary-color);
  color: white;
  border-color: var(--primary-color);
}

.language-dropdown {
  position: absolute;
  top: 100%;
  right: 0;
  background: var(--bg-color);
  border: 1px solid var(--border-color);
  border-radius: 0.5rem;
  box-shadow: var(--shadow-lg);
  min-width: 120px;
  z-index: 1000;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-10px);
  transition: all 0.3s ease;
}

.language-dropdown.show {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.language-option {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1rem;
  text-decoration: none;
  color: var(--text-color);
  transition: var(--transition);
  border-bottom: 1px solid var(--border-color);
}

.language-option:last-child {
  border-bottom: none;
}

.language-option:hover {
  background: var(--bg-secondary);
}

.language-option.active {
  background: var(--primary-color);
  color: white;
}

.language-option.active:hover {
  background: var(--primary-hover);
}

/* Post Preview Cards - Same style as project cards */
.post-preview {
  background: var(--bg-color);
  border-radius: 12px;
  overflow: hidden;
  box-shadow: var(--shadow);
  transition: var(--transition);
  border: 1px solid var(--border-color);
  animation: float 6s ease-in-out infinite;
  padding: 2rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.post-preview:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
}

.post-preview:nth-child(2n) {
  animation-delay: -2s;
}

.post-preview:nth-child(3n) {
  animation-delay: -4s;
}

.post-preview h3 {
  margin: 0;
  font-size: 1.25rem;
  line-height: 1.4;
}

.post-preview h2 {
  margin: 0;
  font-size: 1.25rem;
  line-height: 1.4;
}

.post-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  font-size: 0.875rem;
  color: var(--text-secondary);
  margin: 0;
}

.post-meta time,
.post-meta .post-author,
.post-meta .post-categories {
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

.post-meta i {
  color: var(--primary-color);
}

.post-excerpt {
  color: var(--text-secondary);
  line-height: 1.6;
  flex-grow: 1;
  margin: 0;
}

.post-preview .read-more {
  margin-top: auto;
  align-self: flex-start;
}

/* Animation delays for post preview cards */
.post-preview.anim-delay-0 {
  animation-delay: 0s;
}

.post-preview.anim-delay-1 {
  animation-delay: 0.1s;
}

.post-preview.anim-delay-2 {
  animation-delay: 0.2s;
}

.post-preview.anim-delay-3 {
  animation-delay: 0.3s;
}

.post-preview:nth-child(1) {
  animation-delay: 0s;
}

.post-preview:nth-child(2) {
  animation-delay: 0.1s;
}

.post-preview:nth-child(3) {
  animation-delay: 0.2s;
}

.post-preview:nth-child(4) {
  animation-delay: 0.3s;
}

/* Post tags styling */
.post-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin: 0.5rem 0 0 0;
}

.tag {
  background: var(--bg-secondary);
  color: var(--text-secondary);
  padding: 0.25rem 0.5rem;
  border-radius: 4px;
  font-size: 0.75rem;
  font-weight: 500;
  border: 1px solid var(--border-color);
  transition: var(--transition);
}

.tag:hover {
  background: rgba(139, 92, 246, 0.1);
  border-color: var(--primary-color);
  color: var(--primary-color);
}

.category {
  background: var(--primary-color);
  color: white;
  padding: 0.125rem 0.5rem;
  border-radius: 4px;
  font-size: 0.75rem;
  font-weight: 500;
}

/* Blog Filters */
.blog-filters {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 1.5rem;
    margin-bottom: 2rem;
}

.filters-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.filters-header h3 {
    margin: 0;
    color: var(--text-color);
    font-size: 1.1rem;
}

.filters-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    margin-bottom: 1rem;
}

.filter-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.filter-group label {
    font-weight: 600;
    color: var(--text-color);
    font-size: 0.9rem;
}

.filter-select {
    padding: 0.5rem;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    background: var(--card-bg);
    color: var(--text-color);
    font-size: 0.9rem;
    transition: border-color 0.3s ease;
    width: 100%;
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23666' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6,9 12,15 18,9'%3e%3c/polyline%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 0.7rem center;
    background-size: 1em;
    padding-right: 2.5rem;
}

.filter-select option {
    background: var(--card-bg);
    color: var(--text-color);
    padding: 0.5rem;
}

/* Dark theme arrow color */
[data-theme="dark"] .filter-select {
    background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23d1d5db' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6,9 12,15 18,9'%3e%3c/polyline%3e%3c/svg%3e");
}

.filter-select:hover {
    border-color: var(--accent-color);
}

.filter-select:focus {
    outline: none;
    border-color: var(--accent-color);
    box-shadow: 0 0 0 2px rgba(138, 102, 204, 0.2);
}

.filter-select:hover {
    border-color: var(--accent-color);
}

.results-counter {
    text-align: center;
    padding: 0.5rem;
    background: rgba(138, 102, 204, 0.1);
    border-radius: 4px;
    font-size: 0.9rem;
    color: var(--text-color);
    border: 1px solid rgba(138, 102, 204, 0.2);
}

.btn-link {
    background: none;
    border: none;
    color: var(--accent-color);
    text-decoration: underline;
    cursor: pointer;
    font-size: inherit;
    padding: 0;
    transition: color 0.3s ease;
}

.btn-link:hover {
    color: var(--accent-hover);
}

/* Post filtering animations */
.post-preview {
    transition: opacity 0.3s ease, transform 0.3s ease;
}

.post-preview.hidden {
    opacity: 0;
    transform: translateY(-10px);
    pointer-events: none;
    margin: 0;
    height: 0;
    overflow: hidden;
}

.no-results {
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Reading Progress Bar */
.reading-progress {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 6px;
    background: rgba(0, 0, 0, 0.1);
    z-index: 1001;
    backdrop-filter: blur(10px);
    transition: opacity 0.3s ease;
}

[data-theme="dark"] .reading-progress {
    background: rgba(255, 255, 255, 0.1);
}

.reading-progress-bar {
    height: 100%;
    background: linear-gradient(90deg, var(--accent-color), var(--primary-color));
    width: 0%;
    transition: width 0.1s ease;
    box-shadow: 0 2px 10px rgba(138, 102, 204, 0.6);
    position: relative;
}

.reading-progress-bar::after {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 20px;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3));
    animation: shimmer 2s infinite;
}

@keyframes shimmer {
    0% { opacity: 0; }
    50% { opacity: 1; }
    100% { opacity: 0; }
}

/* Reading Time Indicator */
.reading-time {
    color: var(--secondary-text);
    font-size: 0.9rem;
    font-weight: 500;
}

.reading-time i {
    margin-right: 0.3rem;
    color: var(--accent-color);
}

/* Table of Contents */
.table-of-contents {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    margin: 1.5rem 0;
    overflow: hidden;
    transition: all 0.3s ease;
}

.toc-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem;
    background: rgba(138, 102, 204, 0.1);
    border-bottom: 1px solid var(--border-color);
    cursor: pointer;
}

.toc-header h4 {
    margin: 0;
    color: var(--text-color);
    font-size: 1rem;
}

.toc-header i {
    margin-right: 0.5rem;
    color: var(--accent-color);
}

.toc-toggle {
    background: none;
    border: none;
    color: var(--accent-color);
    cursor: pointer;
    padding: 0.25rem;
    border-radius: 4px;
    transition: background-color 0.3s ease;
}

.toc-toggle:hover {
    background: rgba(138, 102, 204, 0.2);
}

.toc-toggle.expanded i {
    transform: rotate(180deg);
}

.toc-list {
    list-style: none;
    padding: 0;
    margin: 0;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

.toc-list.expanded {
    max-height: 400px;
    overflow-y: auto;
    overflow-x: hidden;
}

.toc-list li {
    border-bottom: 1px solid rgba(138, 102, 204, 0.1);
}

.toc-list li:last-child {
    border-bottom: none;
}

.toc-list a {
    display: block;
    padding: 0.75rem 1rem;
    color: var(--text-color);
    text-decoration: none;
    transition: all 0.3s ease;
    border-left: 3px solid transparent;
    word-wrap: break-word;
    overflow-wrap: break-word;
    white-space: normal;
    line-height: 1.4;
}

.toc-list a:hover {
    background: rgba(138, 102, 204, 0.1);
    border-left-color: var(--accent-color);
    transform: translateX(5px);
}

.toc-list a.active {
    background: rgba(138, 102, 204, 0.2);
    border-left-color: var(--accent-color);
    font-weight: 600;
}

/* Different indentation levels for headers */
.toc-list a.toc-h2 { padding-left: 1rem; }
.toc-list a.toc-h3 { padding-left: 1.5rem; font-size: 0.9rem; }
.toc-list a.toc-h4 { padding-left: 2rem; font-size: 0.85rem; }
.toc-list a.toc-h5 { padding-left: 2.5rem; font-size: 0.8rem; }
.toc-list a.toc-h6 { padding-left: 3rem; font-size: 0.8rem; }

/* Responsive design for table of contents */
@media (max-width: 768px) {
    .table-of-contents {
        margin: 1rem 0;
    }
    
    .toc-header {
        padding: 0.75rem;
    }
    
    .toc-list a {
        padding: 0.5rem 0.75rem;
        font-size: 0.9rem;
    }
    
    .toc-list a.toc-h3 { padding-left: 1.25rem; }
    .toc-list a.toc-h4 { padding-left: 1.5rem; }
    .toc-list a.toc-h5 { padding-left: 1.75rem; }
    .toc-list a.toc-h6 { padding-left: 2rem; }
}

/* Smooth scroll behavior */
html {
    scroll-behavior: smooth;
}

/* Enhanced post content for better reading experience */
.post {
    padding-top: 20px; /* Space for reading progress bar */
}

.post-content {
    position: relative;
}

.post-content h2,
.post-content h3,
.post-content h4,
.post-content h5,
.post-content h6 {
    scroll-margin-top: 100px; /* Account for fixed header + progress bar */
}

/* Language Change Notification */
.language-notification {
    position: fixed;
    top: 20px;
    right: 20px;
    background: var(--card-bg);
    color: var(--text-color);
    padding: 1rem 1.5rem;
    border-radius: 8px;
    box-shadow: var(--shadow-lg);
    border-left: 4px solid var(--accent-color);
    z-index: 10000;
    transform: translateX(100%);
    opacity: 0;
    transition: all 0.3s ease;
    max-width: 300px;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.language-notification.warning {
    border-left-color: #f59e0b;
    background: rgba(245, 158, 11, 0.1);
}

.language-notification.show {
    transform: translateX(0);
    opacity: 1;
}

.language-notification i {
    color: var(--accent-color);
    flex-shrink: 0;
}

.language-notification.warning i {
    color: #f59e0b;
}

@media (max-width: 768px) {
    .language-notification {
        top: 10px;
        right: 10px;
        left: 10px;
        max-width: none;
        transform: translateY(-100%);
    }
    
    .language-notification.show {
        transform: translateY(0);
    }
}

/* Lightbox Gallery */
.lightbox {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.lightbox.active {
    opacity: 1;
    visibility: visible;
}

.lightbox-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    cursor: pointer;
}

.lightbox-content {
    position: relative;
    width: 90%;
    height: 90%;
    max-width: 1200px;
    max-height: 800px;
    display: flex;
    flex-direction: column;
    background: var(--card-bg);
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}

.lightbox-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem;
    background: rgba(0, 0, 0, 0.8);
    color: white;
    flex-shrink: 0;
}

.lightbox-counter {
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.lightbox-controls {
    display: flex;
    gap: 0.5rem;
}

.lightbox-btn {
    background: rgba(255, 255, 255, 0.1);
    border: none;
    color: white;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background-color 0.3s ease, transform 0.2s ease;
}

.lightbox-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: scale(1.1);
}

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

.lightbox-body {
    flex: 1;
    display: flex;
    align-items: center;
    position: relative;
    overflow: hidden;
    background: #000;
}

.lightbox-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(0, 0, 0, 0.5);
    border: none;
    color: white;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 10;
    transition: all 0.3s ease;
    opacity: 0.7;
}

.lightbox-nav:hover {
    background: rgba(0, 0, 0, 0.8);
    opacity: 1;
    transform: translateY(-50%) scale(1.1);
}

.lightbox-prev {
    left: 20px;
}

.lightbox-next {
    right: 20px;
}

.lightbox-nav:disabled {
    opacity: 0.3;
    cursor: not-allowed;
    transform: translateY(-50%) scale(0.9);
}

.lightbox-image-container {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
    cursor: grab;
}

.lightbox-image-container.dragging {
    cursor: grabbing;
}

.lightbox-image {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    transition: transform 0.3s ease;
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
}

.lightbox-loading,
.lightbox-error {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
    color: white;
    font-size: 1.1rem;
}

.lightbox-loading i {
    font-size: 2rem;
    color: var(--accent-color);
}

.lightbox-error i {
    font-size: 2rem;
    color: #ef4444;
}

.lightbox-caption {
    padding: 1rem;
    background: rgba(0, 0, 0, 0.8);
    color: white;
    text-align: center;
    font-size: 0.9rem;
    line-height: 1.4;
    flex-shrink: 0;
}

/* Gallery Images Enhancement */
.post-content img,
.content img {
    cursor: pointer;
    transition: all 0.3s ease;
    border-radius: 4px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.post-content img:hover,
.content img:hover {
    transform: scale(1.02);
    box-shadow: 0 4px 16px rgba(138, 102, 204, 0.2);
}

/* Lazy loading placeholder */
img[data-src] {
    filter: blur(5px);
    transition: filter  0.3s ease;
}

img[data-loaded="true"] {
    filter: none;
}

/* Responsive lightbox */
@media (max-width: 768px) {
    .lightbox-content {
        width: 95%;
        height: 95%;
    }
    
    .lightbox-header {
        padding: 0.75rem;
    }
    
    .lightbox-counter {
        font-size: 0.8rem;
    }
    
    .lightbox-btn {
        width: 36px;
        height: 36px;
        font-size: 0.9rem;
    }
    
    .lightbox-nav {
        width: 50px;
        height: 50px;
    }
    
    .lightbox-prev {
        left: 10px;
    }
    
    .lightbox-next {
        right: 10px;
    }
    
    .lightbox-caption {
        padding: 0.75rem;
        font-size: 0.85rem;
    }
}

@media (max-width: 480px) {
    .lightbox-content {
        width: 100%;
        height: 100%;
        border-radius: 0;
    }
    
    .lightbox-nav {
        width: 44px;
        height: 44px;
        font-size: 0.9rem;
    }
    
    .lightbox-prev {
        left: 5px;
    }
    
    .lightbox-next {
        right: 5px;
    }
}

/* Keyboard navigation indicator */
.lightbox.keyboard-nav .lightbox-nav {
    animation: pulse 1s infinite;
}

@keyframes pulse {
    0% { opacity: 0.7; }
    50% { opacity: 1; }
    100% { opacity: 0.7; }
}
