/* ============================================
   Kinda Hard Golf - Animation Styles
   Smooth animations and transitions
   ============================================ */

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

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

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

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

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

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

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

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

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

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

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

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

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

@keyframes glow {
    0% {
        box-shadow: 0 0 5px rgba(76, 175, 80, 0.5);
    }
    50% {
        box-shadow: 0 0 20px rgba(76, 175, 80, 0.8), 0 0 30px rgba(76, 175, 80, 0.6);
    }
    100% {
        box-shadow: 0 0 5px rgba(76, 175, 80, 0.5);
    }
}

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

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

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

@keyframes ballBounce {
    0%, 100% {
        transform: translateY(0) rotate(0deg);
    }
    25% {
        transform: translateY(-30px) rotate(-5deg);
    }
    50% {
        transform: translateY(0) rotate(0deg);
    }
    75% {
        transform: translateY(-15px) rotate(5deg);
    }
}

@keyframes flagWave {
    0%, 100% {
        transform: rotate(0deg);
    }
    25% {
        transform: rotate(5deg);
    }
    75% {
        transform: rotate(-5deg);
    }
}

/* Animation Classes */
.animate-fadeIn {
    animation: fadeIn 0.6s ease-in-out;
}

.animate-fadeInUp {
    animation: fadeInUp 0.8s ease-out;
}

.animate-fadeInDown {
    animation: fadeInDown 0.8s ease-out;
}

.animate-fadeInLeft {
    animation: fadeInLeft 0.8s ease-out;
}

.animate-fadeInRight {
    animation: fadeInRight 0.8s ease-out;
}

.animate-slideUp {
    animation: slideUp 0.6s ease-out;
}

.animate-slideDown {
    animation: slideDown 0.6s ease-out;
}

.animate-scaleIn {
    animation: scaleIn 0.5s ease-out;
}

.animate-bounce {
    animation: bounce 2s infinite;
}

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

.animate-spin {
    animation: spin 1s linear infinite;
}

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

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

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

/* Delayed Animations */
.animate-delay-1 {
    animation-delay: 0.1s;
}

.animate-delay-2 {
    animation-delay: 0.2s;
}

.animate-delay-3 {
    animation-delay: 0.3s;
}

.animate-delay-4 {
    animation-delay: 0.4s;
}

.animate-delay-5 {
    animation-delay: 0.5s;
}

/* Hover Animations */
.hover-grow:hover {
    transform: scale(1.05);
    transition: transform 0.3s ease;
}

.hover-shrink:hover {
    transform: scale(0.95);
    transition: transform 0.3s ease;
}

.hover-rotate:hover {
    transform: rotate(5deg);
    transition: transform 0.3s ease;
}

.hover-lift:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.15);
    transition: all 0.3s ease;
}

.hover-shadow:hover {
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.2);
    transition: box-shadow 0.3s ease;
}

.hover-glow:hover {
    box-shadow: 0 0 20px rgba(76, 175, 80, 0.6);
    transition: box-shadow 0.3s ease;
}

/* Loading Animations */
.loading-dots {
    display: inline-flex;
    gap: 0.25rem;
}

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

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

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

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

/* Golf Ball Loading Animation */
.golf-ball-loader {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: white;
    position: relative;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
    animation: ballBounce 1.5s ease-in-out infinite;
}

.golf-ball-loader::before {
    content: '';
    position: absolute;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    background-image: 
        radial-gradient(circle at 30% 30%, #ddd 2px, transparent 2px),
        radial-gradient(circle at 70% 30%, #ddd 2px, transparent 2px),
        radial-gradient(circle at 50% 50%, #ddd 2px, transparent 2px),
        radial-gradient(circle at 30% 70%, #ddd 2px, transparent 2px),
        radial-gradient(circle at 70% 70%, #ddd 2px, transparent 2px);
    background-size: 50% 50%;
}

/* Progress Bar Animation */
.progress-bar {
    width: 100%;
    height: 4px;
    background: var(--border-color);
    border-radius: 2px;
    overflow: hidden;
    position: relative;
}

.progress-bar::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    width: 40%;
    background: linear-gradient(90deg, var(--primary-color), var(--primary-light));
    animation: progressMove 1.5s ease-in-out infinite;
}

@keyframes progressMove {
    0% {
        transform: translateX(-100%);
    }
    100% {
        transform: translateX(250%);
    }
}

/* Ripple Effect */
.ripple {
    position: relative;
    overflow: hidden;
}

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

.ripple:active::before {
    width: 300px;
    height: 300px;
}

/* Gradient Animation */
.gradient-animate {
    background: linear-gradient(-45deg, #4CAF50, #81C784, #66BB6A, #43A047);
    background-size: 400% 400%;
    animation: gradientShift 15s ease infinite;
}

/* Score Counter Animation */
.score-counter {
    display: inline-block;
    transition: all 0.3s ease;
}

.score-counter.updating {
    animation: pulse 0.3s ease;
    color: var(--primary-color);
    transform: scale(1.2);
}

/* Success Animation */
.success-checkmark {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: var(--primary-color);
    position: relative;
    animation: scaleIn 0.3s ease;
}

.success-checkmark::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) rotate(45deg) scale(0);
    width: 15px;
    height: 25px;
    border: solid white;
    border-width: 0 3px 3px 0;
    animation: checkmarkIn 0.3s ease 0.3s forwards;
}

@keyframes checkmarkIn {
    to {
        transform: translate(-50%, -60%) rotate(45deg) scale(1);
    }
}

/* Smooth Scroll Indicator */
.scroll-indicator {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    animation: float 2s ease-in-out infinite;
}

.scroll-indicator::after {
    content: '↓';
    font-size: 24px;
    color: var(--primary-color);
    animation: bounce 2s ease-in-out infinite;
}

/* Page Transition */
.page-transition {
    animation: fadeIn 0.5s ease;
}

/* Parallax Scrolling Effect */
.parallax {
    transition: transform 0.5s ease-out;
}

/* Custom Scrollbar Animation */
::-webkit-scrollbar {
    width: 10px;
}

::-webkit-scrollbar-track {
    background: var(--bg-color);
}

::-webkit-scrollbar-thumb {
    background: var(--primary-color);
    border-radius: 5px;
    transition: background 0.3s ease;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--primary-dark);
}