/**
 * PREMIUM ANIMATIONS & 3D EFFECTS
 * Glassmorphism, 3D Cards, Micro-interactions
 * Inspired by: Novadent & Premium Medical Themes
 */

/* ============================================
   GLASSMORPHISM UTILITIES
   ============================================ */

.glass-card {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 20px;
    box-shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.15);
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.glass-card-dark {
    background: rgba(46, 80, 144, 0.15);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    border: 1px solid rgba(136, 201, 193, 0.2);
    box-shadow: 0 8px 32px 0 rgba(136, 201, 193, 0.15);
}

.glass-card:hover {
    background: rgba(255, 255, 255, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.3);
    box-shadow: 0 16px 48px 0 rgba(31, 38, 135, 0.25);
    transform: translateY(-8px) scale(1.02);
}

/* ============================================
   3D CARD EFFECTS
   ============================================ */

.card-3d {
    perspective: 1000px;
    transform-style: preserve-3d;
    transition: transform 0.6s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.card-3d:hover {
    transform: rotateY(5deg) rotateX(5deg) scale(1.05);
}

.card-3d-tilt {
    transition: all 0.4s ease;
}

.card-3d-tilt:hover {
    transform: perspective(1000px) rotateX(5deg) translateY(-10px);
    box-shadow: 
        0 20px 40px rgba(46, 80, 144, 0.2),
        0 0 0 1px rgba(136, 201, 193, 0.1);
}

/* ============================================
   FLOATING ANIMATIONS
   ============================================ */

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

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

@keyframes pulse-glow {
    0%, 100% { 
        box-shadow: 0 0 20px rgba(136, 201, 193, 0.4),
                    0 0 40px rgba(136, 201, 193, 0.2);
    }
    50% { 
        box-shadow: 0 0 30px rgba(136, 201, 193, 0.6),
                    0 0 60px rgba(136, 201, 193, 0.3);
    }
}

.floating {
    animation: float 6s ease-in-out infinite;
}

.floating-slow {
    animation: floatSlow 8s ease-in-out infinite;
}

.pulse-glow {
    animation: pulse-glow 3s ease-in-out infinite;
}

/* ============================================
   GRADIENT BACKGROUNDS
   ============================================ */

.gradient-primary {
    background: linear-gradient(135deg, 
        rgba(46, 80, 144, 0.9) 0%, 
        rgba(136, 201, 193, 0.9) 100%);
}

.gradient-overlay {
    position: relative;
    overflow: hidden;
}

.gradient-overlay::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, 
        rgba(46, 80, 144, 0.8) 0%, 
        rgba(136, 201, 193, 0.6) 100%);
    opacity: 0;
    transition: opacity 0.4s ease;
    z-index: 1;
}

.gradient-overlay:hover::before {
    opacity: 1;
}

.gradient-overlay > * {
    position: relative;
    z-index: 2;
}

/* ============================================
   ANIMATED GRADIENTS
   ============================================ */

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

.animated-gradient {
    background: linear-gradient(
        270deg, 
        #2E5090, 
        #88C9C1, 
        #E8B4A8, 
        #2E5090
    );
    background-size: 400% 400%;
    animation: gradient-shift 15s ease infinite;
}

/* ============================================
   SHIMMER EFFECT
   ============================================ */

@keyframes shimmer {
    0% { background-position: -1000px 0; }
    100% { background-position: 1000px 0; }
}

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

.shimmer::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(
        90deg,
        transparent 0%,
        rgba(255, 255, 255, 0.3) 50%,
        transparent 100%
    );
    animation: shimmer 3s infinite;
}

/* ============================================
   3D SERVICE CARDS
   ============================================ */

.service-card-premium {
    position: relative;
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 24px;
    padding: 2.5rem;
    transition: all 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    transform-style: preserve-3d;
    overflow: hidden;
}

.service-card-premium::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(
        circle,
        rgba(136, 201, 193, 0.1) 0%,
        transparent 70%
    );
    transform: translateZ(-1px);
    opacity: 0;
    transition: opacity 0.4s ease;
}

.service-card-premium:hover::before {
    opacity: 1;
}

.service-card-premium:hover {
    transform: translateZ(30px) scale(1.05);
    box-shadow: 
        0 30px 60px rgba(46, 80, 144, 0.3),
        0 0 0 1px rgba(136, 201, 193, 0.2);
    border-color: rgba(136, 201, 193, 0.4);
}

.service-card-premium .service-icon {
    font-size: 3.5rem;
    transform: translateZ(50px);
    transition: transform 0.4s ease;
}

.service-card-premium:hover .service-icon {
    transform: translateZ(80px) rotateY(360deg);
}

/* ============================================
   PARALLAX LAYERS
   ============================================ */

.parallax-container {
    position: relative;
    overflow: hidden;
}

.parallax-layer {
    position: absolute;
    width: 100%;
    height: 100%;
    transition: transform 0.1s ease-out;
}

.parallax-layer-1 { transform: translateZ(-100px) scale(1.1); }
.parallax-layer-2 { transform: translateZ(-200px) scale(1.2); }
.parallax-layer-3 { transform: translateZ(-300px) scale(1.3); }

/* ============================================
   MORPHING BUTTONS
   ============================================ */

.btn-morph {
    position: relative;
    overflow: hidden;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

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

.btn-morph:hover::before {
    width: 300px;
    height: 300px;
}

.btn-morph:hover {
    transform: translateY(-4px) scale(1.05);
    box-shadow: 0 12px 24px rgba(46, 80, 144, 0.3);
}

/* ============================================
   LIQUID BLOB BACKGROUND
   ============================================ */

@keyframes blob-1 {
    0%, 100% { transform: translate(0, 0) scale(1); }
    33% { transform: translate(30px, -50px) scale(1.1); }
    66% { transform: translate(-20px, 20px) scale(0.9); }
}

@keyframes blob-2 {
    0%, 100% { transform: translate(0, 0) scale(1) rotate(0deg); }
    33% { transform: translate(-30px, 30px) scale(0.9) rotate(120deg); }
    66% { transform: translate(40px, -20px) scale(1.1) rotate(240deg); }
}

.blob-background {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    z-index: -1;
}

.blob {
    position: absolute;
    border-radius: 50%;
    filter: blur(60px);
    opacity: 0.3;
}

.blob-1 {
    width: 400px;
    height: 400px;
    top: -100px;
    right: -100px;
    background: linear-gradient(135deg, #88C9C1, #2E5090);
    animation: blob-1 20s ease-in-out infinite;
}

.blob-2 {
    width: 500px;
    height: 500px;
    bottom: -150px;
    left: -150px;
    background: linear-gradient(135deg, #E8B4A8, #88C9C1);
    animation: blob-2 25s ease-in-out infinite;
}

/* ============================================
   COUNTER ANIMATIONS
   ============================================ */

.counter {
    font-size: 3rem;
    font-weight: 700;
    color: var(--primary);
    display: inline-block;
    transition: transform 0.3s ease;
}

.counter:hover {
    transform: scale(1.1);
}

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

.counter.animate {
    animation: count-up 1s ease-out;
}

/* ============================================
   IMAGE GALLERY WITH HOVER ZOOM
   ============================================ */

.gallery-item {
    position: relative;
    overflow: hidden;
    border-radius: 20px;
    cursor: pointer;
    transition: all 0.4s ease;
}

.gallery-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.6s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.gallery-item:hover img {
    transform: scale(1.15);
}

.gallery-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(
        135deg,
        rgba(46, 80, 144, 0.8) 0%,
        rgba(136, 201, 193, 0.6) 100%
    );
    opacity: 0;
    transition: opacity 0.4s ease;
    z-index: 1;
}

.gallery-item:hover::before {
    opacity: 1;
}

.gallery-caption {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 2rem;
    color: white;
    transform: translateY(100%);
    transition: transform 0.4s ease;
    z-index: 2;
}

.gallery-item:hover .gallery-caption {
    transform: translateY(0);
}

/* ============================================
   SCROLL-TRIGGERED ANIMATIONS
   ============================================ */

@keyframes fade-in-up {
    from {
        opacity: 0;
        transform: translateY(50px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fade-in-left {
    from {
        opacity: 0;
        transform: translateX(-50px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes fade-in-right {
    from {
        opacity: 0;
        transform: translateX(50px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

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

.animate-on-scroll {
    opacity: 0;
}

.animate-on-scroll.animated {
    animation-duration: 0.8s;
    animation-fill-mode: both;
    animation-timing-function: cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.fade-in-up { animation-name: fade-in-up; }
.fade-in-left { animation-name: fade-in-left; }
.fade-in-right { animation-name: fade-in-right; }
.scale-in { animation-name: scale-in; }

/* Stagger animation delays */
.animate-on-scroll:nth-child(1) { animation-delay: 0.1s; }
.animate-on-scroll:nth-child(2) { animation-delay: 0.2s; }
.animate-on-scroll:nth-child(3) { animation-delay: 0.3s; }
.animate-on-scroll:nth-child(4) { animation-delay: 0.4s; }
.animate-on-scroll:nth-child(5) { animation-delay: 0.5s; }

/* ============================================
   TEXT GRADIENT ANIMATIONS
   ============================================ */

.text-gradient {
    background: linear-gradient(135deg, #2E5090, #88C9C1, #E8B4A8);
    background-size: 200% 200%;
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    animation: gradient-shift 8s ease infinite;
}

/* ============================================
   LOADING SKELETON
   ============================================ */

@keyframes skeleton-loading {
    0% { background-position: -200px 0; }
    100% { background-position: calc(200px + 100%) 0; }
}

.skeleton {
    display: inline-block;
    height: 1em;
    position: relative;
    overflow: hidden;
    background-color: #f0f0f0;
    border-radius: 4px;
}

.skeleton::after {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    background: linear-gradient(
        90deg,
        transparent,
        rgba(255, 255, 255, 0.6),
        transparent
    );
    animation: skeleton-loading 1.5s infinite;
}

/* ============================================
   MAGNETIC EFFECT
   ============================================ */

.magnetic {
    transition: transform 0.2s ease;
}

/* JavaScript will handle the magnetic movement */

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

@keyframes page-fade-in {
    from {
        opacity: 0;
        transform: scale(0.98);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.page-transition {
    animation: page-fade-in 0.6s ease-out;
}

/* ============================================
   RESPONSIVE ADJUSTMENTS
   ============================================ */

@media (max-width: 768px) {
    .card-3d:hover {
        transform: scale(1.02);
    }
    
    .service-card-premium:hover {
        transform: scale(1.03);
    }
    
    .blob-1, .blob-2 {
        display: none; /* Reduce mobile performance impact */
    }
}

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

.overflow-hidden { overflow: hidden; }
.perspective { perspective: 1000px; }
.preserve-3d { transform-style: preserve-3d; }
.backface-hidden { backface-visibility: hidden; }

