/* ========================================
   Topçu Bul - Animasyonlar
   ======================================== */

/* ========================================
   Keyframe Animations
   ======================================== */

/* Fade In */
@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

/* Fade In Up */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Fade In Down */
@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

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

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

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

/* Bounce */
@keyframes bounce {
    0%, 20%, 50%, 80%, 100% {
        transform: translateY(0);
    }
    40% {
        transform: translateY(-20px);
    }
    60% {
        transform: translateY(-10px);
    }
}

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

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

/* Shake */
@keyframes shake {
    0%, 100% {
        transform: translateX(0);
    }
    10%, 30%, 50%, 70%, 90% {
        transform: translateX(-5px);
    }
    20%, 40%, 60%, 80% {
        transform: translateX(5px);
    }
}

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

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

/* ========================================
   Animation Classes
   ======================================== */

/* Base animation properties */
.animate {
    animation-duration: 0.6s;
    animation-fill-mode: both;
    animation-timing-function: ease-out;
}

/* Fade animations */
.animate-fadeIn {
    animation-name: fadeIn;
}

.animate-fadeInUp {
    animation-name: fadeInUp;
}

.animate-fadeInDown {
    animation-name: fadeInDown;
}

.animate-fadeInLeft {
    animation-name: fadeInLeft;
}

.animate-fadeInRight {
    animation-name: fadeInRight;
}

/* Scale animation */
.animate-scaleIn {
    animation-name: scaleIn;
}

/* Bounce animation */
.animate-bounce {
    animation-name: bounce;
    animation-duration: 1s;
}

/* Pulse animation */
.animate-pulse {
    animation-name: pulse;
    animation-duration: 2s;
    animation-iteration-count: infinite;
}

/* Float animation */
.animate-float {
    animation-name: float;
    animation-duration: 3s;
    animation-iteration-count: infinite;
    animation-timing-function: ease-in-out;
}

/* Spin animation */
.animate-spin {
    animation-name: spin;
    animation-duration: 1s;
    animation-iteration-count: infinite;
    animation-timing-function: linear;
}

/* Animation delays */
.delay-100 { animation-delay: 0.1s; }
.delay-200 { animation-delay: 0.2s; }
.delay-300 { animation-delay: 0.3s; }
.delay-400 { animation-delay: 0.4s; }
.delay-500 { animation-delay: 0.5s; }
.delay-600 { animation-delay: 0.6s; }
.delay-700 { animation-delay: 0.7s; }
.delay-800 { animation-delay: 0.8s; }
.delay-900 { animation-delay: 0.9s; }
.delay-1000 { animation-delay: 1s; }

/* ========================================
   Scroll-Triggered Animations
   ======================================== */

/* Initial hidden state for scroll animations */
[data-animate] {
    opacity: 0;
    transition: opacity 0.6s ease, transform 0.6s ease;
}

[data-animate="fadeInUp"] {
    transform: translateY(30px);
}

[data-animate="fadeInDown"] {
    transform: translateY(-30px);
}

[data-animate="fadeInLeft"] {
    transform: translateX(-30px);
}

[data-animate="fadeInRight"] {
    transform: translateX(30px);
}

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

/* Visible state */
[data-animate].is-visible {
    opacity: 1;
    transform: translate(0) scale(1);
}

/* Stagger children animations */
.stagger-children > * {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.4s ease, transform 0.4s ease;
}

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

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

/* ========================================
   Hover Animations
   ======================================== */

/* Lift effect */
.hover-lift {
    transition: transform var(--transition-normal), box-shadow var(--transition-normal);
}

.hover-lift:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px var(--shadow-dark);
}

/* Scale effect */
.hover-scale {
    transition: transform var(--transition-normal);
}

.hover-scale:hover {
    transform: scale(1.05);
}

/* Glow effect */
.hover-glow {
    transition: box-shadow var(--transition-normal);
}

.hover-glow:hover {
    box-shadow: 0 0 20px rgba(0, 168, 89, 0.4);
}

/* Shine effect */
.hover-shine {
    position: relative;
    overflow: hidden;
}

.hover-shine::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 ease;
}

.hover-shine:hover::before {
    left: 100%;
}

/* ========================================
   Button Animations
   ======================================== */

/* Ripple effect */
.btn-ripple {
    position: relative;
    overflow: hidden;
}

.btn-ripple::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    background: rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    transition: width 0.6s ease, height 0.6s ease;
}

.btn-ripple:active::after {
    width: 200px;
    height: 200px;
}

/* Arrow animation for buttons */
.btn-arrow i {
    transition: transform var(--transition-normal);
}

.btn-arrow:hover i {
    transform: translateX(5px);
}

/* ========================================
   Loading Animations
   ======================================== */

/* Spinner */
.spinner {
    width: 40px;
    height: 40px;
    border: 3px solid var(--border-color);
    border-top-color: var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

.loader-dots span {
    width: 10px;
    height: 10px;
    background: var(--primary-color);
    border-radius: 50%;
    animation: bounce 1.4s ease-in-out infinite both;
}

.loader-dots span:nth-child(1) { animation-delay: -0.32s; }
.loader-dots span:nth-child(2) { animation-delay: -0.16s; }
.loader-dots span:nth-child(3) { animation-delay: 0; }

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

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

/* ========================================
   Page Transition
   ======================================== */

/* Page fade in */
.page-transition {
    animation: fadeIn 0.4s ease;
}

/* Content reveal */
.reveal {
    clip-path: inset(0 100% 0 0);
    animation: reveal 0.8s ease forwards;
}

@keyframes reveal {
    to {
        clip-path: inset(0 0 0 0);
    }
}

/* ========================================
   Special Effects
   ======================================== */

/* Gradient text animation */
.gradient-text-animate {
    background: linear-gradient(
        90deg,
        var(--primary-color),
        var(--secondary-color),
        var(--primary-color)
    );
    background-size: 200% auto;
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    animation: gradient-shift 3s linear infinite;
}

@keyframes gradient-shift {
    to {
        background-position: 200% center;
    }
}

/* Underline animation */
.underline-animate {
    position: relative;
    display: inline-block;
}

.underline-animate::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--primary-color);
    transition: width var(--transition-normal);
}

.underline-animate:hover::after {
    width: 100%;
}

/* Icon rotate on hover */
.icon-rotate-hover {
    transition: transform var(--transition-normal);
}

.icon-rotate-hover:hover {
    transform: rotate(360deg);
}

/* Number counter animation class */
.counter {
    display: inline-block;
}

.counter.counting {
    animation: countUp 0.5s ease forwards;
}

/* ========================================
   Mobile Menu Animations
   ======================================== */

/* Slide down menu */
.mobile-menu {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
}

.mobile-menu.is-open {
    max-height: 400px;
}

/* Menu item stagger */
.mobile-menu .nav-link {
    opacity: 0;
    transform: translateX(-20px);
    transition: opacity 0.3s ease, transform 0.3s ease;
}

.mobile-menu.is-open .nav-link {
    opacity: 1;
    transform: translateX(0);
}

.mobile-menu.is-open .nav-link:nth-child(1) { transition-delay: 0.1s; }
.mobile-menu.is-open .nav-link:nth-child(2) { transition-delay: 0.15s; }
.mobile-menu.is-open .nav-link:nth-child(3) { transition-delay: 0.2s; }
.mobile-menu.is-open .nav-link:nth-child(4) { transition-delay: 0.25s; }
.mobile-menu.is-open .nav-link:nth-child(5) { transition-delay: 0.3s; }

/* ========================================
   Form Animations
   ======================================== */

/* Input focus animation */
.form-group input:focus,
.form-group textarea:focus {
    animation: inputFocus 0.3s ease;
}

@keyframes inputFocus {
    0% {
        box-shadow: 0 0 0 0 rgba(0, 168, 89, 0.4);
    }
    100% {
        box-shadow: 0 0 0 3px rgba(0, 168, 89, 0.1);
    }
}

/* Error shake */
.form-error {
    animation: shake 0.5s ease;
}

/* Success checkmark */
.form-success::after {
    content: '\2713';
    position: absolute;
    right: 15px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--primary-color);
    animation: scaleIn 0.3s ease;
}

/* ========================================
   Notification Animations
   ======================================== */

/* Toast slide in */
.toast {
    animation: slideInRight 0.3s ease;
}

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

/* Toast slide out */
.toast.hiding {
    animation: slideOutRight 0.3s ease forwards;
}

@keyframes slideOutRight {
    to {
        transform: translateX(100%);
        opacity: 0;
    }
}

/* ========================================
   Accessibility - Reduced Motion
   ======================================== */

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }

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

    .stagger-children > * {
        opacity: 1 !important;
        transform: none !important;
    }
}
