/**
 * Animated Icons CSS
 * CSS animations for the GBE Animated Icons Library
 */

/* Base icon container */
.animated-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: transform 0.2s ease;
}

.animated-icon svg {
    display: block;
}

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

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

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

/* Pulse animation */
@keyframes icon-pulse {
    0%, 100% {
        transform: scale(1);
        opacity: 1;
    }
    50% {
        transform: scale(1.1);
        opacity: 0.8;
    }
}

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

/* Bounce animation */
@keyframes icon-bounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-5px); }
}

/* Scale animation */
@keyframes icon-scale {
    0% {
        transform: scale(0);
        opacity: 0;
    }
    100% {
        transform: scale(1);
        opacity: 1;
    }
}

/* Draw animation (stroke-dasharray) */
@keyframes icon-draw {
    from {
        stroke-dashoffset: 100;
    }
    to {
        stroke-dashoffset: 0;
    }
}

/* Draw up animation */
@keyframes icon-draw-up {
    from {
        stroke-dashoffset: 100;
        transform: translateY(10px);
        opacity: 0;
    }
    to {
        stroke-dashoffset: 0;
        transform: translateY(0);
        opacity: 1;
    }
}

/* Slide animations */
@keyframes icon-slide-down {
    from {
        transform: translateY(-5px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

@keyframes icon-slide-up {
    from {
        transform: translateY(5px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

@keyframes icon-slide-left {
    from {
        transform: translateX(5px);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes icon-slide-right {
    from {
        transform: translateX(-5px);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

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

/* Spin */
.icon-spin {
    transform-origin: center;
    animation: icon-spin 1s linear infinite;
}

.icon-spin-slow {
    transform-origin: center;
    animation: icon-spin-slow 3s linear infinite;
}

/* Pulse */
.icon-pulse {
    transform-origin: center;
    animation: icon-pulse 2s ease-in-out infinite;
}

/* Shake */
.icon-shake {
    animation: icon-shake 0.5s ease-in-out;
}

/* Bounce */
.icon-bounce {
    animation: icon-bounce 0.6s ease-in-out;
}

/* Scale */
.icon-scale {
    transform-origin: center;
    animation: icon-scale 0.6s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

/* Draw animations */
.icon-draw {
    stroke-dasharray: 100;
    stroke-dashoffset: 100;
    animation: icon-draw 0.6s ease-out forwards;
}

.icon-draw-up {
    stroke-dasharray: 100;
    stroke-dashoffset: 100;
    animation: icon-draw-up 0.6s ease-out forwards;
}

/* Slide animations */
.icon-slide-down {
    animation: icon-slide-down 0.4s ease-out forwards;
}

.icon-slide-up {
    animation: icon-slide-up 0.4s ease-out forwards;
}

.icon-slide-left {
    animation: icon-slide-left 0.4s ease-out forwards;
}

.icon-slide-right {
    animation: icon-slide-right 0.4s ease-out forwards;
}

/* ===============================================
   HOVER EFFECTS
   =============================================== */

.animated-icon.icon-hover path.icon-draw,
.animated-icon.icon-hover path.icon-draw-up {
    animation: icon-draw 0.4s ease-out forwards;
}

.animated-icon.icon-hover path.icon-pulse {
    animation: icon-pulse 0.6s ease-in-out;
}

.animated-icon.icon-hover path.icon-bounce {
    animation: icon-bounce 0.5s ease-in-out;
}

.animated-icon.icon-hover path.icon-shake {
    animation: icon-shake 0.4s ease-in-out;
}

.animated-icon.icon-hover circle.icon-scale {
    animation: icon-scale 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.animated-icon.icon-hover .icon-spin {
    animation: icon-spin 0.6s linear;
}

/* ===============================================
   LOADING SPINNER (from vehicles.html)
   =============================================== */

.loading-spinner {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 60px;
}

.loading-spinner .spinner,
.spinner {
    width: 48px;
    height: 48px;
    border: 4px solid var(--border-color, rgba(0, 0, 0, 0.1));
    border-top-color: var(--primary-color, #0047BA);
    border-radius: 50%;
    animation: icon-spin 1s linear infinite;
}

.spinner-sm {
    width: 24px;
    height: 24px;
    border-width: 3px;
}

.spinner-lg {
    width: 64px;
    height: 64px;
    border-width: 5px;
}

/* Spinner with icon */
.loading-spinner-icon {
    position: relative;
    display: inline-block;
}

.loading-spinner-icon .animated-icon {
    animation: icon-spin 1.5s ease-in-out infinite;
}

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

/* Disable animations on reduced motion preference */
@media (prefers-reduced-motion: reduce) {
    .animated-icon *,
    .icon-spin,
    .icon-spin-slow,
    .icon-pulse,
    .icon-shake,
    .icon-bounce,
    .icon-scale,
    .icon-draw,
    .icon-draw-up,
    .icon-slide-down,
    .icon-slide-up,
    .icon-slide-left,
    .icon-slide-right,
    .spinner {
        animation: none !important;
        transition: none !important;
    }
}

/* Animation delays for sequential animations */
.icon-delay-1 { animation-delay: 0.1s; }
.icon-delay-2 { animation-delay: 0.2s; }
.icon-delay-3 { animation-delay: 0.3s; }
.icon-delay-4 { animation-delay: 0.4s; }
.icon-delay-5 { animation-delay: 0.5s; }

/* Repeat animations */
.icon-repeat-infinite {
    animation-iteration-count: infinite !important;
}

.icon-repeat-2 { animation-iteration-count: 2; }
.icon-repeat-3 { animation-iteration-count: 3; }
