/**
 * Amazing Sri Lanka Tours - Animations & Visual Effects
 * Reference UI Diamond photo compositions, organic wave masks, and GSAP support
 */

/* ==========================================================================
   1. Signature Diamond / Rhombus Photo Grid
   ========================================================================== */
.diamond-composition {
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 40px 0;
}

.diamond-frame {
    position: relative;
    width: 220px;
    height: 220px;
    margin: 15px;
    transform: rotate(45deg);
    overflow: hidden;
    border-radius: 20px;
    border: 2px solid rgba(41, 182, 200, 0.3);
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.5);
    background: var(--bg-deep);
    transition: transform 0.5s cubic-bezier(0.16, 1, 0.3, 1), border-color 0.4s ease, box-shadow 0.4s ease;
}

@media (hover: hover) and (pointer: fine) {
    .diamond-frame:hover {
        transform: rotate(45deg) scale(1.05);
        border-color: var(--accent-gold);
        box-shadow: 0 20px 45px rgba(0, 0, 0, 0.6), var(--shadow-glow-gold);
        z-index: 5;
    }

    .diamond-frame:hover .diamond-img {
        transform: rotate(-45deg) scale(1.12);
    }

    .diamond-frame:hover .diamond-overlay {
        opacity: 0.2;
    }
}

/* Pulsing Decorative Map Nodes */
.map-node-pulse {
    position: absolute;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: var(--accent-turquoise);
    box-shadow: 0 0 12px var(--accent-turquoise);
}

.map-node-pulse::after {
    content: '';
    position: absolute;
    inset: -6px;
    border-radius: 50%;
    border: 1px solid var(--accent-turquoise);
    animation: pulseRing 2s cubic-bezier(0.215, 0.61, 0.355, 1) infinite;
}

@keyframes pulseRing {
    0% { transform: scale(0.5); opacity: 0.9; }
    50% { transform: scale(1.5); opacity: 0.3; }
    100% { transform: scale(2.2); opacity: 0; }
}

/* Dashed Route Connectors */
.route-connector-line {
    position: absolute;
    stroke: rgba(41, 182, 200, 0.35);
    stroke-dasharray: 4 6;
    animation: dashOffset 20s linear infinite;
    pointer-events: none;
}

@keyframes dashOffset {
    to { stroke-dashoffset: -100; }
}

/* ==========================================================================
   2. Curved Wave Section Masks
   ========================================================================== */
.wave-transition {
    position: relative;
    width: 100%;
    line-height: 0;
    overflow: hidden;
    z-index: 2;
}

.wave-transition svg {
    position: relative;
    display: block;
    width: calc(100% + 1.3px);
    height: 70px;
}

.wave-to-deep path {
    fill: var(--bg-deep);
}

.wave-to-primary path {
    fill: var(--bg-primary);
}

.wave-to-secondary path {
    fill: var(--bg-secondary);
}

/* ==========================================================================
   3. Floating UI Card Micro-Animations
   ========================================================================== */
.floating-mini-card {
    position: absolute;
    background: rgba(6, 43, 58, 0.75);
    border: 1px solid rgba(41, 182, 200, 0.25);
    border-radius: var(--radius-md);
    padding: 14px 18px;
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    box-shadow: var(--shadow-lg);
    display: flex;
    align-items: center;
    gap: 14px;
    z-index: 10;
    animation: floatGentle 5s ease-in-out infinite alternate;
}

@keyframes floatGentle {
    0% { transform: translateY(0px); }
    100% { transform: translateY(-12px); }
}

.floating-mini-card.delayed {
    animation-delay: 2.5s;
}

/* ==========================================================================
   4. Staggered Gallery Overlap Cards
   ========================================================================== */
.staggered-card-gallery {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 480px;
}

.gallery-card-item {
    position: absolute;
    width: 210px;
    height: 310px;
    border-radius: var(--radius-lg);
    overflow: hidden;
    border: 2px solid rgba(255, 255, 255, 0.15);
    box-shadow: var(--shadow-lg);
    transition: transform 0.5s cubic-bezier(0.16, 1, 0.3, 1), z-index 0.3s ease;
}

.gallery-card-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.gallery-card-item.card-1 {
    transform: translateX(-110px) rotate(-6deg) scale(0.92);
    z-index: 1;
}

.gallery-card-item.card-2 {
    transform: translateX(0px) rotate(0deg) scale(1);
    z-index: 2;
    border-color: var(--accent-turquoise);
    box-shadow: var(--shadow-lg), var(--shadow-glow-turquoise);
}

.gallery-card-item.card-3 {
    transform: translateX(110px) rotate(6deg) scale(0.92);
    z-index: 1;
}

@media (hover: hover) and (pointer: fine) {
    .staggered-card-gallery:hover .gallery-card-item.card-1 {
        transform: translateX(-130px) rotate(-10deg) scale(0.94);
    }

    .staggered-card-gallery:hover .gallery-card-item.card-2 {
        transform: translateY(-10px) scale(1.04);
    }

    .staggered-card-gallery:hover .gallery-card-item.card-3 {
        transform: translateX(130px) rotate(10deg) scale(0.94);
    }
}

/* ==========================================================================
   5. Accessibility & Reduced Motion
   ========================================================================== */
@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;
    }
    
    .floating-mini-card,
    .map-node-pulse::after,
    .route-connector-line {
        animation: none !important;
    }

    .diamond-frame,
    .diamond-img,
    .tour-card,
    .tour-card-img {
        transform: none !important;
        transition: none !important;
    }
}
