/**
 * PārthaOS App Theme - UI & Animations (Advanced Systems Edition v5.0)
 * Handles haptic squish (Neumorphic), desktop hover physics (Claymorphic), 
 * shimmer loading, and bouncy spring reveals.
 */

/* ==========================================================================
   1. HAPTIC SQUISH (NEUMORPHIC TOUCH FEEDBACK)
   ========================================================================== */
a, button, .swipe-card, .article-card, .philosophy-card, .direct-link-card, .package-card {
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
}

/* Deep, snappy squish for buttons, nav items, and profile triggers */
.btn-primary, .btn-secondary, .nav-item, .profile-trigger, .action-btn, .header-portfolio-btn {
    transition: transform 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275), box-shadow 0.2s;
}

.btn-primary:active, 
.btn-secondary:active,
.nav-item:active,
.profile-trigger:active,
.action-btn:active,
.header-portfolio-btn:active {
    transform: scale(0.92);
    transition: transform 0.1s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Clay Card tap interactions (Presses into the canvas) */
.swipe-card:active, .article-card:active, .philosophy-card:active, .package-card:active, .ig-grid-item:active {
    transform: scale(0.96);
    /* Inverts the 3D extrusion to an inset shadow */
    box-shadow: inset 6px 6px 12px rgba(166, 180, 200, 0.5), inset -6px -6px 12px rgba(255, 255, 255, 0.9) !important;
    border-color: transparent; 
    transition: transform 0.1s, box-shadow 0.1s;
}

/* ==========================================================================
   2. DESKTOP HOVER PHYSICS (CLAY EXTRUSION)
   ========================================================================== */
/* Applied only on desktop to prevent sticky-hover bugs on touch devices */
@media (min-width: 768px) {
    .swipe-card, .article-card, .philosophy-card, .package-card, .ig-grid-item {
        transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275), box-shadow 0.4s;
    }
    
    .swipe-card:hover, .article-card:hover, .philosophy-card:hover, .package-card:hover {
        transform: translateY(-8px); /* Card lifts up */
        /* Amplified Clay Extrusion */
        box-shadow: 15px 15px 35px rgba(166, 180, 200, 0.5), -15px -15px 35px rgba(255, 255, 255, 1), inset 2px 2px 5px rgba(255, 255, 255, 1) !important;
    }
}

/* ==========================================================================
   3. SKELETON SHIMMER (API / DATA LOADING STATES)
   ========================================================================== */
@keyframes shimmerWave {
    0% { background-position: -1000px 0; }
    100% { background-position: 1000px 0; }
}

.shimmer-active {
    position: relative;
    overflow: hidden;
    background-color: #f0f3f8; /* Clay Base */
}

.shimmer-active::before {
    content: '';
    position: absolute;
    top: 0; left: 0; width: 100%; height: 100%;
    /* Bright white glass wave moving over the clay card */
    background: linear-gradient(
        to right, 
        rgba(240, 243, 248, 0) 0%, 
        rgba(255, 255, 255, 0.8) 50%, 
        rgba(240, 243, 248, 0) 100%
    );
    background-size: 1000px 100%;
    animation: shimmerWave 2s infinite linear;
    z-index: 10;
    pointer-events: none;
    border-radius: inherit;
}

/* ==========================================================================
   4. INSTAMART SPLASH SCREEN POP
   ========================================================================== */
@keyframes splashPop {
    0% { transform: scale(0.8); opacity: 0; }
    50% { transform: scale(1.15); opacity: 1; }
    100% { transform: scale(1); opacity: 1; }
}

.splash-logo img {
    /* Fast pop, slight over-scale, then settle */
    animation: splashPop 0.6s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
}

/* ==========================================================================
   5. HORIZONTAL SWIPE ENHANCEMENTS (CLAY BLENDS)
   ========================================================================== */
.swipe-grid-container {
    -webkit-overflow-scrolling: touch;
    scroll-behavior: smooth;
    transform: translateZ(0); 
    will-change: transform;
}

/* Clay fade mask to indicate more scrollable content (Mobile Only) */
@media (max-width: 767px) {
    .swipe-grid-wrapper { position: relative; }
    .swipe-grid-wrapper::after {
        content: '';
        position: absolute; top: 0; right: 0; width: 40px; height: 100%;
        /* Blends into the #f4f6f9 app background */
        background: linear-gradient(to right, rgba(244, 246, 249, 0), rgba(244, 246, 249, 1));
        pointer-events: none; z-index: 5;
    }
}

/* ==========================================================================
   6. BOUNCY ENTRANCE ANIMATIONS (SCROLL REVEALS)
   ========================================================================== */
.scroll-trigger {
    opacity: 0;
    transform: translateY(40px) scale(0.95);
    /* The cubic-bezier here creates the "spring" bounce effect */
    transition: opacity 0.5s ease-out, transform 0.7s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    will-change: opacity, transform;
}

.scroll-trigger.is-visible {
    opacity: 1;
    transform: translateY(0) scale(1);
}

/* Staggered delays for child elements in grids */
.delay-1 { transition-delay: 100ms; }
.delay-2 { transition-delay: 200ms; }
.delay-3 { transition-delay: 300ms; }
.delay-4 { transition-delay: 400ms; }
.delay-5 { transition-delay: 500ms; }

/* ==========================================================================
   7. MODAL & DRAWER TRANSITION REFINEMENTS (GLASS 2.0)
   ========================================================================== */
/* Profile Drawer cinematic background blur */
.drawer-overlay.active {
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    background: rgba(10, 15, 25, 0.4); /* Dark tinted glass */
}

/* Video Modal bouncy entrance */
#native-video-modal .modal-video-wrapper {
    transform: scale(0.85) translateY(40px);
    transition: transform 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

#native-video-modal.active .modal-video-wrapper {
    transform: scale(1) translateY(0);
}