/* Base Styles */
body {
  margin: 0;
  font-family: 'Segoe UI', Arial, sans-serif;
  background: #1a1a1a;
  color: #e0e0e0;
  font-size: 16px;
  line-height: 1.6;
  -webkit-text-size-adjust: 100%;
  -webkit-font-smoothing: antialiased;
}

  /* Header Styles */
  header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 4vw;
    background: #2d2d2d;
    box-shadow: 0 2px 8px rgba(0,0,0,0.2);
    position: sticky;
    top: 0;
    z-index: 1000;
  }

  .header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    max-width: 1400px;
    margin: 0 auto;
  }

  .header-left h1 {
    margin: 0;
    font-size: 1.8rem;
    letter-spacing: 1px;
    color: #e0e0e0;
    font-weight: 700;
    transition: color 0.2s;
  }

  .header-left h1:hover {
    color: #4da6ff;
  }

  .header-right {
    display: flex;
    align-items: center;
    justify-content: flex-end;
  }

header h1 {
  margin: 0.5rem 0;
  font-size: 1.8rem;
  letter-spacing: 1px;
  text-align: center;
}

nav {
  display: flex;
  width: 100%;
  justify-content: center;
  padding: 0.5rem 0;
  flex-wrap: wrap;
}

nav a {
  margin: 0.5rem 1rem;
  padding: 0.5rem 0.8rem;
  text-decoration: none;
  color: #e0e0e0;
  font-weight: 500;
  transition: all 0.2s;
  border-radius: 4px;
  font-size: 0.95rem;
}

nav a:hover, nav a:focus {
  color: #4da6ff;
  background: rgba(77, 166, 255, 0.1);
  outline: none;
}

.back-btn {
  background: #404040;
  padding: 0.5rem 1rem;
  border-radius: 6px;
  border: 1px solid #555;
  transition: all 0.2s;
}

.back-btn:hover {
  background: #4da6ff;
  color: #1a1a1a;
  border-color: #4da6ff;
}

nav a:hover {
  color: #0077ff;
}

/* Main Content */
main {
  padding: 1.5rem 4vw;
  width: 100%;
  box-sizing: border-box;
}

.post-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.25rem;
  padding: 1rem;
  justify-content: center;
  perspective: 1000px;
  max-width: 1400px;
  margin: 0 auto;
}

.post-card {
  background: #2d2d2d;
  border-radius: 12px;
  box-shadow: 0 4px 15px rgba(0,0,0,0.1);
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  text-decoration: none;
  color: inherit;
  width: 100%;
  min-height: 200px;
  margin: 0;
  border: 1px solid #404040;
  transition: all 0.3s ease;
  cursor: pointer;
  position: relative;
  overflow: hidden;
  height: 100%;
  box-sizing: border-box;
  transform-style: preserve-3d;
  will-change: transform;
}

.post-card::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(120deg, transparent 30%, rgba(77, 166, 255, 0.1));
  opacity: 0;
  transition: opacity 0.3s ease;
}

.post-card:hover {
  box-shadow: 0 20px 40px rgba(0,0,0,0.3);
  border-color: #4da6ff;
  background: #333;
  z-index: 1;
}

/* Reduce hover effect on touch devices */
@media (hover: none) {
  .post-card:hover {
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
  }

  .post-card:active {
    transform: scale(0.99);
    background: #333;
  }
}

.post-card:hover::after {
  opacity: 1;
}

.post-title {
  font-size: 1.3rem;
  margin: 0 0 0.8rem 0;
  line-height: 1.4;
  font-weight: 600;
  color: #f0f0f0;
  transition: color 0.2s ease;
}

.post-card:hover .post-title {
  color: #4da6ff;
}

.post-content p {
  font-size: 0.9rem;
  line-height: 1.5;
  margin: 0;
}

.post-meta {
  font-size: 0.8rem;
  margin-top: 1rem;
}

/* Tablet and small desktop */
@media (min-width: 600px) {
  .post-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 1.5rem;
    padding: 1.5rem;
  }

  .post-card {
    min-height: 220px;
  }
}

/* Desktop */
@media (min-width: 1024px) {
  .post-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 2rem;
  }

  .post-card {
    min-height: 240px;
  }
}

/* Large Desktop */
@media (min-width: 1400px) {
  .post-grid {
    grid-template-columns: repeat(4, 1fr);
  }
}

/* Mobile optimizations */
@media (max-width: 599px) {
  .post-card {
    padding: 1.25rem;
    min-height: 160px;
    border-radius: 10px;
  }

  .post-title {
    font-size: 1.25rem;
    margin-bottom: 0.75rem;
  }

  .post-content p {
    font-size: 0.95rem;
    line-height: 1.5;
  }

  .post-meta {
    margin-top: 0.75rem;
    font-size: 0.85rem;
  }
}

  .post-card:hover {
    box-shadow: 0 4px 16px rgba(0,0,0,0.4);
    color: #4da6ff;
    border-color: #4da6ff;
  }

  .post-title {
    font-size: 1.3rem;
    margin: 0 0 0.5rem 0;
  }

  .post-title a {
    color: #e0e0e0;
    text-decoration: none;
    transition: color 0.2s;
  }

  .post-title a:hover {
    color: #4da6ff;
  }

  .post-meta {
    font-size: 0.9rem;
    color: #a0a0a0;
    margin-bottom: 1rem;
  }

  .post-content {
    padding: 1rem;
    flex-grow: 1;
  }

  .social-share {
    max-width: 700px;
    margin: 1rem auto 0 auto;
    display: flex;
    gap: 1rem;
    justify-content: flex-end;
  }

  .share-btn {
    background: #404040;
    border: none;
    border-radius: 6px;
    padding: 0.5rem 1rem;
    cursor: pointer;
    font-size: 1rem;
    text-decoration: none;
    color: #e0e0e0;
    transition: background 0.2s, color 0.2s;
    display: inline-block;
  }

  .share-btn:hover {
    background: #4da6ff;
    color: #1a1a1a;
  }

  .modern-back-btn {
    font-size: 1.1rem;
    font-weight: 600;
    padding: 0.7rem 1.5rem;
    border-radius: 999px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.18);
    background: linear-gradient(90deg, #232526 0%, #414345 100%);
    color: #e0e0e0;
    border: none;
    outline: none;
    cursor: pointer;
    transition: background 0.2s, color 0.2s, box-shadow 0.2s;
    gap: 0.5rem;
    display: inline-flex;
    align-items: center;
  }

  .modern-back-btn:hover {
    background: linear-gradient(90deg, #4da6ff 0%, #0077ff 100%);
    color: #fff;
    box-shadow: 0 4px 16px rgba(77,166,255,0.18);
  }

  /* Responsive Design */
  @media (min-width: 768px) {
    header {
      flex-direction: row;
      padding: 1rem 6vw;
    }

    header h1 {
      margin: 0;
      font-size: 2rem;
      text-align: left;
    }

    nav {
      width: auto;
      justify-content: flex-end;
    }

    nav a {
      margin-left: 1.5rem;
    }

    .post-card {
      min-height: 200px;
    }

    .search-container {
      width: 300px;
    }
  }

  @media (max-width: 767px) {
    .header-content {
      flex-direction: column;
      gap: 1rem;
      align-items: center;
    }

    .header-right {
      width: 100%;
      justify-content: center;
    }

    .search-container {
      width: 280px;
    }

    #searchInput {
      padding: 0.6rem 0.8rem 0.6rem 2.2rem;
      font-size: 0.85rem;
    }

    .search-container::before {
      left: 0.8rem;
      font-size: 0.9rem;
    }

    .search-results {
      left: -10px;
      right: -10px;
    }
  }

  @media (max-width: 480px) {
    .header-content {
      flex-direction: column;
      gap: 1rem;
      align-items: center;
    }

    .search-container {
      width: 250px;
    }

    .header-left h1 {
      font-size: 1.6rem;
    }
  }

  @media (min-width: 1024px) {
    .post-grid {
      grid-template-columns: repeat(2, minmax(300px, 1fr));
    }
  }

  @media (min-width: 1280px) {
    .post-grid {
      grid-template-columns: repeat(3, minmax(300px, 1fr));
    }
  }

  @media (min-width: 1600px) {
    .post-grid {
      grid-template-columns: repeat(4, minmax(300px, 1fr));
    }
  }

  /* Touch target sizes for mobile */
  @media (max-width: 480px) {
    body {
      font-size: 15px;
    }

    header, main {
      padding: 0.75rem 3vw;
    }

    .post-card {
      padding: 1rem;
      min-height: 160px;
    }

    h2 {
      font-size: 1.4rem;
      margin: 0.5rem 0;
    }

    .post-meta {
      font-size: 0.85rem;
    }
  }

  /* High DPI devices */
  @media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
    body {
      -webkit-font-smoothing: antialiased;
    }
  }

  /* Print styles */
  @media print {
    body {
      background: #fff;
      color: #000;
      font-size: 12pt;
    }

    .post-card {
      break-inside: avoid;
      page-break-inside: avoid;
      border: 1px solid #ddd;
    }
  }

  /* Modern UI Animations and Effects */
  .post-card {
    animation: cardFadeIn 0.6s ease forwards;
    animation-delay: var(--card-delay, 0s);
    opacity: 0;
    transform: translateY(30px) perspective(1000px) rotateX(0) rotateY(0);
  }

  @keyframes cardFadeIn {
    to {
      opacity: 1;
      transform: translateY(0) perspective(1000px) rotateX(0) rotateY(0);
    }
  }

  /* Enhanced hover effects */
  .post-card::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: radial-gradient(
      600px circle at var(--mouse-x, 50%) var(--mouse-y, 50%),
      rgba(77, 166, 255, 0.1),
      transparent 40%
    );
    border-radius: inherit;
    opacity: var(--after-opacity, 0);
    transition: opacity 0.5s;
    pointer-events: none;
  }

  /* Smooth transitions for all interactive elements */
  * {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  }

  /* Exclude transform from global transitions to allow tilt effect */
  .post-card {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1), transform 0.1s ease-out;
  }

  /* Ensure tilt effect has priority */
  .post-card[style*="transform"] {
    transform: var(--tilt-transform) !important;
    transition: transform 0.1s ease-out !important;
  }

  /* Tilt effect specific styles */
  .post-card.tilt-active {
    transform-style: preserve-3d !important;
    will-change: transform !important;
  }

  /* Mobile-specific styles - disable tilt effects */
  @media (max-width: 768px) {
    .post-card {
      transform-style: flat !important;
      will-change: auto !important;
      /* Optimize for mobile performance */
      -webkit-transform: translateZ(0);
      transform: translateZ(0);
    }
    
    .post-card:hover {
      transform: none !important;
    }
    
    /* Simple mobile touch feedback */
    .post-card:active {
      transform: scale(0.98) !important;
      transition: transform 0.2s ease !important;
    }
    
    /* Disable complex animations on mobile for better performance */
    .post-card::after {
      display: none !important;
    }
    
    /* Optimize transitions for mobile */
    .post-card {
      transition: all 0.2s ease !important;
    }
  }

  /* Tablet styles - enable tilt but with reduced intensity */
  @media (min-width: 769px) and (max-width: 1024px) {
    .post-card {
      transform-style: preserve-3d;
      will-change: transform;
    }
    
    /* Reduce tilt intensity on tablets for better performance */
    .post-card.tilt-active {
      transform: perspective(800px) rotateX(var(--tilt-rotate-x, 0deg)) rotateY(var(--tilt-rotate-y, 0deg)) scale3d(1.01, 1.01, 1.01) !important;
    }
  }

  /* Desktop styles - full tilt effect */
  @media (min-width: 1025px) {
    .post-card {
      transform-style: preserve-3d;
      will-change: transform;
    }
    
    /* Full tilt effect on desktop */
    .post-card.tilt-active {
      transform: perspective(1000px) rotateX(var(--tilt-rotate-x, 0deg)) rotateY(var(--tilt-rotate-y, 0deg)) scale3d(1.02, 1.02, 1.02) !important;
    }
  }

  /* Ensure tilt only works on larger screens */
  @media (min-width: 769px) {
    .post-card {
      transform-style: preserve-3d;
      will-change: transform;
    }
  }

  /* Newsletter link styles */
  .newsletter-link {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    text-decoration: none;
    transition: all 0.3s ease;
    white-space: nowrap;
  }

  .newsletter-link:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(77, 166, 255, 0.3);
  }

  /* Mobile responsiveness for newsletter link */
  @media (max-width: 768px) {
    .newsletter-link {
      font-size: 0.8rem;
      padding: 0.4rem 0.8rem;
      margin-left: 0.5rem;
    }
  }

  @media (max-width: 480px) {
    .header-right {
      flex-direction: column;
      gap: 0.5rem;
      align-items: center;
    }
    
    .newsletter-link {
      margin-left: 0;
      margin-top: 0.5rem;
    }
  }

  /* Header parallax styling */
  header {
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    will-change: transform, opacity;
  }

  /* Text reveal animation */
  .char-reveal {
    display: inline-block;
    opacity: 0;
    animation: charReveal 0.6s ease forwards;
  }

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

  /* Keyboard navigation styles */
  .search-result-item.keyboard-selected {
    background: rgba(77, 166, 255, 0.15) !important;
    border-left: 3px solid #4da6ff !important;
    padding-left: calc(1rem - 3px) !important;
    transform: translateX(2px);
  }

  /* Voice search styles */
  .search-container.voice-active::before {
    animation: voicePulse 1s ease-in-out infinite;
  }

  @keyframes voicePulse {
    0%, 100% { opacity: 1; transform: translateY(-50%) scale(1); }
    50% { opacity: 0.7; transform: translateY(-50%) scale(1.1); }
  }

  /* Search Container Styles */
  .search-container {
    position: relative;
    width: 100%;
    max-width: 350px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    background: linear-gradient(135deg, #2d2d2d 0%, #333 100%);
    border-radius: 50px;
    border: 2px solid transparent;
    background-clip: padding-box;
    box-shadow: 0 8px 32px rgba(0,0,0,0.3), inset 0 1px 0 rgba(255,255,255,0.1);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    overflow: visible;
  }

  .search-container::before {
    content: '🔍';
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    font-size: 1rem;
    color: #888;
    transition: all 0.3s ease;
    z-index: 2;
  }

  .search-container::after {
    content: '';
    position: absolute;
    top: -2px;
    left: -2px;
    right: -2px;
    bottom: -2px;
    background: linear-gradient(45deg, #4da6ff, #00d4aa, #ffa726, #ab47bc);
    background-size: 300% 300%;
    border-radius: 50px;
    opacity: 0;
    z-index: -1;
    animation: gradientShift 3s ease infinite;
    transition: opacity 0.3s ease;
  }

  .search-container.search-focused::after {
    opacity: 1;
  }

  .search-container.search-focused {
    transform: translateY(-2px);
    box-shadow: 0 12px 48px rgba(77, 166, 255, 0.2), inset 0 1px 0 rgba(255,255,255,0.2);
  }

  .search-container.search-focused::before {
    color: #4da6ff;
    transform: translateY(-50%) scale(1.1);
  }

  .search-container.has-content::before {
    color: #4da6ff;
  }

  .search-container.search-typing {
    animation: searchPulse 1s ease-in-out;
  }

  #searchInput {
    width: 100%;
    padding: 0.75rem 1rem 0.75rem 2.5rem;
    background: transparent;
    border: none;
    outline: none;
    color: #e0e0e0;
    font-size: 0.95rem;
    font-weight: 400;
    border-radius: 50px;
    transition: all 0.3s ease;
    position: relative;
    z-index: 1;
  }

  #searchInput::placeholder {
    color: #888;
    transition: all 0.3s ease;
  }

  #searchInput:focus::placeholder {
    color: #666;
    transform: translateX(5px);
  }

  /* Search Results Enhanced Styling */
  #searchResults {
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    right: 0;
    background: #2d2d2d;
    border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.4), 0 0 0 1px rgba(77, 166, 255, 0.1);
    border: 1px solid #404040;
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    z-index: 10000;
    max-height: 70vh;
    overflow-y: auto;
    animation: searchResultsIn 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    transform-origin: top center;
    display: none;
    min-height: 50px;
    visibility: visible;
    opacity: 1;
  }

  #searchResults:not([style*="display: none"]) {
    display: block !important;
  }

  /* Ensure search results are visible when they have content */
  #searchResults:has(.search-result-item) {
    display: block !important;
  }

  /* Force hide search results when they should be hidden */
  #searchResults[style*="display: none"] {
    display: none !important;
    visibility: hidden !important;
    opacity: 0 !important;
    pointer-events: none !important;
  }

  .search-result-item {
    padding: 1rem 1.25rem;
    border-bottom: 1px solid rgba(64, 64, 64, 0.5);
    color: #e0e0e0;
    transition: all 0.2s ease;
    cursor: pointer;
    position: relative;
    overflow: hidden;
    animation: resultItemIn 0.4s ease forwards;
    animation-delay: calc(var(--result-index, 0) * 0.05s);
    opacity: 0;
    transform: translateY(10px);
  }

  .search-result-item::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    width: 3px;
    height: 100%;
    background: linear-gradient(to bottom, #4da6ff, #00d4aa);
    transform: scaleY(0);
    transition: transform 0.3s ease;
  }

  .search-result-item:hover {
    background: rgba(77, 166, 255, 0.08);
    transform: translateX(8px);
    border-color: rgba(77, 166, 255, 0.2);
  }

  .search-result-item:hover::before {
    transform: scaleY(1);
  }

  .search-result-item:last-child {
    border-bottom: none;
    border-radius: 0 0 16px 16px;
  }

  .search-result-item:first-child {
    border-radius: 16px 16px 0 0;
  }

  /* Enhanced loading animations */
  @keyframes gradientShift {
    0%, 100% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
  }

  @keyframes searchPulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.02); }
  }

  @keyframes searchResultsIn {
    from {
      opacity: 0;
      transform: translateY(-10px) scale(0.95);
    }
    to {
      opacity: 1;
      transform: translateY(0) scale(1);
    }
  }

  @keyframes resultItemIn {
    to {
      opacity: 1;
      transform: translateY(0);
    }
  }

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

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

  /* Pulse error animation for empty search */
  .pulse-error {
    animation: pulseError 0.6s ease;
  }

  @keyframes pulseError {
    0%, 100% { 
      box-shadow: 0 0 0 0 rgba(255, 107, 107, 0.4);
      border-color: transparent;
    }
    50% { 
      box-shadow: 0 0 0 10px rgba(255, 107, 107, 0);
      border-color: #ff6b6b;
    }
  }

  /* Share Modal Styles */
  .share-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(5px);
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: modalFadeIn 0.3s ease;
  }

  .share-modal-content {
    background: #2d2d2d;
    border-radius: 16px;
    padding: 0;
    max-width: 400px;
    width: 90%;
    border: 1px solid #404040;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    animation: modalSlideIn 0.3s ease;
  }

  .share-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem;
    border-bottom: 1px solid #404040;
  }

  .share-modal-header h3 {
    margin: 0;
    color: #f0f0f0;
    font-size: 1.2rem;
  }

  .close-share-modal {
    background: none;
    border: none;
    color: #888;
    font-size: 1.5rem;
    cursor: pointer;
    padding: 0.25rem;
    border-radius: 4px;
    transition: all 0.2s ease;
  }

  .close-share-modal:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #f0f0f0;
  }

  .share-options {
    padding: 1.5rem;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
  }

  .share-option {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem;
    background: #333;
    border: 1px solid #404040;
    border-radius: 8px;
    color: #e0e0e0;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 0.9rem;
    font-weight: 500;
  }

  .share-option:hover {
    background: #4da6ff;
    color: #1a1a1a;
    border-color: #4da6ff;
    transform: translateY(-2px);
  }

  .share-option svg {
    flex-shrink: 0;
  }

  /* Ripple Effect */
  @keyframes ripple {
    0% {
      transform: scale(0);
      opacity: 1;
    }
    100% {
      transform: scale(1);
      opacity: 0;
    }
  }

  /* Modal Animations */
  @keyframes modalFadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
  }

  @keyframes modalSlideIn {
    from {
      transform: translateY(-20px) scale(0.95);
      opacity: 0;
    }
    to {
      transform: translateY(0) scale(1);
      opacity: 1;
    }
  }

  /* Notification Animations */
  @keyframes slideInRight {
    from {
      transform: translateX(100%);
      opacity: 0;
    }
    to {
      transform: translateX(0);
      opacity: 1;
    }
  }

  @keyframes slideOutRight {
    from {
      transform: translateX(0);
      opacity: 1;
    }
    to {
      transform: translateX(100%);
      opacity: 0;
    }
  }

  /* Enhanced page transitions */
  .page-transition {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(45deg, #1a1a1a, #2d2d2d);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: pageTransitionOut 0.5s ease-in-out forwards;
  }

  @keyframes pageTransitionOut {
    to {
      opacity: 0;
      visibility: hidden;
    }
  }

  /* Enhanced background patterns */
  .bg-patterns {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: -1;
    overflow: hidden;
  }

  .pattern-circle {
    position: absolute;
    border-radius: 50%;
    background: linear-gradient(45deg, rgba(77, 166, 255, 0.02), rgba(77, 166, 255, 0.04));
    animation: floatPattern 20s ease-in-out infinite;
  }

  .pattern-1 {
    width: 300px;
    height: 300px;
    top: 10%;
    left: -10%;
    animation-delay: 0s;
  }

  .pattern-2 {
    width: 200px;
    height: 200px;
    top: 60%;
    right: -5%;
    animation-delay: -7s;
  }

  .pattern-3 {
    width: 150px;
    height: 150px;
    bottom: 20%;
    left: 20%;
    animation-delay: -14s;
  }

  @keyframes floatPattern {
    0%, 100% {
      transform: translate(0, 0) rotate(0deg);
    }
    25% {
      transform: translate(20px, -30px) rotate(90deg);
    }
    50% {
      transform: translate(-10px, -20px) rotate(180deg);
    }
    75% {
      transform: translate(-20px, 10px) rotate(270deg);
    }
  }

  /* Cursor trail styles */
  .cursor-trail {
    opacity: 0;
    animation: trailFade 0.5s ease-out;
  }

  @keyframes trailFade {
    0% {
      opacity: 1;
      transform: scale(1);
    }
    100% {
      opacity: 0;
      transform: scale(0.3);
    }
  }

  /* Loading animation */
  body.loading {
    overflow: hidden;
  }

  body.loading::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #1a1a1a;
    z-index: 9999;
    animation: loadingFade 0.5s ease 2s forwards;
  }

  @keyframes loadingFade {
    to {
      opacity: 0;
      visibility: hidden;
    }
  }

  /* Enhanced scroll animations */
  .scroll-animate {
    opacity: 0;
    transform: translateY(30px);
    transition: all 0.6s cubic-bezier(0.4, 0, 0.2, 1);
  }

  .scroll-animate.animate-in {
    opacity: 1;
    transform: translateY(0);
  }

  /* Improved tilt effects */
  .post-card {
    transform-style: preserve-3d;
    will-change: transform;
  }

  .post-card .post-content {
    transform: translateZ(20px);
  }

  /* Enhanced mobile responsiveness */
  @media (max-width: 768px) {
    .pattern-circle {
      display: none;
    }

    .cursor-trail {
      display: none;
    }
  }

  .post-content-container {
      position: relative;
      max-width: 1400px;
      margin: 0 auto;
      padding: 2rem;
      padding-top: 2rem;
      min-height: calc(100vh - 200px);
      display: grid;
      grid-template-columns: 320px 1fr;
      gap: 3rem;
      align-items: start;
    }

               .back-button-container {
       position: relative;
       display: inline-block;
     }

       .back-button {
      display: flex;
      align-items: center;
      gap: 0.5rem;
      padding: 0.75rem 1.5rem;
      background: #333;
      border: 1px solid #404040;
      border-radius: 8px;
      color: #e0e0e0;
      cursor: pointer;
      transition: all 0.2s ease;
      font-size: 0.9rem;
      font-weight: 500;
      text-decoration: none;
      box-shadow: 0 4px 12px rgba(0,0,0,0.3);
    }

   .back-button:hover {
     background: #4da6ff;
     color: #1a1a1a;
     border-color: #4da6ff;
     transform: translateX(-4px);
   }

   .back-button svg {
     transition: transform 0.2s ease;
   }

   .back-button:hover svg {
     transform: translateX(-2px);
   }



  .post-info {
    position: sticky;
    top: 7rem;
    height: fit-content;
    padding: 2rem;
    background: #2d2d2d;
    border-radius: 16px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.15);
    border: 1px solid #404040;
    transition: all 0.3s ease;
  }

  .post-info:hover {
    box-shadow: 0 12px 40px rgba(0,0,0,0.2);
    border-color: #4da6ff;
  }

  .post-info h2 {
    margin: 0 0 1.5rem 0;
    font-size: 1.8rem;
    line-height: 1.3;
    color: #f0f0f0;
    font-weight: 600;
  }

  .post-meta {
    font-size: 0.9rem;
    color: #a0a0a0;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid #404040;
    margin-bottom: 1.5rem;
  }

  .post-meta > div {
    margin-bottom: 0.5rem;
  }

  .post-date {
    color: #4da6ff;
    font-weight: 500;
  }

  .post-author {
    color: #b0b0b0;
  }

  .post-reading-time {
    color: #888;
    font-size: 0.85rem;
  }

  .post-tags {
    margin-bottom: 1.5rem;
  }

  .tag {
    display: inline-block;
    background: rgba(77, 166, 255, 0.1);
    color: #4da6ff;
    padding: 0.3rem 0.8rem;
    border-radius: 20px;
    font-size: 0.8rem;
    margin: 0.2rem 0.3rem 0.2rem 0;
    border: 1px solid rgba(77, 166, 255, 0.3);
    transition: all 0.2s ease;
  }

  .tag:hover {
    background: rgba(77, 166, 255, 0.2);
    transform: translateY(-1px);
  }

     .post-actions {
     display: flex;
     gap: 0.8rem;
     align-items: center;
   }

  .post-actions button {
    flex: 1;
    padding: 0.8rem 1rem;
    border: 1px solid #404040;
    border-radius: 8px;
    background: #333;
    color: #e0e0e0;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 0.9rem;
  }

  .post-actions button:hover {
    background: #4da6ff;
    color: #1a1a1a;
    border-color: #4da6ff;
  }

  .post-body {
    background: #2d2d2d;
    border-radius: 16px;
    padding: 3rem;
    box-shadow: 0 8px 32px rgba(0,0,0,0.1);
    border: 1px solid #404040;
    line-height: 1.7;
    font-size: 1.1rem;
  }

  .post-body h3 {
    color: #f0f0f0;
    font-size: 1.5rem;
    margin: 2rem 0 1rem 0;
    font-weight: 600;
  }

  .post-body p {
    margin-bottom: 1.5rem;
    color: #e0e0e0;
  }

  .post-body blockquote {
    border-left: 4px solid #4da6ff;
    padding-left: 1.5rem;
    margin: 2rem 0;
    font-style: italic;
    color: #b0b0b0;
    background: rgba(77, 166, 255, 0.05);
    padding: 1.5rem;
    border-radius: 0 8px 8px 0;
  }

  /* Responsive adjustments */
  @media (max-width: 1024px) {
    .post-content-container {
      grid-template-columns: 280px 1fr;
      gap: 2rem;
      padding: 1.5rem;
    }

    .post-info {
      padding: 1.5rem;
    }

    .post-body {
      padding: 2rem;
    }
  }

     @media (max-width: 768px) {
     .post-content-container {
       grid-template-columns: 1fr;
       gap: 1.5rem;
       padding: 1rem;
     }

           .back-button-container {
        position: relative;
        display: inline-block;
      }



     .post-info {
       position: relative;
       top: 0;
       order: 1;
       margin-bottom: 1.5rem;
     }

     .post-body {
       order: 2;
       padding: 1.5rem;
       font-size: 1rem;
     }

     .post-info h2 {
       font-size: 1.5rem;
     }
   }

  .social-share {
      max-width: 700px;
      margin: 1rem auto 0 auto;
      display: flex;
      gap: 1rem;
      justify-content: flex-end;
  }

  .share-btn {
      background: #404040;
      border: none;
      border-radius: 6px;
      padding: 0.5rem 1rem;
      cursor: pointer;
      font-size: 1rem;
      text-decoration: none;
      color: #e0e0e0;
      transition: background 0.2s, color 0.2s;
      display: inline-block;
  }

  .share-btn:hover {
      background: #4da6ff;
      color: #1a1a1a;
  }

  .modern-back-btn {
      font-size: 1.1rem;
      font-weight: 600;
      padding: 0.7rem 1.5rem;
      border-radius: 999px;
      box-shadow: 0 2px 8px rgba(0,0,0,0.18);
      background: linear-gradient(90deg, #232526 0%, #414345 100%);
      color: #e0e0e0;
      border: none;
      outline: none;
      cursor: pointer;
      transition: background 0.2s, color 0.2s, box-shadow 0.2s;
      gap: 0.5rem;
      display: inline-flex;
      align-items: center;
  }

  .modern-back-btn:hover {
      background: linear-gradient(90deg, #4da6ff 0%, #0077ff 100%);
      color: #fff;
      box-shadow: 0 4px 16px rgba(77,166,255,0.18);
  }