/**
 * Torba Dergisi - İleri Seviye Animasyonlar
 * Scroll reveal, stagger, micro-interactions, reduced-motion
 */

/* ========== KEYFRAMES ========== */
@keyframes advFadeInUp {
    from {
        opacity: 0;
        transform: translateY(40px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes advFadeInLeft {
    from {
        opacity: 0;
        transform: translateX(-40px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes advFadeInRight {
    from {
        opacity: 0;
        transform: translateX(40px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes advScaleIn {
    from {
        opacity: 0;
        transform: scale(0.92);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

@keyframes advBlurIn {
    from {
        opacity: 0;
        filter: blur(12px);
    }
    to {
        opacity: 1;
        filter: blur(0);
    }
}

@keyframes advLineExpand {
    from {
        transform: scaleX(0);
    }
    to {
        transform: scaleX(1);
    }
}

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

@keyframes advGlowPulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(13, 148, 136, 0.25); }
    50% { box-shadow: 0 0 0 12px rgba(13, 148, 136, 0); }
}

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

@keyframes advGradientBg {
    0%, 100% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
}

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

/* ========== SCROLL REVEAL (JS adds .animate-in) ========== */
/* İçerik varsayılan görünsün; boş sayfa / büyük boşluk olmasın */
.section.reveal-up {
    animation: none;
    opacity: 1;
}

.reveal-up {
    opacity: 1;
    transform: translateY(0);
    transition: opacity 0.8s cubic-bezier(0.22, 1, 0.36, 1), transform 0.8s cubic-bezier(0.22, 1, 0.36, 1);
}

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

.reveal-left {
    opacity: 1;
    transform: translateX(0);
    transition: opacity 0.8s cubic-bezier(0.22, 1, 0.36, 1), transform 0.8s cubic-bezier(0.22, 1, 0.36, 1);
}

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

.reveal-right {
    opacity: 1;
    transform: translateX(0);
    transition: opacity 0.8s cubic-bezier(0.22, 1, 0.36, 1), transform 0.8s cubic-bezier(0.22, 1, 0.36, 1);
}

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

.reveal-scale {
    opacity: 1;
    transform: scale(1);
    transition: opacity 0.6s cubic-bezier(0.22, 1, 0.36, 1), transform 0.6s cubic-bezier(0.22, 1, 0.36, 1);
}

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

.reveal-blur {
    opacity: 1;
    filter: blur(0);
    transition: opacity 0.8s ease, filter 0.8s ease;
}

.reveal-blur.animate-in {
    opacity: 1;
    filter: blur(0);
}

/* ========== STAGGER CHILDREN ========== */
.stagger-children > * {
    opacity: 1;
    transform: translateY(0);
    transition: opacity 0.6s cubic-bezier(0.22, 1, 0.36, 1), transform 0.6s cubic-bezier(0.22, 1, 0.36, 1);
    transition-delay: calc(var(--stagger-i, 0) * 0.08s);
}

.stagger-children.animate-in > * {
    opacity: 1;
    transform: translateY(0);
}

/* ========== HERO STAGGERED REVEAL ========== */
/* Varsayılan görünür; boş hero alanı kalmasın */
.hero-reveal .hero-tag,
.hero-reveal .hero-title,
.hero-reveal .hero-title em,
.hero-reveal .hero-desc,
.hero-reveal .hero-cta,
.hero-reveal .hero-scroll {
    opacity: 1;
    transform: translateY(0);
}

.hero-scroll .scroll-indicator {
    animation: advFloat 2.5s ease-in-out infinite;
    animation-delay: 2s;
}

/* ========== SECTION TITLE UNDERLINE REVEAL ========== */
.section-header-reveal .section-title {
    position: relative;
    display: inline-block;
}

.section-header-reveal .section-title::after {
    content: '';
    position: absolute;
    left: 0;
    bottom: -8px;
    width: 60px;
    height: 3px;
    background: linear-gradient(90deg, var(--color-accent-teal), var(--color-accent-blue));
    border-radius: 2px;
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 0.8s cubic-bezier(0.22, 1, 0.36, 1);
}

.section-header-reveal.animate-in .section-title::after {
    transform: scaleX(1);
}

/* ========== NAV LINK HOVER UNDERLINE ========== */
.nav-links a {
    position: relative;
}

.nav-links a::after {
    content: '';
    position: absolute;
    left: 0;
    bottom: -4px;
    width: 100%;
    height: 2px;
    background: var(--color-accent-teal);
    transform: scaleX(0);
    transform-origin: right;
    transition: transform 0.3s cubic-bezier(0.22, 1, 0.36, 1);
}

.nav-links a:hover::after,
.nav-links a.active::after {
    transform: scaleX(1);
    transform-origin: left;
}

/* ========== CARD HOVER: IMAGE ZOOM ========== */
.issue-card .issue-cover,
.shop-card .issue-cover,
.issue-card .issue-cover-img,
.shop-card .shop-cover-img,
.issue-card .issue-cover img,
.shop-card .shop-card-cover img {
    overflow: hidden;
}

.issue-card .issue-cover img,
.issue-card .issue-cover .issue-placeholder,
.shop-card .shop-card-cover img,
.shop-card .shop-card-cover .issue-placeholder {
    transition: transform 0.6s cubic-bezier(0.22, 1, 0.36, 1);
}

.issue-card:hover .issue-cover img,
.issue-card:hover .issue-cover .issue-placeholder,
.shop-card:hover .shop-card-cover img,
.shop-card:hover .shop-card-cover .issue-placeholder {
    transform: scale(1.08);
}

/* ========== CARD HOVER: LIFT + SHADOW ========== */
.issue-card,
.shop-card,
.author-card,
.event-card,
.blog-card,
.team-card {
    transition: transform 0.4s cubic-bezier(0.22, 1, 0.36, 1), box-shadow 0.4s ease;
}

.issue-card:hover,
.shop-card:hover,
.author-card:hover,
.event-card:hover,
.blog-card:hover,
.team-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 20px 50px rgba(33, 44, 59, 0.15);
}

/* ========== BUTTON HOVER GLOW ========== */
.btn-primary {
    transition: box-shadow 0.3s ease, transform 0.2s ease;
}

.btn-primary:hover {
    box-shadow: 0 4px 24px rgba(13, 148, 136, 0.4);
    transform: translateY(-2px);
}

.btn-primary:active {
    transform: translateY(0);
}

.btn-outline:hover {
    box-shadow: 0 4px 20px rgba(33, 44, 59, 0.12);
    transform: translateY(-2px);
}

/* ========== NAV ICON BUTTONS HOVER ========== */
.nav-icon-btn {
    transition: transform 0.2s ease, box-shadow 0.3s ease;
}

.nav-icon-btn:hover {
    transform: translateY(-2px);
}

.nav-icon-btn:active {
    transform: translateY(0);
}

/* ========== ANIMATED BACKGROUND (subtle) ========== */
.hero-bg {
    background: linear-gradient(160deg, #1a2332 0%, #212C3B 50%, #1a2332 100%);
}

/* ========== FOOTER / CTA SUBTLE SHIMMER ========== */
.cta-box,
.shop-cta-content {
    position: relative;
    overflow: hidden;
}

.cta-box::before,
.shop-cta-content::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 50%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.08), transparent);
    transition: left 0.6s ease;
}

.cta-box:hover::before,
.shop-cta-content:hover::before {
    left: 100%;
}

/* ========== PAGE LOAD: SMOOTH CONTENT ========== */
.page-main {
    animation: advFadeInUp 0.6s cubic-bezier(0.22, 1, 0.36, 1) 0.2s backwards;
}

/* ========== REDUCED MOTION ========== */
@media (prefers-reduced-motion: reduce) {
    .hero-bg,
    .hero-scroll .scroll-indicator,
    .issue-placeholder,
    .shop-card-cover .issue-placeholder {
        animation: none !important;
    }
    
    .reveal-up,
    .reveal-left,
    .reveal-right,
    .reveal-scale,
    .reveal-blur,
    .stagger-children > * {
        opacity: 1 !important;
        transform: none !important;
        transition: none !important;
    }
    
    .hero-reveal .hero-tag,
    .hero-reveal .hero-title,
    .hero-reveal .hero-title em,
    .hero-reveal .hero-desc,
    .hero-reveal .hero-cta,
    .hero-reveal .hero-scroll {
        animation: none !important;
        opacity: 1 !important;
        transform: none !important;
    }
    
    .section-header-reveal .section-title::after {
        transform: scaleX(1) !important;
    }
    
    .issue-card:hover .issue-cover img,
    .issue-card:hover .issue-cover .issue-placeholder,
    .shop-card:hover .shop-card-cover img,
    .shop-card:hover .shop-card-cover .issue-placeholder {
        transform: none !important;
    }
    
    .issue-card:hover,
    .shop-card:hover,
    .author-card:hover,
    .event-card:hover,
    .btn-primary:hover,
    .btn-outline:hover,
    .nav-icon-btn:hover {
        transform: none !important;
    }
}
