/* ============================================
   DIZAYN AJANS OFSET - ANİMASYONLAR
   Scroll-triggered, hover & transition animations
   ============================================ */

/* ============================================
   KEYFRAME DEFINITIONS
   ============================================ */

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

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

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

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

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

@keyframes scaleIn {
    from {
        opacity: 0;
        transform: scale(0.8);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

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

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

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

@keyframes glow {
    0%, 100% { box-shadow: 0 0 20px rgba(0, 174, 239, 0.2); }
    50% { box-shadow: 0 0 40px rgba(0, 174, 239, 0.4); }
}

@keyframes rotateGradient {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

@keyframes typingDots {
    0%, 20% { opacity: 0; }
    50% { opacity: 1; }
    100% { opacity: 0; }
}

@keyframes bounceIn {
    0% { transform: scale(0.3); opacity: 0; }
    50% { transform: scale(1.05); }
    70% { transform: scale(0.9); }
    100% { transform: scale(1); opacity: 1; }
}

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

@keyframes ripple {
    0% {
        transform: scale(0);
        opacity: 0.5;
    }
    100% {
        transform: scale(4);
        opacity: 0;
    }
}

/* ============================================
   SCROLL-TRIGGERED ANIMATIONS
   Applied via IntersectionObserver in JS
   ============================================ */

/* Base state: hidden before animation */
[data-animate] {
    opacity: 0;
    transition: all 0.7s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

/* Specific initial positions */
[data-animate="fade-up"] {
    transform: translateY(50px);
}

[data-animate="fade-down"] {
    transform: translateY(-50px);
}

[data-animate="fade-left"] {
    transform: translateX(-50px);
}

[data-animate="fade-right"] {
    transform: translateX(50px);
}

[data-animate="scale"] {
    transform: scale(0.85);
}

[data-animate="fade"] {
    /* Only opacity change, already set to 0 */
}

/* Animated state: visible */
[data-animate].animated {
    opacity: 1;
    transform: translateY(0) translateX(0) scale(1);
}

/* Staggered delays for grid items */
[data-animate-delay="100"] { transition-delay: 0.1s; }
[data-animate-delay="200"] { transition-delay: 0.2s; }
[data-animate-delay="300"] { transition-delay: 0.3s; }
[data-animate-delay="400"] { transition-delay: 0.4s; }
[data-animate-delay="500"] { transition-delay: 0.5s; }
[data-animate-delay="600"] { transition-delay: 0.6s; }
[data-animate-delay="700"] { transition-delay: 0.7s; }
[data-animate-delay="800"] { transition-delay: 0.8s; }

/* ============================================
   HERO ANIMATIONS
   ============================================ */
.hero-content {
    animation: fadeInUp 1s ease 0.3s both;
}

.hero-logo {
    animation: fadeIn 1.2s ease 0.1s both;
}

.hero-tagline {
    animation: fadeIn 1s ease 0.6s both;
}

.hero-title {
    animation: fadeInUp 1s ease 0.8s both;
}

.hero-cta {
    animation: fadeInUp 1s ease 1s both;
}

/* Hero dots animation */
.hero-tagline .dot {
    animation: pulse 2s ease-in-out infinite;
}

.hero-tagline .dot-cyan {
    animation-delay: 0s;
}

.hero-tagline .dot-magenta {
    animation-delay: 0.3s;
}

/* Hero decorations float animation */
.hero-deco-1 {
    animation: float 8s ease-in-out infinite;
}

.hero-deco-2 {
    animation: float 10s ease-in-out infinite;
    animation-delay: -3s;
}

.hero-deco-3 {
    animation: float 7s ease-in-out infinite;
    animation-delay: -5s;
}

/* ============================================
   NAVBAR ANIMATIONS
   ============================================ */
.navbar {
    animation: fadeInDown 0.5s ease both;
}

/* ============================================
   HOVER MICRO-ANIMATIONS
   ============================================ */

/* Button ripple effect */
.btn-primary:active {
    transform: scale(0.97);
}

/* Card tilt on hover - subtle */
.service-card {
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

/* Stat card counter glow */
.stat-card:hover .stat-number {
    animation: glow 1.5s ease-in-out infinite;
}

/* Social link bounce */
.social-link:hover {
    animation: bounceIn 0.4s ease;
}

/* WhatsApp button pulse */
.whatsapp-float {
    animation: pulse 2s ease-in-out infinite;
}

.whatsapp-float:hover {
    animation: none;
}

/* Portfolio overlay items stagger */
.portfolio-item:hover .portfolio-info h4 {
    transition-delay: 0.05s;
}

.portfolio-item:hover .portfolio-info span {
    transition-delay: 0.1s;
}

/* ============================================
   PAGE TRANSITIONS
   ============================================ */
.page-transition {
    animation: fadeIn 0.5s ease both;
}

/* ============================================
   LOADING ANIMATION
   ============================================ */
.page-loader {
    position: fixed;
    inset: 0;
    z-index: 9999;
    background: var(--bg-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: opacity 0.5s ease, visibility 0.5s ease;
}

.page-loader.loaded {
    opacity: 0;
    visibility: hidden;
}

.loader-dots {
    display: flex;
    gap: 8px;
}

.loader-dots span {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    animation: typingDots 1.4s ease-in-out infinite;
}

.loader-dots span:nth-child(1) {
    background: var(--accent-cyan);
    animation-delay: 0s;
}

.loader-dots span:nth-child(2) {
    background: var(--accent-magenta);
    animation-delay: 0.2s;
}

.loader-dots span:nth-child(3) {
    background: var(--accent-yellow);
    animation-delay: 0.4s;
}

/* ============================================
   REDUCE MOTION (Accessibility)
   ============================================ */
@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;
    }

    [data-animate] {
        opacity: 1;
        transform: none;
    }
}
