/* ========================================
   VISUAL ENHANCEMENTS
   Advanced styling layer for sophisticated visual appeal
   Based on modern design trends from Linear, Stripe, Vercel
   ======================================== */

:root {
  /* Enhanced Color Palette */
  --color-primary: #2563eb;
  --color-primary-dark: #1e40af;
  --color-primary-light: #3b82f6;

  --color-accent-purple: #7c3aed;
  --color-accent-indigo: #4f46e5;
  --color-accent-emerald: #10b981;
  --color-accent-amber: #f59e0b;
  --color-accent-rose: #f43f5e;

  /* Gradient Definitions */
  --gradient-primary: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  --gradient-warm: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
  --gradient-cool: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
  --gradient-sunset: linear-gradient(135deg, #fa709a 0%, #fee140 100%);
  --gradient-ocean: linear-gradient(135deg, #30cfd0 0%, #330867 100%);
  --gradient-purple: linear-gradient(135deg, #a8edea 0%, #fed6e3 100%);
  --gradient-mesh:
    radial-gradient(at 0% 0%, rgba(99, 102, 241, 0.15) 0px, transparent 50%),
    radial-gradient(at 100% 0%, rgba(168, 85, 247, 0.15) 0px, transparent 50%),
    radial-gradient(at 100% 100%, rgba(236, 72, 153, 0.15) 0px, transparent 50%),
    radial-gradient(at 0% 100%, rgba(14, 165, 233, 0.15) 0px, transparent 50%);

  /* Advanced Shadows */
  --shadow-xs: 0 1px 2px rgba(0, 0, 0, 0.05);
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.08);
  --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.1);
  --shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.12);
  --shadow-xl: 0 16px 48px rgba(0, 0, 0, 0.15);
  --shadow-2xl: 0 24px 64px rgba(0, 0, 0, 0.2);
  --shadow-inner: inset 0 2px 4px 0 rgba(0, 0, 0, 0.06);

  /* Glass Morphism */
  --glass-bg: rgba(255, 255, 255, 0.7);
  --glass-border: rgba(255, 255, 255, 0.18);
  --glass-shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.37);

  /* Blur Effects */
  --blur-sm: blur(4px);
  --blur-md: blur(8px);
  --blur-lg: blur(16px);
  --blur-xl: blur(24px);

  /* Animation Curves */
  --ease-smooth: cubic-bezier(0.4, 0, 0.2, 1);
  --ease-bounce: cubic-bezier(0.68, -0.55, 0.265, 1.55);
  --ease-elastic: cubic-bezier(0.68, -0.6, 0.32, 1.6);

  /* Spacing Scale */
  --space-1: 0.25rem;
  --space-2: 0.5rem;
  --space-3: 0.75rem;
  --space-4: 1rem;
  --space-5: 1.25rem;
  --space-6: 1.5rem;
  --space-8: 2rem;
  --space-10: 2.5rem;
  --space-12: 3rem;
  --space-16: 4rem;
  --space-20: 5rem;
  --space-24: 6rem;
}

/* ========================================
   GLASS MORPHISM EFFECTS
   ======================================== */

.glass-card {
  background: var(--glass-bg);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid var(--glass-border);
  box-shadow: var(--glass-shadow);
  border-radius: 1.5rem;
  padding: var(--space-8);
  transition: all 0.3s var(--ease-smooth);
}

.glass-card:hover {
  background: rgba(255, 255, 255, 0.8);
  transform: translateY(-4px);
  box-shadow: 0 12px 40px 0 rgba(31, 38, 135, 0.4);
}

/* ========================================
   ENHANCED NAVIGATION
   ======================================== */

.site-header {
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  border-bottom: 1px solid rgba(0, 0, 0, 0.05);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.5), 0 2px 8px rgba(0, 0, 0, 0.04);
  transition: all 0.3s var(--ease-smooth);
}

.site-header.scrolled {
  background: rgba(255, 255, 255, 0.95);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
}

/* ========================================
   GRADIENT TEXT EFFECTS
   ======================================== */

.gradient-text {
  background: var(--gradient-primary);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  font-weight: 700;
}

.gradient-text-warm {
  background: var(--gradient-warm);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.gradient-text-cool {
  background: var(--gradient-cool);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* ========================================
   ENHANCED CARDS WITH HOVER EFFECTS
   ======================================== */

.post-card,
.surface-card,
.latest-item {
  position: relative;
  overflow: hidden;
  transition: all 0.4s var(--ease-smooth);
}

.post-card::before,
.surface-card::before,
.latest-item::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.05) 0%, rgba(168, 85, 247, 0.05) 100%);
  opacity: 0;
  transition: opacity 0.4s var(--ease-smooth);
  pointer-events: none;
  z-index: 0;
}

.post-card:hover::before,
.surface-card:hover::before,
.latest-item:hover::before {
  opacity: 1;
}

.post-card > *,
.surface-card > *,
.latest-item > * {
  position: relative;
  z-index: 1;
}

.post-card:hover,
.surface-card:hover,
.latest-item:hover {
  transform: translateY(-8px) scale(1.01);
  box-shadow: var(--shadow-2xl);
  border-color: rgba(99, 102, 241, 0.2);
}

/* ========================================
   ABOUT PAGE AUTHOR PROFILE
   ======================================== */

.page-author {
  align-items: center;
  gap: var(--space-6, 1.5rem);
}

.page-author .author-avatar {
  width: clamp(11rem, 26vw, 14rem);
  height: clamp(11rem, 26vw, 14rem);
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
  box-shadow: var(--shadow-md, 0 4px 16px rgba(0, 0, 0, 0.1));
}

@media (max-width: 640px) {
  .page-author {
    flex-direction: column;
    text-align: center;
  }

  .page-author .author-avatar {
    width: clamp(9rem, 55vw, 13rem);
    height: clamp(9rem, 55vw, 13rem);
  }
}

/* ========================================
   ANIMATED GRADIENT BORDERS
   ======================================== */

.gradient-border {
  position: relative;
  border: 2px solid transparent;
  background-clip: padding-box;
}

.gradient-border::before {
  content: '';
  position: absolute;
  top: -2px;
  left: -2px;
  right: -2px;
  bottom: -2px;
  background: var(--gradient-primary);
  border-radius: inherit;
  z-index: -1;
  opacity: 0;
  transition: opacity 0.3s var(--ease-smooth);
}

.gradient-border:hover::before {
  opacity: 1;
}

/* ========================================
   ENHANCED BUTTONS
   ======================================== */

.btn,
.ds-button {
  position: relative;
  overflow: hidden;
  font-weight: 600;
  letter-spacing: 0.01em;
  transition: all 0.3s var(--ease-smooth);
}

.btn::before,
.ds-button::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, height 0.6s;
}

.btn:hover::before,
.ds-button:hover::before {
  width: 300px;
  height: 300px;
}

.btn:hover,
.ds-button:hover {
  transform: translateY(-2px) scale(1.05);
  box-shadow: var(--shadow-lg);
}

.btn:active,
.ds-button:active {
  transform: translateY(0) scale(0.98);
}

/* ========================================
   SPOTLIGHT EFFECTS
   ======================================== */

.spotlight-card {
  position: relative;
  overflow: hidden;
  transition: all 0.4s var(--ease-smooth);
}

.spotlight-card::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 200%;
  height: 200%;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.3) 0%, transparent 70%);
  transform: translate(-50%, -50%) scale(0);
  transition: transform 0.6s var(--ease-smooth);
  pointer-events: none;
}

.spotlight-card:hover::after {
  transform: translate(-50%, -50%) scale(1);
}

/* ========================================
   CATEGORY-SPECIFIC GRADIENTS
   ======================================== */

.spotlight-card--tech {
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.05) 0%, rgba(5, 150, 105, 0.05) 100%);
  border-color: rgba(16, 185, 129, 0.3);
}

.spotlight-card--tech:hover {
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.1) 0%, rgba(5, 150, 105, 0.08) 100%);
  box-shadow: 0 12px 32px rgba(16, 185, 129, 0.2);
}

.spotlight-card--finance {
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.05) 0%, rgba(217, 119, 6, 0.05) 100%);
  border-color: rgba(245, 158, 11, 0.3);
}

.spotlight-card--finance:hover {
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.1) 0%, rgba(217, 119, 6, 0.08) 100%);
  box-shadow: 0 12px 32px rgba(245, 158, 11, 0.2);
}

.spotlight-card--travel {
  background: linear-gradient(135deg, rgba(239, 68, 68, 0.05) 0%, rgba(220, 38, 38, 0.05) 100%);
  border-color: rgba(239, 68, 68, 0.3);
}

.spotlight-card--travel:hover {
  background: linear-gradient(135deg, rgba(239, 68, 68, 0.1) 0%, rgba(220, 38, 38, 0.08) 100%);
  box-shadow: 0 12px 32px rgba(239, 68, 68, 0.2);
}

.spotlight-card--mind {
  background: linear-gradient(135deg, rgba(139, 92, 246, 0.05) 0%, rgba(124, 58, 237, 0.05) 100%);
  border-color: rgba(139, 92, 246, 0.3);
}

.spotlight-card--mind:hover {
  background: linear-gradient(135deg, rgba(139, 92, 246, 0.1) 0%, rgba(124, 58, 237, 0.08) 100%);
  box-shadow: 0 12px 32px rgba(139, 92, 246, 0.2);
}

/* ========================================
   ANIMATED UNDERLINES
   ======================================== */

.animated-link {
  position: relative;
  text-decoration: none;
  transition: color 0.3s var(--ease-smooth);
}

.animated-link::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 0;
  height: 2px;
  background: var(--gradient-primary);
  transition: width 0.3s var(--ease-smooth);
}

.animated-link:hover::after {
  width: 100%;
}

/* ========================================
   FLOATING ANIMATION
   ======================================== */

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

.float-animation {
  animation: float 3s ease-in-out infinite;
}

/* ========================================
   PULSE ANIMATION
   ======================================== */

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

.pulse-animation {
  animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

/* ========================================
   SHIMMER EFFECT
   ======================================== */

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

.shimmer {
  background: linear-gradient(
    90deg,
    transparent 0%,
    rgba(255, 255, 255, 0.5) 50%,
    transparent 100%
  );
  background-size: 1000px 100%;
  animation: shimmer 2s infinite;
}

/* ========================================
   ENHANCED HERO SECTION
   ======================================== */

.hero,
.surface-hero,
.blog-hero {
  background: var(--gradient-mesh);
  position: relative;
  overflow: hidden;
}

.hero::before,
.surface-hero::before {
  content: '';
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.1) 1px, transparent 1px);
  background-size: 50px 50px;
  animation: drift 20s linear infinite;
  pointer-events: none;
}

@keyframes drift {
  0% {
    transform: translate(0, 0);
  }
  100% {
    transform: translate(50px, 50px);
  }
}

/* ========================================
   CHIP ENHANCEMENTS
   ======================================== */

.chip,
.latest-item__tag {
  position: relative;
  backdrop-filter: blur(8px);
  transition: all 0.3s var(--ease-smooth);
}

.chip:hover,
.latest-item__tag:hover {
  transform: translateY(-2px) scale(1.05);
  box-shadow: var(--shadow-md);
}

/* ========================================
   IMAGE HOVER EFFECTS
   ======================================== */

.featured-image,
.hero__media,
img {
  transition: all 0.4s var(--ease-smooth);
}

.featured-card:hover .featured-image,
.post-card:hover img {
  transform: scale(1.05);
  filter: brightness(1.1) saturate(1.1);
}

/* ========================================
   SCROLLBAR STYLING
   ======================================== */

::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}

::-webkit-scrollbar-track {
  background: rgba(0, 0, 0, 0.05);
  border-radius: 10px;
}

::-webkit-scrollbar-thumb {
  background: var(--gradient-primary);
  border-radius: 10px;
  transition: background 0.3s;
}

::-webkit-scrollbar-thumb:hover {
  background: linear-gradient(135deg, #5568d3 0%, #6741a8 100%);
}

/* ========================================
   SELECTION STYLING
   ======================================== */

::selection {
  background: rgba(99, 102, 241, 0.3);
  color: inherit;
}

::-moz-selection {
  background: rgba(99, 102, 241, 0.3);
  color: inherit;
}

/* ========================================
   FOCUS STATES
   ======================================== */

a:focus,
button:focus,
input:focus,
textarea:focus {
  outline: 2px solid var(--color-primary);
  outline-offset: 2px;
  border-radius: 4px;
}

/* ========================================
   TIMELINE ENHANCEMENTS
   ======================================== */

.timeline::before {
  background: linear-gradient(
    180deg,
    var(--color-primary) 0%,
    var(--color-accent-purple) 50%,
    transparent 100%
  );
}

.timeline__item {
  transition: all 0.3s var(--ease-smooth);
}

.timeline__item:hover {
  transform: translateX(8px);
}

.timeline__item::before {
  box-shadow: 0 0 0 4px var(--color-accent-soft),
              0 4px 12px rgba(37, 99, 235, 0.3);
  transition: all 0.3s var(--ease-smooth);
}

.timeline__item:hover::before {
  transform: scale(1.3);
  box-shadow: 0 0 0 6px var(--color-accent-soft),
              0 6px 20px rgba(37, 99, 235, 0.4);
}

/* ========================================
   LOADING SKELETON
   ======================================== */

.skeleton {
  background: linear-gradient(
    90deg,
    rgba(0, 0, 0, 0.06) 25%,
    rgba(0, 0, 0, 0.12) 50%,
    rgba(0, 0, 0, 0.06) 75%
  );
  background-size: 200% 100%;
  animation: skeleton-loading 1.5s ease-in-out infinite;
  border-radius: 8px;
}

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

/* ========================================
   RESPONSIVE ENHANCEMENTS
   ======================================== */

@media (max-width: 768px) {
  .glass-card {
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
  }

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

/* ========================================
   DARK MODE PREPARATION (Optional)
   ======================================== */

@media (prefers-color-scheme: dark) {
  :root {
    --glass-bg: rgba(15, 23, 42, 0.7);
    --glass-border: rgba(255, 255, 255, 0.1);
  }

  .glass-card {
    background: var(--glass-bg);
  }
}

/* ========================================
   PERFORMANCE OPTIMIZATIONS
   ======================================== */

.post-card,
.surface-card,
.btn,
.chip {
  will-change: transform;
  transform: translateZ(0);
  backface-visibility: hidden;
}

/* ========================================
   ACCESSIBILITY ENHANCEMENTS
   ======================================== */

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
