/* Custom Styles for Blog */

/* Prose styling for blog content */
.prose {
    color: inherit;
}

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

.prose h1 {
    font-size: 2.25em;
    border-bottom: 2px solid;
    padding-bottom: 0.5em;
}

.prose h2 {
    font-size: 1.875em;
}

.prose h3 {
    font-size: 1.5em;
}

.prose p {
    margin-bottom: 1.25em;
    line-height: 1.75;
}

.prose a {
    color: #2563eb;
    text-decoration: underline;
}

.prose a:hover {
    color: #1d4ed8;
}

.dark .prose a {
    color: #60a5fa;
}

.dark .prose a:hover {
    color: #93c5fd;
}

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

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

.prose blockquote {
    border-left: 4px solid #e5e7eb;
    padding-left: 1em;
    margin: 1.5em 0;
    font-style: italic;
    color: #6b7280;
}

.dark .prose blockquote {
    border-left-color: #4b5563;
    color: #9ca3af;
}

.prose code {
    background-color: #f3f4f6;
    padding: 0.125em 0.375em;
    border-radius: 0.25em;
    font-size: 0.875em;
    font-family: 'Courier New', monospace;
}

.dark .prose code {
    background-color: #374151;
}

.prose pre {
    background-color: #1f2937;
    color: #f9fafb;
    padding: 1em;
    border-radius: 0.5em;
    overflow-x: auto;
    margin-bottom: 1.5em;
}

.dark .prose pre {
    background-color: #111827;
}

.prose pre code {
    background-color: transparent;
    padding: 0;
    color: inherit;
}

.prose img {
    max-width: 100%;
    height: auto;
    border-radius: 0.5em;
    margin: 1.5em 0;
}

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

.prose th,
.prose td {
    border: 1px solid #e5e7eb;
    padding: 0.75em;
    text-align: left;
}

.dark .prose th,
.dark .prose td {
    border-color: #4b5563;
}

.prose th {
    background-color: #f9fafb;
    font-weight: 600;
}

.dark .prose th {
    background-color: #1f2937;
}

.prose hr {
    border: none;
    border-top: 2px solid #e5e7eb;
    margin: 2em 0;
}

.dark .prose hr {
    border-top-color: #4b5563;
}

/* Line clamp utility */
.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 scrolling with performance optimization */
html {
    scroll-behavior: smooth;
    -webkit-overflow-scrolling: touch;
}

/* Fix scroll performance */
body {
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
}

/* Hardware acceleration for smooth scrolling */
main,
section,
.scroll-container {
    transform: translateZ(0);
    -webkit-transform: translateZ(0);
    will-change: scroll-position;
}

/* Focus styles for accessibility */
a:focus,
button:focus,
input:focus {
    outline: 2px solid #2563eb;
    outline-offset: 2px;
}

/* ============================================
   VISUAL EFFECTS & ANIMATIONS
   ============================================ */

/* Fade In Animation */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Slide In From Left */
@keyframes slideInLeft {
    from {
        opacity: 0;
        transform: translateX(-30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* Slide In From Right */
@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* Scale In Animation */
@keyframes scaleIn {
    from {
        opacity: 0;
        transform: scale(0.9);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* Gradient Animation */
@keyframes gradientShift {
    0% {
        background-position: 0% 50%;
    }
    50% {
        background-position: 100% 50%;
    }
    100% {
        background-position: 0% 50%;
    }
}

/* Pulse Animation */
@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.7;
    }
}

/* Shimmer Animation */
@keyframes shimmer {
    0% {
        background-position: -1000px 0;
    }
    100% {
        background-position: 1000px 0;
    }
}

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

/* Rotate Animation */
@keyframes rotate {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

/* ============================================
   SCROLL ANIMATIONS (Enhanced)
   ============================================ */

/* Fade in on scroll */
.fade-in {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.8s cubic-bezier(0.4, 0, 0.2, 1), 
                transform 0.8s cubic-bezier(0.4, 0, 0.2, 1);
    transition-delay: var(--animation-delay, 0s);
}

.fade-in.visible {
    opacity: 1;
    transform: translateY(0);
}

/* Slide in from left */
.slide-in-left {
    opacity: 0;
    transform: translateX(-60px);
    transition: opacity 0.8s cubic-bezier(0.4, 0, 0.2, 1), 
                transform 0.8s cubic-bezier(0.4, 0, 0.2, 1);
    transition-delay: var(--animation-delay, 0s);
}

.slide-in-left.visible {
    opacity: 1;
    transform: translateX(0);
}

/* Slide in from right */
.slide-in-right {
    opacity: 0;
    transform: translateX(60px);
    transition: opacity 0.8s cubic-bezier(0.4, 0, 0.2, 1), 
                transform 0.8s cubic-bezier(0.4, 0, 0.2, 1);
    transition-delay: var(--animation-delay, 0s);
}

.slide-in-right.visible {
    opacity: 1;
    transform: translateX(0);
}

/* Slide in from up */
.slide-in-up {
    opacity: 0;
    transform: translateY(60px);
    transition: opacity 0.8s cubic-bezier(0.4, 0, 0.2, 1), 
                transform 0.8s cubic-bezier(0.4, 0, 0.2, 1);
    transition-delay: var(--animation-delay, 0s);
}

.slide-in-up.visible {
    opacity: 1;
    transform: translateY(0);
}

/* Slide in from down */
.slide-in-down {
    opacity: 0;
    transform: translateY(-60px);
    transition: opacity 0.8s cubic-bezier(0.4, 0, 0.2, 1), 
                transform 0.8s cubic-bezier(0.4, 0, 0.2, 1);
    transition-delay: var(--animation-delay, 0s);
}

.slide-in-down.visible {
    opacity: 1;
    transform: translateY(0);
}

/* Scale in */
.scale-in {
    opacity: 0;
    transform: scale(0.8);
    transition: opacity 0.6s cubic-bezier(0.4, 0, 0.2, 1), 
                transform 0.6s cubic-bezier(0.4, 0, 0.2, 1);
    transition-delay: var(--animation-delay, 0s);
}

.scale-in.visible {
    opacity: 1;
    transform: scale(1);
}

/* Zoom in */
.zoom-in {
    opacity: 0;
    transform: scale(0.5);
    transition: opacity 0.7s cubic-bezier(0.4, 0, 0.2, 1), 
                transform 0.7s cubic-bezier(0.4, 0, 0.2, 1);
    transition-delay: var(--animation-delay, 0s);
}

.zoom-in.visible {
    opacity: 1;
    transform: scale(1);
}

/* Rotate in */
.rotate-in {
    opacity: 0;
    transform: rotate(-180deg) scale(0.8);
    transition: opacity 0.8s cubic-bezier(0.4, 0, 0.2, 1), 
                transform 0.8s cubic-bezier(0.4, 0, 0.2, 1);
    transition-delay: var(--animation-delay, 0s);
}

.rotate-in.visible {
    opacity: 1;
    transform: rotate(0deg) scale(1);
}

/* Flip in */
.flip-in {
    opacity: 0;
    transform: perspective(1000px) rotateY(-90deg);
    transition: opacity 0.8s cubic-bezier(0.4, 0, 0.2, 1), 
                transform 0.8s cubic-bezier(0.4, 0, 0.2, 1);
    transition-delay: var(--animation-delay, 0s);
    transform-style: preserve-3d;
}

.flip-in.visible {
    opacity: 1;
    transform: perspective(1000px) rotateY(0deg);
}

/* Bounce in */
.bounce-in {
    opacity: 0;
    transform: scale(0.3);
    transition: opacity 0.6s cubic-bezier(0.68, -0.55, 0.265, 1.55), 
                transform 0.6s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    transition-delay: var(--animation-delay, 0s);
}

.bounce-in.visible {
    opacity: 1;
    transform: scale(1);
}

/* Reveal animations */
.reveal-text {
    position: relative;
    overflow: hidden;
}

.reveal-text::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.8), transparent);
    transform: translateX(-100%);
    transition: transform 0.8s ease;
    z-index: 1;
}

.reveal-text.revealed::before {
    transform: translateX(100%);
}

.reveal-left {
    position: relative;
    overflow: hidden;
}

.reveal-left::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: inherit;
    transform: translateX(-100%);
    transition: transform 0.8s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 1;
}

.reveal-left.revealed::before {
    transform: translateX(0);
}

.reveal-right {
    position: relative;
    overflow: hidden;
}

.reveal-right::before {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 100%;
    height: 100%;
    background: inherit;
    transform: translateX(100%);
    transition: transform 0.8s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 1;
}

.reveal-right.revealed::before {
    transform: translateX(0);
}

.reveal-up {
    position: relative;
    overflow: hidden;
}

.reveal-up::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: inherit;
    transform: translateY(-100%);
    transition: transform 0.8s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 1;
}

.reveal-up.revealed::before {
    transform: translateY(0);
}

.reveal-down {
    position: relative;
    overflow: hidden;
}

.reveal-down::before {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: inherit;
    transform: translateY(100%);
    transition: transform 0.8s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 1;
}

.reveal-down.revealed::before {
    transform: translateY(0);
}

/* Scroll progress bar */
.scroll-progress {
    position: fixed;
    top: 0;
    left: 0;
    height: 3px;
    background: linear-gradient(90deg, #3b82f6, #8b5cf6, #ec4899);
    z-index: 9999;
    transition: width 0.1s ease;
    box-shadow: 0 2px 4px rgba(59, 130, 246, 0.3);
}

/* ============================================
   CARD EFFECTS
   ============================================ */

/* Card hover effect with lift */
article,
.bg-white,
.bg-gray-800 {
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
    will-change: transform;
}

article:hover,
.bg-white:hover,
.bg-gray-800:hover {
    transform: translateY(-12px) scale(1.02);
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25), 
                0 0 0 1px rgba(59, 130, 246, 0.1);
}

/* Card image zoom effect */
article img {
    transition: transform 0.5s ease, filter 0.5s ease;
}

article:hover img {
    transform: scale(1.1);
    filter: brightness(1.1);
}

/* Card shine effect on hover */
article::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;
    z-index: 1;
    pointer-events: none;
}

article:hover::before {
    left: 100%;
}

/* ============================================
   BUTTON EFFECTS
   ============================================ */

/* Button ripple effect */
button,
a[class*="bg-"] {
    position: relative;
    overflow: hidden;
    transition: all 0.3s ease;
}

button::after,
a[class*="bg-"]::after {
    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;
}

button:active::after,
a[class*="bg-"]:active::after {
    width: 300px;
    height: 300px;
}

/* Button hover scale */
button:hover,
a[class*="bg-"]:hover {
    transform: scale(1.05);
}

button:active,
a[class*="bg-"]:active {
    transform: scale(0.98);
}

/* Gradient button animation */
.bg-gradient-to-r {
    background-size: 200% 200%;
    animation: gradientShift 3s ease infinite;
}

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

/* Text gradient animation */
.text-gradient {
    background: linear-gradient(90deg, #3b82f6, #8b5cf6, #3b82f6);
    background-size: 200% auto;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: gradientShift 3s linear infinite;
}

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

/* ============================================
   NAVIGATION EFFECTS
   ============================================ */

/* Navbar backdrop blur enhancement */
nav {
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    transition: all 0.3s ease;
}

/* Nav link hover effect */
nav a {
    position: relative;
    transition: color 0.3s ease;
}

nav a::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 0;
    width: 0;
    height: 2px;
    background: linear-gradient(90deg, #3b82f6, #8b5cf6);
    transition: width 0.3s ease;
}

nav a:hover::after {
    width: 100%;
}

/* ============================================
   SEARCH BAR EFFECTS
   ============================================ */

#search-input {
    transition: all 0.3s ease;
}

#search-input:focus {
    transform: scale(1.02);
    box-shadow: 0 10px 25px -5px rgba(59, 130, 246, 0.3);
}

/* ============================================
   LOADING STATES
   ============================================ */

/* Skeleton loading */
.skeleton {
    background: linear-gradient(
        90deg,
        #f0f0f0 25%,
        #e0e0e0 50%,
        #f0f0f0 75%
    );
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
}

.dark .skeleton {
    background: linear-gradient(
        90deg,
        #374151 25%,
        #4b5563 50%,
        #374151 75%
    );
    background-size: 200% 100%;
}

/* ============================================
   HERO SECTION EFFECTS
   ============================================ */

/* Hero text animation */
h1 {
    animation: fadeIn 0.8s ease-out;
}

/* Hero buttons animation */
.hero-buttons {
    animation: fadeIn 1s ease-out 0.3s both;
}

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

/* Image parallax effect */
.parallax-img {
    transition: transform 0.3s ease-out;
}

.parallax-img:hover {
    transform: scale(1.05) translateY(-5px);
}

/* Image loading fade */
img {
    opacity: 0;
    transition: opacity 0.3s ease;
}

img.loaded {
    opacity: 1;
}

/* ============================================
   FORM EFFECTS
   ============================================ */

/* Input focus effect */
input:focus,
textarea:focus,
select:focus {
    transform: translateY(-2px);
    box-shadow: 0 10px 20px -5px rgba(59, 130, 246, 0.2);
}

/* ============================================
   ICON EFFECTS
   ============================================ */

/* Icon hover rotation */
.icon-rotate:hover {
    animation: rotate 0.6s ease;
}

/* Icon pulse */
.icon-pulse {
    animation: pulse 2s infinite;
}

/* ============================================
   STAGGERED ANIMATIONS
   ============================================ */

/* Stagger children animations */
.stagger-children > * {
    opacity: 0;
    transform: translateY(20px);
    animation: fadeIn 0.6s ease-out forwards;
}

.stagger-children > *:nth-child(1) { animation-delay: 0.1s; }
.stagger-children > *:nth-child(2) { animation-delay: 0.2s; }
.stagger-children > *:nth-child(3) { animation-delay: 0.3s; }
.stagger-children > *:nth-child(4) { animation-delay: 0.4s; }
.stagger-children > *:nth-child(5) { animation-delay: 0.5s; }
.stagger-children > *:nth-child(6) { animation-delay: 0.6s; }

/* ============================================
   RIPPLE EFFECT
   ============================================ */

.ripple {
    position: absolute;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.6);
    transform: scale(0);
    animation: ripple-animation 0.6s ease-out;
    pointer-events: none;
}

@keyframes ripple-animation {
    to {
        transform: scale(4);
        opacity: 0;
    }
}

/* ============================================
   CUSTOM CURSOR (Optional)
   ============================================ */

.custom-cursor {
    width: 20px;
    height: 20px;
    border: 2px solid #3b82f6;
    border-radius: 50%;
    position: fixed;
    pointer-events: none;
    z-index: 9999;
    transition: transform 0.1s ease;
    mix-blend-mode: difference;
}

.custom-cursor.expand {
    transform: scale(1.5);
    background: rgba(59, 130, 246, 0.1);
}

/* ============================================
   GLOW EFFECTS
   ============================================ */

.glow {
    box-shadow: 0 0 20px rgba(59, 130, 246, 0.5);
    transition: box-shadow 0.3s ease;
}

.glow:hover {
    box-shadow: 0 0 30px rgba(59, 130, 246, 0.8);
}

/* ============================================
   TEXT SHADOW EFFECTS
   ============================================ */

.text-glow {
    text-shadow: 0 0 10px rgba(59, 130, 246, 0.5);
}

/* ============================================
   EXISTING STYLES
   ============================================ */

/* Enhanced article animations */
article {
    animation: fadeIn 0.5s ease-in;
}

/* Stagger animation for post cards */
#posts-container article,
#featured-posts article {
    animation-delay: var(--animation-delay, 0s);
}

/* Smooth entrance for dynamically loaded content */
article.fade-in {
    opacity: 0;
    transform: translateY(30px);
}

article.fade-in.visible {
    opacity: 1;
    transform: translateY(0);
}

/* ============================================
   BREADCRUMBS
   ============================================ */

.breadcrumbs {
    list-style: none;
    padding: 0;
    margin: 0;
}

.breadcrumbs li {
    display: inline-flex;
    align-items: center;
}

.breadcrumbs a {
    color: #3b82f6;
    text-decoration: none;
    transition: color 0.2s;
}

.breadcrumbs a:hover {
    text-decoration: underline;
}

.breadcrumbs li:not(:first-child)::before {
    content: '/';
    margin: 0 0.5rem;
    color: #6b7280;
}

.dark .breadcrumbs a {
    color: #60a5fa;
}

.dark .breadcrumbs li::before {
    color: #9ca3af;
}

/* ============================================
   SEO ENHANCEMENTS
   ============================================ */

/* Skip to main content for accessibility */
.skip-to-main {
    position: absolute;
    top: -40px;
    left: 0;
    background: #3b82f6;
    color: white;
    padding: 8px;
    text-decoration: none;
    z-index: 100;
}

.skip-to-main:focus {
    top: 0;
}

/* Print styles */
@media print {
    .no-print {
        display: none;
    }
    
    body {
        background: white;
        color: black;
    }
    
    .breadcrumbs,
    nav,
    .reactions-container,
    .engagement-system {
        display: none;
    }
}

/* Screen reader only class for accessibility */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border-width: 0;
}

