/* ================================================================
 * animations.css - Gelişmiş Webkit Animasyonları
 * ================================================================
 * Modern, profesyonel ve performanslı animasyon kütüphanesi
 * GPU hızlandırmalı, smooth geçişler ve etkileyici efektler
 * ================================================================ */

/* --- PRELOADER (Yükleme Ekranı) - MODERN & MINIMAL --- */
#preloader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #ffffff;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    opacity: 1;
    visibility: visible;
    transition: opacity 0.4s cubic-bezier(0.4, 0, 0.2, 1),
                visibility 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

#preloader.loaded {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

/* Modern Logo Animasyonu */
@keyframes logoFade {
    0%, 100% { opacity: 0.4; transform: scale(0.95); }
    50% { opacity: 1; transform: scale(1.05); }
}

.preloader-logo {
    width: 120px;
    height: 120px;
    margin-bottom: 30px;
    animation: logoFade 2s ease-in-out infinite;
}

.preloader-logo img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

/* Minimal Spinner */
@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

@keyframes pulse {
    0%, 100% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.1); opacity: 0.8; }
}

.loader-spinner {
    width: 50px;
    height: 50px;
    border: 3px solid #f0f0f0;
    border-top: 3px solid #007bff;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin-bottom: 20px;
}

.preloader-dots {
    display: flex;
    gap: 8px;
    margin-top: 20px;
}

.preloader-dot {
    width: 8px;
    height: 8px;
    background: #007bff;
    border-radius: 50%;
    animation: pulse 1.4s ease-in-out infinite;
}

.preloader-dot:nth-child(1) { animation-delay: 0s; }
.preloader-dot:nth-child(2) { animation-delay: 0.2s; }
.preloader-dot:nth-child(3) { animation-delay: 0.4s; }

#preloader p {
    margin-top: 15px;
    color: #6c757d;
    font-size: 0.95rem;
    font-weight: 500;
    letter-spacing: 0.5px;
}

/* Dark Mode Preloader */
body.dark-mode #preloader {
    background: #1a1d23;
}

body.dark-mode #preloader p {
    color: #adb5bd;
}

body.dark-mode .loader-spinner {
    border-color: #3a3f47;
    border-top-color: #007bff;
}

body.dark-mode .preloader-dot {
    background: #007bff;
}

/* --- Temel Animasyon Ayarları (GPU Hızlandırmalı) --- */
[data-animation] {
    opacity: 0;
    transition: all 0.8s cubic-bezier(0.4, 0, 0.2, 1);
    will-change: transform, opacity;
    backface-visibility: hidden;
    -webkit-font-smoothing: antialiased;
}

[data-animation].is-visible {
    opacity: 1;
}

/* --- 1. FADE ANIMASYONLARI --- */

[data-animation="fade-in"] {
    transform: translateX(-20px);
}
[data-animation="fade-in"].is-visible {
    transform: translateX(0);
}

[data-animation="fade-in-up"] {
    transform: translateY(40px);
}
[data-animation="fade-in-up"].is-visible {
    transform: translateY(0);
}

[data-animation="fade-in-down"] {
    transform: translateY(-40px);
}
[data-animation="fade-in-down"].is-visible {
    transform: translateY(0);
}

[data-animation="fade-in-left"] {
    transform: translateX(-60px);
}
[data-animation="fade-in-left"].is-visible {
    transform: translateX(0);
}

[data-animation="fade-in-right"] {
    transform: translateX(60px);
}
[data-animation="fade-in-right"].is-visible {
    transform: translateX(0);
}

/* --- 2. ZOOM ANIMASYONLARI --- */

[data-animation="zoom-in"] {
    transform: scale(0.7);
}
[data-animation="zoom-in"].is-visible {
    transform: scale(1);
}

[data-animation="zoom-in-up"] {
    transform: scale(0.8) translateY(40px);
}
[data-animation="zoom-in-up"].is-visible {
    transform: scale(1) translateY(0);
}

[data-animation="zoom-out"] {
    transform: scale(1.3);
}
[data-animation="zoom-out"].is-visible {
    transform: scale(1);
}

/* --- 3. ROTATE ANIMASYONLARI --- */

[data-animation="rotate-in"] {
    transform: rotate(-180deg) scale(0.8);
}
[data-animation="rotate-in"].is-visible {
    transform: rotate(0deg) scale(1);
}

/* --- 4. FLIP ANIMASYONLARI (3D) --- */

[data-animation="flip-in-x"] {
    transform: perspective(1000px) rotateX(-90deg);
    transform-style: preserve-3d;
}
[data-animation="flip-in-x"].is-visible {
    transform: perspective(1000px) rotateX(0deg);
}

[data-animation="flip-in-y"] {
    transform: perspective(1000px) rotateY(-90deg);
    transform-style: preserve-3d;
}
[data-animation="flip-in-y"].is-visible {
    transform: perspective(1000px) rotateY(0deg);
}

/* --- 5. BLUR ANIMASYONU --- */

[data-animation="blur-in"] {
    filter: blur(15px) brightness(0.8);
    opacity: 0;
    transform: scale(1.1);
}
[data-animation="blur-in"].is-visible {
    filter: blur(0) brightness(1);
    opacity: 1;
    transform: scale(1);
}

/* --- 6. GRADIENT SHIFT --- */

@keyframes gradient-shift {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

.hero-gradient {
    background: linear-gradient(-45deg, #667eea 0%, #764ba2 25%, #f093fb 50%, #4facfe 75%, #00f2fe 100%);
    background-size: 400% 400%;
    animation: gradient-shift 15s ease infinite;
}

/* --- 7. STAGGER (Ardışık) --- */

.product-grid [data-animation]:nth-child(1) { transition-delay: 0.05s; }
.product-grid [data-animation]:nth-child(2) { transition-delay: 0.1s; }
.product-grid [data-animation]:nth-child(3) { transition-delay: 0.15s; }
.product-grid [data-animation]:nth-child(4) { transition-delay: 0.2s; }
.product-grid [data-animation]:nth-child(5) { transition-delay: 0.25s; }
.product-grid [data-animation]:nth-child(6) { transition-delay: 0.3s; }
.product-grid [data-animation]:nth-child(7) { transition-delay: 0.35s; }
.product-grid [data-animation]:nth-child(8) { transition-delay: 0.4s; }

/* --- 8. PULSE (Nabız) --- */

@keyframes pulse {
    0%, 100% {
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(0, 123, 255, 0.7);
    }
    50% {
        transform: scale(1.05);
        box-shadow: 0 0 0 15px rgba(0, 123, 255, 0);
    }
}

.btn-pulse {
    animation: pulse 2s infinite cubic-bezier(0.4, 0, 0.6, 1);
}

/* --- 9. FLOATING (Yüzme) --- */

@keyframes floating {
    0%, 100% { transform: translateY(0px); }
    50% { transform: translateY(-15px); }
}

[data-animation="floating"] {
    animation: floating 3s ease-in-out infinite;
}

/* --- 10. GLOW (Işıldama) --- */

@keyframes glow {
    0%, 100% {
        box-shadow: 0 0 10px rgba(0, 123, 255, 0.4),
                    0 0 20px rgba(0, 123, 255, 0.2);
    }
    50% {
        box-shadow: 0 0 20px rgba(0, 123, 255, 0.8),
                    0 0 40px rgba(0, 123, 255, 0.5);
    }
}

.btn-glow:hover {
    animation: glow 1.5s infinite;
}

/* --- 11. SHIMMER (Işıltı) --- */

@keyframes shimmer {
    0% { background-position: -1000px 0; }
    100% { background-position: 1000px 0; }
}

.shimmer {
    background: linear-gradient(
        90deg,
        rgba(255, 255, 255, 0) 0%,
        rgba(255, 255, 255, 0.3) 50%,
        rgba(255, 255, 255, 0) 100%
    );
    background-size: 1000px 100%;
    animation: shimmer 2s infinite;
}

/* --- 12. SKELETON LOADING --- */

@keyframes skeleton-loading {
    0% { background-position: -200px 0; }
    100% { background-position: calc(200px + 100%) 0; }
}

.skeleton {
    background: linear-gradient(
        90deg,
        #f0f0f0 0%,
        #f8f8f8 20%,
        #f0f0f0 40%,
        #f0f0f0 100%
    );
    background-size: 200px 100%;
    animation: skeleton-loading 1.5s infinite linear;
    border-radius: 4px;
}

.skeleton-text {
    height: 16px;
    margin-bottom: 12px;
}

/* --- 13. SHAKE (Hata) --- */

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    10%, 30%, 50%, 70%, 90% { transform: translateX(-8px); }
    20%, 40%, 60%, 80% { transform: translateX(8px); }
}

.shake-animation {
    animation: shake 0.5s cubic-bezier(0.36, 0.07, 0.19, 0.97);
}

/* --- 14. BOUNCE --- */

@keyframes bounce {
    0%, 20%, 50%, 80%, 100% { transform: translateY(0); }
    40% { transform: translateY(-20px); }
    60% { transform: translateY(-10px); }
}

.bounce-animation {
    animation: bounce 1s;
}

/* --- 15. RIPPLE EFEKTI --- */

@keyframes ripple {
    0% {
        transform: scale(0);
        opacity: 1;
    }
    100% {
        transform: scale(4);
        opacity: 0;
    }
}

.ripple-effect {
    position: relative;
    overflow: hidden;
}

.ripple-effect::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    background: rgba(255, 255, 255, 0.5);
    border-radius: 50%;
    transform: translate(-50%, -50%) scale(0);
    pointer-events: none;
}

.ripple-effect:active::after {
    animation: ripple 0.6s ease-out;
}

/* --- 16. TEXT GRADIENT --- */

@keyframes text-gradient {
    0%, 100% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
}

.text-gradient {
    background: linear-gradient(
        90deg,
        #667eea 0%,
        #764ba2 25%,
        #f093fb 50%,
        #4facfe 75%,
        #00f2fe 100%
    );
    background-size: 200% auto;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: text-gradient 3s linear infinite;
}

/* --- 17. CARD HOVER --- */

.card-hover-lift {
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.card-hover-lift:hover {
    transform: translateY(-12px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.15);
}

/* --- 18. GLASSMORPHISM --- */

.glass {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.1);
}

/* --- 19. PARALLAX --- */

.parallax-bg {
    background-attachment: fixed;
    background-size: cover;
    background-position: center;
}

@media (max-width: 768px) {
    .parallax-bg {
        background-attachment: scroll;
    }
}

/* --- 20. SPINNER --- */

.spinner {
    border: 4px solid rgba(0, 123, 255, 0.1);
    border-top: 4px solid #007bff;
    border-radius: 50%;
    width: 50px;
    height: 50px;
    animation: spin 1s linear infinite;
}

/* --- RESPONSIVE --- */

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

@media (max-width: 768px) {
    [data-animation] {
        transition-duration: 0.5s;
    }
    
    [data-animation="blur-in"],
    [data-animation="flip-in-x"],
    [data-animation="flip-in-y"] {
        filter: none;
        transform: none;
        opacity: 0;
    }
    
    [data-animation="blur-in"].is-visible,
    [data-animation="flip-in-x"].is-visible,
    [data-animation="flip-in-y"].is-visible {
        opacity: 1;
    }
}
