/* ============================================
   Blog CSS - Canistan Blog
   ============================================ */

/* Neural Network Container */
.neural-network-container {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  z-index: -1;
  pointer-events: none;
  overflow: hidden;
}

.neural-network-container canvas {
  display: block;
  width: 100%;
  height: 100%;
}

/* ============================================
   Glass Card Component
   ============================================ */

.glass-card {
  background: linear-gradient(135deg, rgba(17, 17, 17, 0.35) 0%, rgba(26, 26, 26, 0.4) 100%);
  backdrop-filter: blur(16px);
  border: 1px solid rgba(255, 255, 255, 0.12);
  box-shadow:
    0 4px 30px rgba(0, 0, 0, 0.1),
    inset 0 1px 0 rgba(255, 255, 255, 0.1),
    0 8px 32px rgba(99, 102, 241, 0.05);
}

/* Hover effects for glass cards */
.hover-lift {
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.hover-lift:hover {
  transform: translateY(-4px);
  box-shadow:
    0 8px 40px rgba(0, 0, 0, 0.2),
    inset 0 1px 0 rgba(255, 255, 255, 0.1),
    0 12px 48px rgba(99, 102, 241, 0.1);
}

.hover-glow {
  transition: box-shadow 0.3s ease;
}

.hover-glow:hover {
  box-shadow:
    0 8px 40px rgba(0, 0, 0, 0.2),
    inset 0 1px 0 rgba(255, 255, 255, 0.1),
    0 12px 48px rgba(99, 102, 241, 0.15),
    0 0 20px rgba(99, 102, 241, 0.2);
}

/* ============================================
   AOS Animation Fix - Ensure elements are visible
   ============================================ */

[data-aos] {
  opacity: 1 !important;
  transform: none !important;
  transition: none !important;
}

/* ============================================
   Typography & Content
   ============================================ */

/* Prose styling for blog content */
.prose {
  max-width: 65ch;
  color: #a1a1aa;
  line-height: 1.75;
}

.prose h1,
.prose h2,
.prose h3,
.prose h4,
.prose h5,
.prose h6 {
  color: #f4f4f5;
  font-weight: 700;
  line-height: 1.3;
  margin-top: 2em;
  margin-bottom: 1em;
}

.prose h1 { font-size: 2.25em; }
.prose h2 { font-size: 1.875em; }
.prose h3 { font-size: 1.5em; }
.prose h4 { font-size: 1.25em; }

.prose p {
  margin-top: 1.25em;
  margin-bottom: 1.25em;
}

.prose a {
  color: #818cf8;
  text-decoration: underline;
  text-decoration-color: rgba(129, 140, 248, 0.3);
  transition: all 0.2s ease;
}

.prose a:hover {
  color: #a5b4fc;
  text-decoration-color: rgba(129, 140, 248, 0.6);
}

.prose strong {
  color: #f4f4f5;
  font-weight: 600;
}

.prose ul,
.prose ol {
  margin-top: 1.25em;
  margin-bottom: 1.25em;
  padding-left: 1.625em;
}

.prose li {
  margin-top: 0.5em;
  margin-bottom: 0.5em;
}

.prose li::marker {
  color: #71717a;
}

.prose blockquote {
  font-weight: 500;
  font-style: italic;
  color: #d4d4d8;
  border-left: 4px solid #6366f1;
  padding-left: 1em;
  margin: 1.5em 0;
  background: linear-gradient(90deg, rgba(99, 102, 241, 0.1), transparent);
  padding: 1em 1.5em;
  border-radius: 0 8px 8px 0;
}

.prose code {
  color: #f472b6;
  font-weight: 600;
  font-size: 0.875em;
  background: rgba(244, 114, 182, 0.1);
  padding: 0.2em 0.4em;
  border-radius: 4px;
  font-family: 'JetBrains Mono', monospace;
}

.prose pre {
  background: #282c34;
  border-radius: 8px;
  padding: 1em;
  overflow-x: auto;
  margin: 1.5em 0;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.prose pre code {
  background: transparent;
  padding: 0;
  color: #abb2bf;
  font-weight: 400;
}

.prose img {
  margin-top: 2em;
  margin-bottom: 2em;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  cursor: pointer;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.prose img:hover {
  transform: scale(1.02);
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
}

.prose hr {
  border-color: rgba(255, 255, 255, 0.1);
  margin: 3em 0;
}

.prose table {
  width: 100%;
  border-collapse: collapse;
  margin: 1.5em 0;
  font-size: 0.875em;
}

.prose th,
.prose td {
  padding: 0.75em 1em;
  border: 1px solid rgba(255, 255, 255, 0.1);
  text-align: left;
}

.prose th {
  background: rgba(99, 102, 241, 0.1);
  color: #f4f4f5;
  font-weight: 600;
}

.prose tr:hover td {
  background: rgba(255, 255, 255, 0.02);
}

/* ============================================
   Code Blocks with Highlight.js
   ============================================ */

.blog-content pre {
  position: relative;
  margin: 1.5em 0;
}

.blog-content pre code {
  font-family: 'JetBrains Mono', 'Fira Code', monospace !important;
  font-size: 0.875rem;
  line-height: 1.6;
}

.blog-content .hljs {
  background: #282c34 !important;
  padding: 1.5em !important;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

/* Language indicator */
.blog-content pre::before {
  content: attr(data-language);
  position: absolute;
  top: 0.5em;
  right: 0.75em;
  font-size: 0.75rem;
  color: #71717a;
  font-family: 'JetBrains Mono', monospace;
  text-transform: uppercase;
}

/* Copy button for code blocks */
.code-copy-btn {
  position: absolute;
  top: 0.5em;
  right: 0.5em;
  padding: 0.375em 0.75em;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 4px;
  color: #a1a1aa;
  font-size: 0.75rem;
  cursor: pointer;
  transition: all 0.2s ease;
  font-family: inherit;
}

.code-copy-btn:hover {
  background: rgba(255, 255, 255, 0.15);
  color: #f4f4f5;
}

.code-copy-btn.copied {
  background: rgba(34, 197, 94, 0.2);
  color: #22c55e;
  border-color: rgba(34, 197, 94, 0.3);
}

/* ============================================
   Video Container
   ============================================ */

.video-container {
  position: relative;
  padding-bottom: 56.25%; /* 16:9 aspect ratio */
  height: 0;
  overflow: hidden;
  border-radius: 12px;
  margin: 1.5em 0;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.video-container iframe {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
}

/* ============================================
   Twitter/X Embed
   ============================================ */

.twitter-tweet {
  margin: 1.5em 0 !important;
  border: 1px solid rgba(255, 255, 255, 0.1) !important;
  border-radius: 12px !important;
  overflow: hidden !important;
}

/* ============================================
   Image Lightbox
   ============================================ */

.lightbox {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.95);
  z-index: 9999;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 2rem;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.lightbox.active {
  display: flex;
  opacity: 1;
}

.lightbox img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  border-radius: 8px;
  box-shadow: 0 25px 50px rgba(0, 0, 0, 0.5);
}

.lightbox-close {
  position: absolute;
  top: 1.5rem;
  right: 1.5rem;
  width: 3rem;
  height: 3rem;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 50%;
  color: #f4f4f5;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
}

.lightbox-close:hover {
  background: rgba(255, 255, 255, 0.15);
  transform: rotate(90deg);
}

.lightbox-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 3rem;
  height: 3rem;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 50%;
  color: #f4f4f5;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
}

.lightbox-nav:hover {
  background: rgba(255, 255, 255, 0.15);
}

.lightbox-prev { left: 1.5rem; }
.lightbox-next { right: 1.5rem; }

/* ============================================
   Comment Section
   ============================================ */

.comment-form textarea {
  min-height: 120px;
}

.comment {
  animation: fadeIn 0.3s ease;
}

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

/* ============================================
   Responsive Design
   ============================================ */

@media (max-width: 768px) {
  .prose {
    font-size: 0.95rem;
  }
  
  .prose h1 { font-size: 1.75em; }
  .prose h2 { font-size: 1.5em; }
  .prose h3 { font-size: 1.25em; }
  
  .lightbox {
    padding: 1rem;
  }
  
  .lightbox-close,
  .lightbox-nav {
    width: 2.5rem;
    height: 2.5rem;
  }
  
  .lightbox-close { top: 1rem; right: 1rem; }
  .lightbox-prev { left: 0.5rem; }
  .lightbox-next { right: 0.5rem; }
}

/* ============================================
   Utility Classes
   ============================================ */

.line-clamp-2 {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.line-clamp-3 {
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* ============================================
   Smooth Scroll
   ============================================ */

html {
  scroll-behavior: smooth;
}

/* ============================================
   Print Styles
   ============================================ */

@media print {
  .neural-network-container,
  nav,
  footer,
  .sidebar,
  .pagination,
  .share-buttons,
  .comment-form {
    display: none !important;
  }
  
  .prose {
    color: #000;
  }
  
  .prose a {
    color: #000;
    text-decoration: underline;
  }
}

/* ============================================
   Social Sharing Styles
   ============================================ */

/* Share Buttons */
.share-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.share-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.share-button:hover {
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.share-button:active {
  transform: scale(0.98);
}

/* Platform-specific colors for hover states */
.share-button[data-platform="twitter"]:hover {
  box-shadow: 0 4px 12px rgba(29, 161, 242, 0.4);
}

.share-button[data-platform="facebook"]:hover {
  box-shadow: 0 4px 12px rgba(24, 119, 242, 0.4);
}

.share-button[data-platform="linkedin"]:hover {
  box-shadow: 0 4px 12px rgba(10, 102, 194, 0.4);
}

.share-button[data-platform="whatsapp"]:hover {
  box-shadow: 0 4px 12px rgba(37, 211, 102, 0.4);
}

.share-button[data-platform="reddit"]:hover {
  box-shadow: 0 4px 12px rgba(255, 69, 0, 0.4);
}

/* Share Count */
.share-count {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
}

.share-count::before {
  content: '•';
}

/* Floating Share Bar (Desktop) */
.floating-share-bar {
  position: fixed;
  left: 1rem;
  top: 50%;
  transform: translateY(-50%);
  z-index: 40;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.floating-share-bar .share-button {
  width: 3rem;
  height: 3rem;
  border-radius: 50%;
  padding: 0;
  background: rgba(39, 39, 42, 0.9);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.floating-share-bar .share-button:hover {
  background: rgba(63, 63, 70, 0.95);
}

.floating-share-bar .share-button svg {
  margin: 0;
}

/* Mobile Share Menu */
.mobile-share-menu {
  position: fixed;
  inset: 0;
  z-index: 50;
}

.mobile-share-menu > div:first-child {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
}

.mobile-share-menu > div:last-child {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: #18181b;
  border-top: 1px solid rgba(63, 63, 70, 0.5);
  padding: 1.5rem;
  border-radius: 1rem 1rem 0 0;
  animation: slideUp 0.3s ease-out;
}

@keyframes slideUp {
  from {
    transform: translateY(100%);
  }
  to {
    transform: translateY(0);
  }
}

.mobile-share-menu .share-button {
  flex-direction: column;
  padding: 1rem;
  gap: 0.5rem;
  border-radius: 0.75rem;
}

.mobile-share-menu .share-button span {
  margin-left: 0;
  font-size: 0.75rem;
}

/* Mobile Share FAB */
.mobile-share-fab {
  position: fixed;
  bottom: 1rem;
  right: 1rem;
  width: 3.5rem;
  height: 3.5rem;
  background: linear-gradient(135deg, #6366f1, #a855f7);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 20px rgba(99, 102, 241, 0.4);
  z-index: 30;
  transition: transform 0.2s ease;
}

.mobile-share-fab:hover {
  transform: scale(1.1);
}

/* Copy Link Notification */
.copy-notification {
  position: fixed;
  bottom: 2rem;
  left: 50%;
  transform: translateX(-50%) translateY(100px);
  background: #10b981;
  color: white;
  padding: 0.75rem 1.5rem;
  border-radius: 0.5rem;
  font-weight: 500;
  z-index: 100;
  opacity: 0;
  transition: all 0.3s ease;
  box-shadow: 0 4px 12px rgba(16, 185, 129, 0.4);
}

.copy-notification.show {
  transform: translateX(-50%) translateY(0);
  opacity: 1;
}

/* Share Widget */
.share-widget {
  background: rgba(24, 24, 27, 0.5);
  border: 1px solid rgba(63, 63, 70, 0.5);
  border-radius: 0.75rem;
  padding: 1.5rem;
}

.share-widget input[type="text"] {
  background: rgba(39, 39, 42, 0.5);
  border: 1px solid rgba(63, 63, 70, 0.5);
  color: #a1a1aa;
}

.share-widget input[type="text"]:focus {
  outline: none;
  border-color: #6366f1;
}

/* Responsive adjustments */
@media (max-width: 1024px) {
  .floating-share-bar {
    display: none !important;
  }
}

@media (min-width: 1025px) {
  .mobile-share-menu,
  .mobile-share-fab {
    display: none !important;
  }
}

/* Share button animation on click */
.share-button.clicked {
  animation: pulse 0.3s ease;
}

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