/* ===================================
   PREMIUM TRANSITIONS & EFFECTS
   Fast, smooth, professional animations
   =================================== */

/* ===================================
   PAGE TRANSITIONS
   =================================== */

.page-transition {
    opacity: 0;
    animation: fadeInPage 0.4s ease-out forwards;
}

@keyframes fadeInPage {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

/* ===================================
   SMOOTH SCROLL
   =================================== */

html {
    scroll-behavior: smooth;
}

@media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto;
    }
}

/* ===================================
   STAGGER ANIMATIONS FOR CARDS
   =================================== */

.stagger-item {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.5s ease, transform 0.5s ease;
}

.stagger-item.visible {
    opacity: 1;
    transform: translateY(0);
}

/* Stagger delays */
.stagger-item:nth-child(1) {
    transition-delay: 0.05s;
}

.stagger-item:nth-child(2) {
    transition-delay: 0.1s;
}

.stagger-item:nth-child(3) {
    transition-delay: 0.15s;
}

.stagger-item:nth-child(4) {
    transition-delay: 0.2s;
}

.stagger-item:nth-child(5) {
    transition-delay: 0.25s;
}

.stagger-item:nth-child(6) {
    transition-delay: 0.3s;
}

.stagger-item:nth-child(7) {
    transition-delay: 0.35s;
}

.stagger-item:nth-child(8) {
    transition-delay: 0.4s;
}

.stagger-item:nth-child(9) {
    transition-delay: 0.45s;
}

/* ===================================
   FAST MICRO-INTERACTIONS
   =================================== */

/* Fast button hover (200ms) */
.btn,
.neuro-btn,
button {
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Card hover (250ms) */
.card,
.service-card,
.neuro-card {
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Link hover (150ms) */
a {
    transition: color 0.15s ease, transform 0.15s ease;
}

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

.hover-lift {
    transition: transform 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

.hover-lift:hover {
    transform: translateY(-5px);
}

.hover-glow {
    position: relative;
    transition: box-shadow 0.3s ease;
}

.hover-glow:hover {
    box-shadow: 0 0 30px rgba(212, 175, 55, 0.4);
}

.hover-scale {
    transition: transform 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

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

/* ===================================
   LOADING STATES
   =================================== */

.skeleton {
    background: linear-gradient(90deg,
            rgba(224, 229, 236, 0.2) 25%,
            rgba(224, 229, 236, 0.4) 50%,
            rgba(224, 229, 236, 0.2) 75%);
    background-size: 200% 100%;
    animation: skeleton-loading 1.5s ease-in-out infinite;
    border-radius: 10px;
}

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

    100% {
        background-position: -200% 0;
    }
}

[data-theme="dark"] .skeleton {
    background: linear-gradient(90deg,
            rgba(45, 36, 36, 0.2) 25%,
            rgba(45, 36, 36, 0.4) 50%,
            rgba(45, 36, 36, 0.2) 75%);
    background-size: 200% 100%;
}

/* Spinner */
.spinner {
    width: 40px;
    height: 40px;
    border: 4px solid rgba(212, 175, 55, 0.3);
    border-top-color: var(--gold-primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

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

/* ===================================
   FADE IN ANIMATIONS
   =================================== */

.fade-in {
    animation: fadeIn 0.4s ease-out;
}

.fade-in-up {
    animation: fadeInUp 0.5s ease-out;
}

.fade-in-down {
    animation: fadeInDown 0.5s ease-out;
}

@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);
    }
}

/* ===================================
   SLIDE ANIMATIONS
   =================================== */

.slide-in-left {
    animation: slideInLeft 0.5s ease-out;
}

.slide-in-right {
    animation: slideInRight 0.5s ease-out;
}

@keyframes slideInLeft {
    from {
        transform: translateX(-100%);
        opacity: 0;
    }

    to {
        transform: translateX(0);
        opacity: 1;
    }
}

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

    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* ===================================
   PULSE EFFECT
   =================================== */

.pulse {
    animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

@keyframes pulse {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0.7;
    }
}

/* ===================================
   BOUNCE EFFECT
   =================================== */

.bounce-in {
    animation: bounceIn 0.6s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

@keyframes bounceIn {
    0% {
        transform: scale(0.3);
        opacity: 0;
    }

    50% {
        transform: scale(1.05);
    }

    70% {
        transform: scale(0.9);
    }

    100% {
        transform: scale(1);
        opacity: 1;
    }
}

/* ===================================
   RIPPLE EFFECT (for buttons)
   =================================== */

.ripple {
    position: relative;
    overflow: hidden;
}

.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;
}

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

/* ===================================
   PARALLAX SMOOTH SCROLL
   =================================== */

.parallax-section {
    background-attachment: fixed;
    background-position: center;
    background-repeat: no-repeat;
    background-size: cover;
    transition: transform 0.1s ease-out;
}

/* ===================================
   MODAL TRANSITIONS
   =================================== */

.modal.fade .modal-dialog {
    transition: transform 0.3s ease-out, opacity 0.3s ease-out;
    transform: scale(0.8) translateY(-50px);
    opacity: 0;
}

.modal.show .modal-dialog {
    transform: scale(1) translateY(0);
    opacity: 1;
}

/* ===================================
   OPTIMIZED CARD STACKING
   =================================== */

.card-stack {
    perspective: 1000px;
}

.card-stack .card {
    transform-style: preserve-3d;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.card-stack .card:hover {
    transform: rotateY(5deg) translateZ(20px);
}

/* ===================================
   SCROLL PROGRESS BAR
   =================================== */

.scroll-progress {
    position: fixed;
    top: 0;
    left: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--gold-primary), var(--gold-bright));
    z-index: 9999;
    transition: width 0.1s ease-out;
}

/* ===================================
   IMAGE LAZY LOAD FADE
   =================================== */

img[loading="lazy"] {
    opacity: 0;
    transition: opacity 0.4s ease-in;
}

img[loading="lazy"].loaded {
    opacity: 1;
}

/* ===================================
   NAVIGATION TRANSITIONS
   =================================== */

.pills-nav {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.pills-menu a {
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ===================================
   FOCUS STATES (Accessibility)
   =================================== */

*:focus-visible {
    outline: 2px solid var(--gold-primary);
    outline-offset: 2px;
    transition: outline-offset 0.2s ease;
}

/* ===================================
   REDUCE MOTION (Accessibility)
   =================================== */

@media (prefers-reduced-motion: reduce) {

    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}

/* ===================================
   GPU ACCELERATION
   =================================== */

.gpu-accelerated {
    transform: translateZ(0);
    backface-visibility: hidden;
    perspective: 1000px;
}

/* ===================================
   WILL-CHANGE (Use sparingly)
   =================================== */

.will-change-transform {
    will-change: transform;
}

.will-change-opacity {
    will-change: opacity;
}

/* Remove will-change after animation */
.transition-complete {
    will-change: auto;
}