/* ============================================
   SSGRBCC Animation Stylesheet
   Custom CSS animations for enhanced UX
   ============================================ */

/* ============================================
   PERFORMANCE OPTIMIZATION
   ============================================ */
* {
    /* Use GPU acceleration for transforms */
    -webkit-transform: translateZ(0);
    transform: translateZ(0);
}

/* Respect reduced motion preference */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* ============================================
   BUTTON ANIMATIONS
   ============================================ */

/* Button Hover Effects - Scale + Shadow */
.btn:not(.disabled):not(.no-animate) {
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    will-change: transform;
}

.btn:not(.disabled):not(.no-animate):hover {
    transform: translateY(-2px) scale(1.02);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.15);
}

.btn:not(.disabled):not(.no-animate):active {
    transform: translateY(0) scale(0.98);
}

/* Button Pulse Animation for Primary CTAs */
.btn-pulse {
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% {
        box-shadow: 0 0 0 0 rgba(248, 193, 70, 0.7);
    }
    50% {
        box-shadow: 0 0 0 10px rgba(248, 193, 70, 0);
    }
}

/* Button Ripple Effect */
.btn-ripple {
    position: relative;
    overflow: hidden;
}

.btn-ripple::after {
    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;
}

.btn-ripple:active::after {
    width: 300px;
    height: 300px;
}

/* ============================================
   FORM FIELD ANIMATIONS
   ============================================ */

/* Form Field Focus Animation */
.form-control:not(.no-animate),
input[type="text"]:not(.no-animate),
input[type="email"]:not(.no-animate),
input[type="tel"]:not(.no-animate),
textarea:not(.no-animate) {
    transition: border-color 0.3s ease, box-shadow 0.3s ease, transform 0.2s ease;
    will-change: border-color, box-shadow;
}

.form-control:not(.no-animate):focus,
input[type="text"]:not(.no-animate):focus,
input[type="email"]:not(.no-animate):focus,
input[type="tel"]:not(.no-animate):focus,
textarea:not(.no-animate):focus {
    transform: scale(1.01);
    box-shadow: 0 0 0 0.2rem rgba(248, 193, 70, 0.25);
}

/* Form Validation Animations */
.form-control.is-invalid {
    animation: shake 0.5s ease;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    10%, 30%, 50%, 70%, 90% { transform: translateX(-5px); }
    20%, 40%, 60%, 80% { transform: translateX(5px); }
}

.form-control.is-valid {
    position: relative;
}

.form-control.is-valid::after {
    content: '✓';
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    color: #28a745;
    font-weight: bold;
    animation: checkmark 0.3s ease;
}

@keyframes checkmark {
    0% {
        transform: translateY(-50%) scale(0);
    }
    50% {
        transform: translateY(-50%) scale(1.2);
    }
    100% {
        transform: translateY(-50%) scale(1);
    }
}

/* ============================================
   CARD ANIMATIONS
   ============================================ */

/* Card Hover Effects */
.card:not(.no-animate),
.stats-card:not(.no-animate),
.result-card:not(.no-animate),
.video-card:not(.no-animate) {
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    will-change: transform;
}

.card:not(.no-animate):hover,
.stats-card:not(.no-animate):hover,
.result-card:not(.no-animate):hover,
.video-card:not(.no-animate):hover {
    transform: translateY(-5px) scale(1.02);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

/* Card Lift Animation */
.card-lift {
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.card-lift:hover {
    transform: translateY(-8px);
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.2);
}

/* ============================================
   STATISTICS COUNTER ANIMATION
   ============================================ */

.stats-number {
    font-variant-numeric: tabular-nums;
    /* Ensures numbers don't shift during animation */
}

.stats-number.animating {
    transition: none;
}

/* Icon Pulse Animation */
.stats-icon i {
    transition: transform 0.3s ease;
}

.stats-card:hover .stats-icon i {
    animation: iconPulse 1s ease infinite;
}

@keyframes iconPulse {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.1);
    }
}

/* ============================================
   SCROLL ANIMATIONS (CSS-based fallback)
   ============================================ */

/* Fade In on Scroll */
.fade-in-on-scroll {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}

.fade-in-on-scroll.visible {
    opacity: 1;
    transform: translateY(0);
}

/* Slide Up on Scroll */
.slide-up-on-scroll {
    opacity: 0;
    transform: translateY(50px);
    transition: opacity 0.8s ease, transform 0.8s ease;
}

.slide-up-on-scroll.visible {
    opacity: 1;
    transform: translateY(0);
}

/* ============================================
   LOADING STATES
   ============================================ */

/* Loading Spinner */
.btn-loading {
    position: relative;
    color: transparent !important;
    pointer-events: none;
}

.btn-loading::after {
    content: '';
    position: absolute;
    width: 16px;
    height: 16px;
    top: 50%;
    left: 50%;
    margin-left: -8px;
    margin-top: -8px;
    border: 2px solid #ffffff;
    border-radius: 50%;
    border-top-color: transparent;
    animation: spinner 0.6s linear infinite;
}

@keyframes spinner {
    to { transform: rotate(360deg); }
}

/* Skeleton Loading */
.skeleton {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: skeleton-loading 1.5s ease-in-out infinite;
}

@keyframes skeleton-loading {
    0% {
        background-position: 200% 0;
    }
    100% {
        background-position: -200% 0;
    }
}

/* ============================================
   PAGE TRANSITIONS
   ============================================ */

/* Page Fade In */
.page-fade-in {
    animation: pageFadeIn 0.5s ease-out;
}

@keyframes pageFadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

/* ============================================
   STAGGER ANIMATIONS
   ============================================ */

/* Stagger Delay Classes */
.stagger-item {
    opacity: 0;
}

.stagger-item-1 { transition-delay: 0.1s; }
.stagger-item-2 { transition-delay: 0.2s; }
.stagger-item-3 { transition-delay: 0.3s; }
.stagger-item-4 { transition-delay: 0.4s; }
.stagger-item-5 { transition-delay: 0.5s; }
.stagger-item-6 { transition-delay: 0.6s; }

/* ============================================
   NAVIGATION ANIMATIONS
   ============================================ */

/* Sticky Navbar Transition */
.navbar.sticky {
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

/* Active Link Indicator Animation */
.nav-link.active::after {
    animation: underlineExpand 0.3s ease;
}

@keyframes underlineExpand {
    from {
        width: 0;
    }
    to {
        width: 60%;
    }
}

/* ============================================
   MOBILE OPTIMIZATIONS
   ============================================ */

@media (max-width: 768px) {
    /* Reduce animations on mobile for performance */
    .btn:not(.disabled):hover {
        transform: translateY(-1px) scale(1.01);
    }
    
    .card:hover,
    .stats-card:hover,
    .result-card:hover {
        transform: translateY(-3px) scale(1.01);
    }
    
    /* Disable parallax on mobile */
    .parallax {
        transform: none !important;
    }
}

/* ============================================
   ACCESSIBILITY
   ============================================ */

/* Ensure animations don't interfere with focus */
*:focus {
    outline: 2px solid #f8c146;
    outline-offset: 2px;
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .btn:hover,
    .card:hover {
        outline: 2px solid currentColor;
    }
}





