/* ========================================
   ÇANAKKALE OYLAMA SİSTEMİ - ANIMATIONS
   ======================================== */

/* ===== KEYFRAMES ===== */

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

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

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

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

/* Slide */
@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(40px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

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

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

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

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

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

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

@keyframes floatSlow {
    0%, 100% { transform: translateY(0) rotate(0deg); }
    25% { transform: translateY(-15px) rotate(1deg); }
    50% { transform: translateY(-8px) rotate(0deg); }
    75% { transform: translateY(-20px) rotate(-1deg); }
}

/* Pulse & Glow */
@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

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

@keyframes glow {
    0%, 100% { box-shadow: 0 0 5px rgba(212, 168, 67, 0.2); }
    50% { box-shadow: 0 0 20px rgba(212, 168, 67, 0.4), 0 0 40px rgba(212, 168, 67, 0.1); }
}

@keyframes glowText {
    0%, 100% { text-shadow: 0 0 10px rgba(212, 168, 67, 0.2); }
    50% { text-shadow: 0 0 20px rgba(212, 168, 67, 0.4), 0 0 40px rgba(212, 168, 67, 0.2); }
}

/* Shimmer */
@keyframes shimmer {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

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

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

@keyframes bounceInSmall {
    0% {
        opacity: 0;
        transform: scale(0.8);
    }
    60% {
        transform: scale(1.03);
    }
    100% {
        opacity: 1;
        transform: scale(1);
    }
}

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

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

/* Flip */
@keyframes flipIn {
    from {
        opacity: 0;
        transform: perspective(600px) rotateY(-90deg);
    }
    to {
        opacity: 1;
        transform: perspective(600px) rotateY(0);
    }
}

@keyframes flipOut {
    from {
        opacity: 1;
        transform: perspective(600px) rotateY(0);
    }
    to {
        opacity: 0;
        transform: perspective(600px) rotateY(90deg);
    }
}

/* 3D Tilt */
@keyframes tilt3D {
    0%, 100% {
        transform: perspective(1000px) rotateX(0) rotateY(0);
    }
    25% {
        transform: perspective(1000px) rotateX(2deg) rotateY(-2deg);
    }
    50% {
        transform: perspective(1000px) rotateX(-1deg) rotateY(2deg);
    }
    75% {
        transform: perspective(1000px) rotateX(1deg) rotateY(-1deg);
    }
}

/* Gradient Shift */
@keyframes gradientShift {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

/* Checkmark */
@keyframes checkmark {
    0% {
        stroke-dashoffset: 50;
        opacity: 0;
    }
    50% {
        opacity: 1;
    }
    100% {
        stroke-dashoffset: 0;
        opacity: 1;
    }
}

@keyframes checkmarkCircle {
    0% {
        stroke-dashoffset: 200;
    }
    100% {
        stroke-dashoffset: 0;
    }
}

/* Confetti Fall */
@keyframes confettiFall {
    0% {
        transform: translateY(-100px) rotate(0deg);
        opacity: 1;
    }
    100% {
        transform: translateY(100vh) rotate(720deg);
        opacity: 0;
    }
}

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

@keyframes rotateSlowly {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

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

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

/* Typewriter */
@keyframes typewriter {
    from { width: 0; }
    to { width: 100%; }
}

/* Blink */
@keyframes blink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0; }
}

/* Wave */
@keyframes wave {
    0%, 100% { transform: rotate(0deg); }
    25% { transform: rotate(20deg); }
    75% { transform: rotate(-15deg); }
}

/* Count Up */
@keyframes countUp {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Particle floating */
@keyframes particleFloat1 {
    0%, 100% { transform: translate(0, 0) scale(1); opacity: 0.3; }
    25% { transform: translate(100px, -150px) scale(1.2); opacity: 0.5; }
    50% { transform: translate(-50px, -300px) scale(0.8); opacity: 0.4; }
    75% { transform: translate(80px, -450px) scale(1.1); opacity: 0.2; }
}

@keyframes particleFloat2 {
    0%, 100% { transform: translate(0, 0) scale(1); opacity: 0.2; }
    33% { transform: translate(-80px, -200px) scale(1.3); opacity: 0.4; }
    66% { transform: translate(60px, -400px) scale(0.7); opacity: 0.3; }
}

@keyframes particleFloat3 {
    0%, 100% { transform: translate(0, 0) scale(0.8); opacity: 0.4; }
    50% { transform: translate(120px, -350px) scale(1.2); opacity: 0.2; }
}

@keyframes particleDrift {
    0% {
        transform: translateY(100vh) rotate(0deg);
        opacity: 0;
    }
    10% {
        opacity: 0.6;
    }
    90% {
        opacity: 0.3;
    }
    100% {
        transform: translateY(-10vh) rotate(360deg);
        opacity: 0;
    }
}

/* Bar grow */
@keyframes barGrow {
    from { width: 0%; }
}

/* Success animation */
@keyframes successPulse {
    0% {
        transform: scale(0.5);
        opacity: 0;
    }
    50% {
        transform: scale(1.2);
        opacity: 1;
    }
    100% {
        transform: scale(1);
        opacity: 1;
    }
}

/* ===== UTILITY ANIMATION CLASSES ===== */

.animate-fadeIn {
    animation: fadeIn 0.5s ease forwards;
}

.animate-fadeInUp {
    animation: fadeInUp 0.5s ease forwards;
}

.animate-fadeInDown {
    animation: fadeInDown 0.5s ease forwards;
}

.animate-slideUp {
    opacity: 0;
    animation: slideUp 0.6s ease forwards;
}

.animate-slideDown {
    opacity: 0;
    animation: slideDown 0.6s ease forwards;
}

.animate-slideLeft {
    opacity: 0;
    animation: slideLeft 0.6s ease forwards;
}

.animate-slideRight {
    opacity: 0;
    animation: slideRight 0.6s ease forwards;
}

.animate-bounceIn {
    animation: bounceIn 0.6s ease forwards;
}

.animate-scaleIn {
    animation: scaleIn 0.4s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

.animate-flipIn {
    animation: flipIn 0.6s ease forwards;
}

.animate-float {
    animation: float 3s ease-in-out infinite;
}

.animate-pulse {
    animation: pulse 2s ease-in-out infinite;
}

.animate-glow {
    animation: glow 2s ease-in-out infinite;
}

.animate-shake {
    animation: shake 0.5s ease;
}

.animate-wave {
    animation: wave 1s ease infinite;
    transform-origin: bottom right;
    display: inline-block;
}

/* ===== STAGGER DELAYS ===== */
.stagger-1 { animation-delay: 0.05s; }
.stagger-2 { animation-delay: 0.1s; }
.stagger-3 { animation-delay: 0.15s; }
.stagger-4 { animation-delay: 0.2s; }
.stagger-5 { animation-delay: 0.25s; }
.stagger-6 { animation-delay: 0.3s; }
.stagger-7 { animation-delay: 0.35s; }
.stagger-8 { animation-delay: 0.4s; }
.stagger-9 { animation-delay: 0.45s; }
.stagger-10 { animation-delay: 0.5s; }

/* ===== TRANSITION UTILITIES ===== */
.transition-all {
    transition: all 0.3s ease;
}

.transition-fast {
    transition: all 0.15s ease;
}

.transition-slow {
    transition: all 0.5s ease;
}

.transition-spring {
    transition: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* ===== HOVER EFFECTS ===== */
.hover-lift {
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.hover-lift:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.3);
}

.hover-glow:hover {
    box-shadow: 0 0 20px rgba(212, 168, 67, 0.2);
}

.hover-scale {
    transition: transform 0.3s ease;
}

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

.hover-tilt {
    transition: transform 0.3s ease;
    transform-style: preserve-3d;
}

.hover-tilt:hover {
    transform: perspective(800px) rotateX(2deg) rotateY(-2deg) scale(1.02);
}

/* ===== PAGE TRANSITION ===== */
.page-enter {
    animation: slideLeft 0.4s ease forwards;
}

.page-leave {
    animation: slideOutLeft 0.3s ease forwards;
}

.page-enter-back {
    animation: slideRight 0.4s ease forwards;
}

.page-leave-back {
    animation: slideOutRight 0.3s ease forwards;
}

/* ===== PARTICLE STYLES ===== */
.particle {
    animation: particleDrift linear infinite;
}

.particle:nth-child(odd) {
    background: rgba(212, 168, 67, 0.15);
}

.particle:nth-child(even) {
    background: rgba(45, 107, 158, 0.15);
}

.particle:nth-child(3n) {
    background: rgba(255, 255, 255, 0.08);
}

/* ===== SKELETON LOADING ===== */
.skeleton {
    background: linear-gradient(90deg,
        rgba(255, 255, 255, 0.05) 25%,
        rgba(255, 255, 255, 0.1) 50%,
        rgba(255, 255, 255, 0.05) 75%
    );
    background-size: 200% 100%;
    animation: shimmerBg 1.5s ease-in-out infinite;
    border-radius: var(--radius-sm);
}

.skeleton-text {
    height: 14px;
    margin-bottom: 8px;
    width: 80%;
}

.skeleton-text:last-child {
    width: 60%;
}

.skeleton-title {
    height: 24px;
    width: 50%;
    margin-bottom: 16px;
}

.skeleton-avatar {
    width: 60px;
    height: 60px;
    border-radius: 50%;
}

.skeleton-card {
    height: 180px;
    border-radius: var(--radius-lg);
}

/* ===== SCREEN TRANSITION ===== */
.screen-transitioning {
    pointer-events: none;
}

/* ===== LOADING DOTS ===== */
.loading-dots {
    display: inline-flex;
    gap: 4px;
}

.loading-dots span {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--text-secondary);
    animation: pulse 1.4s ease-in-out infinite;
}

.loading-dots span:nth-child(2) {
    animation-delay: 0.2s;
}

.loading-dots span:nth-child(3) {
    animation-delay: 0.4s;
}

/* ===== SUCCESS CHECKMARK ===== */
.success-checkmark {
    width: 80px;
    height: 80px;
    margin: 0 auto;
}

.success-checkmark .check-icon {
    width: 80px;
    height: 80px;
    position: relative;
    border-radius: 50%;
    box-sizing: content-box;
    border: 4px solid var(--success);
    animation: successPulse 0.6s ease;
}

.success-checkmark .check-icon::after {
    content: '✓';
    position: absolute;
    display: flex;
    align-items: center;
    justify-content: center;
    inset: 0;
    font-size: 2rem;
    color: var(--success);
    font-weight: bold;
}

/* ===== REDUCED MOTION ===== */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
    
    .particle {
        display: none;
    }
}
