/* ======================================
   SCROLL EXPERIENCE ENHANCEMENTS
   Based on scroll-experience skill
   ====================================== */

/* ===== SECTION TRANSITIONS ===== */
/* Alternatif section arka planları */
section:nth-child(even) {
    background: linear-gradient(180deg,
            rgba(10, 10, 18, 0.95) 0%,
            rgba(15, 15, 25, 0.9) 100%);
}

/* Section separator - subtle gradient line */
section::after {
    content: '';
    display: block;
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 60%;
    height: 1px;
    background: linear-gradient(90deg,
            transparent 0%,
            rgba(139, 92, 246, 0.3) 20%,
            rgba(139, 92, 246, 0.5) 50%,
            rgba(139, 92, 246, 0.3) 80%,
            transparent 100%);
    opacity: 0.6;
}

section:last-child::after {
    display: none;
}

/* ===== ENHANCED REVEAL ANIMATIONS ===== */
/* Staggered reveal for lists */
.reveal-stagger>* {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}

.reveal-stagger.active>*:nth-child(1) {
    transition-delay: 0.1s;
}

.reveal-stagger.active>*:nth-child(2) {
    transition-delay: 0.2s;
}

.reveal-stagger.active>*:nth-child(3) {
    transition-delay: 0.3s;
}

.reveal-stagger.active>*:nth-child(4) {
    transition-delay: 0.4s;
}

.reveal-stagger.active>*:nth-child(5) {
    transition-delay: 0.5s;
}

.reveal-stagger.active>*:nth-child(6) {
    transition-delay: 0.6s;
}

.reveal-stagger.active>* {
    opacity: 1;
    transform: translateY(0);
}

/* Reveal from left */
.reveal-left {
    opacity: 0;
    transform: translateX(-50px);
    transition: opacity 0.8s ease, transform 0.8s ease;
}

.reveal-left.active {
    opacity: 1;
    transform: translateX(0);
}

/* Reveal from right */
.reveal-right {
    opacity: 0;
    transform: translateX(50px);
    transition: opacity 0.8s ease, transform 0.8s ease;
}

.reveal-right.active {
    opacity: 1;
    transform: translateX(0);
}

/* Scale reveal */
.reveal-scale {
    opacity: 0;
    transform: scale(0.9);
    transition: opacity 0.8s ease, transform 0.8s ease;
}

.reveal-scale.active {
    opacity: 1;
    transform: scale(1);
}

/* ===== PARALLAX EFFECTS (CSS-based) ===== */
.parallax-slow {
    will-change: transform;
    transform: translateY(var(--parallax-offset, 0));
    transition: transform 0.1s linear;
}

/* ===== SCROLL PROGRESS INDICATOR ===== */
.scroll-indicator {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 3px;
    background: transparent;
    z-index: 9999;
}

.scroll-indicator::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    width: var(--scroll-progress, 0%);
    background: linear-gradient(90deg,
            var(--accent-purple) 0%,
            var(--accent-cyan) 50%,
            var(--accent-pink) 100%);
    transition: width 0.1s ease-out;
}

/* ===== SECTION GLOW EFFECTS ===== */
section {
    position: relative;
    overflow: hidden;
}

/* Subtle glow on section hover */
section:hover::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 600px;
    height: 600px;
    background: radial-gradient(circle,
            rgba(139, 92, 246, 0.03) 0%,
            transparent 70%);
    transform: translate(-50%, -50%);
    pointer-events: none;
    animation: pulse-glow 4s ease-in-out infinite;
}

@keyframes pulse-glow {

    0%,
    100% {
        opacity: 0.5;
        transform: translate(-50%, -50%) scale(1);
    }

    50% {
        opacity: 1;
        transform: translate(-50%, -50%) scale(1.1);
    }
}

/* ===== CARD HOVER ENHANCEMENTS ===== */
.card,
.project-card,
.skill-item,
.bento-item,
.announcement-card {
    transition: transform 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease;
}

.card:hover,
.project-card:hover,
.skill-item:hover,
.bento-item:hover,
.announcement-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3),
        0 0 30px rgba(139, 92, 246, 0.1);
    border-color: rgba(139, 92, 246, 0.3);
}

/* ===== SMOOTH SCROLLING ===== */
html {
    scroll-behavior: smooth;
}

/* Reduced motion support */
@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;
    }

    .reveal,
    .reveal-left,
    .reveal-right,
    .reveal-scale {
        opacity: 1;
        transform: none;
    }
}

/* ===== IMAGE LAZY LOADING PLACEHOLDER ===== */
img[loading="lazy"] {
    background: linear-gradient(135deg,
            var(--bg-secondary) 0%,
            var(--bg-card) 100%);
    min-height: 100px;
}

img[loading="lazy"].loaded {
    background: transparent;
}

/* ===== SCROLL-TRIGGERED TEXT EFFECTS ===== */
.text-reveal {
    overflow: hidden;
}

.text-reveal span {
    display: inline-block;
    transform: translateY(100%);
    transition: transform 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.text-reveal.active span {
    transform: translateY(0);
}

/* ===== STICKY SECTION SUPPORT ===== */
.sticky-section {
    position: sticky;
    top: 0;
    z-index: 10;
}

/* ===== MOBILE OPTIMIZATIONS ===== */
@media (max-width: 768px) {

    /* Reduce animation complexity on mobile */
    .reveal,
    .reveal-left,
    .reveal-right {
        transform: translateY(20px);
    }

    .reveal-scale {
        transform: scale(0.95);
    }

    /* Shorter transitions for mobile */
    .reveal,
    .reveal-left,
    .reveal-right,
    .reveal-scale {
        transition-duration: 0.5s;
    }

    /* Remove parallax on mobile for performance */
    .parallax-slow {
        transform: none !important;
    }

    /* Disable section hover glow on mobile */
    section:hover::before {
        display: none;
    }
}