/* Rainbow Bridge Memorial Garden - Advanced 3D Styling */

/* Import elegant fonts */
@import url('https://fonts.googleapis.com/css2?family=Cinzel:wght@400;600&family=Playfair+Display:wght@700&family=Crimson+Text:ital@1&display=swap');

/* Page Container with Full Background */
.memorial-garden {
    min-height: 100vh;
    position: relative;
    overflow-x: hidden;
    background: #E8F4F8;
    width: 100%;
    margin: 0;
    padding: 0;
}

/* Main Garden Background Layer */
.sky-background {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    pointer-events: none;
    background: url('../images/memorial_background.png') center center no-repeat;
    background-size: cover;
    background-attachment: fixed;
}

/* Responsive background sizing */
@media (min-aspect-ratio: 16/9) {
    .sky-background {
        background-size: cover;
    }
}

/* Floating Clouds Layer (overlay for movement) */
.clouds {
    position: absolute;
    width: 100%;
    height: 60%;
    top: 0;
    background: radial-gradient(ellipse 400px 150px at 30% 20%, rgba(255, 255, 255, 0.3) 0%, transparent 100%),
        radial-gradient(ellipse 350px 120px at 70% 30%, rgba(255, 255, 255, 0.25) 0%, transparent 100%),
        radial-gradient(ellipse 300px 100px at 50% 40%, rgba(255, 255, 255, 0.2) 0%, transparent 100%);
    animation: cloudDrift 120s linear infinite;
    opacity: 0.7;
}

@keyframes cloudDrift {
    0% {
        transform: translateX(0);
    }

    100% {
        transform: translateX(-100px);
    }
}

/* Beautiful Rainbow Arc with Multiple Layers */
.rainbow {
    position: fixed;
    top: 5%;
    left: 50%;
    transform: translateX(-50%);
    width: 80%;
    max-width: 1400px;
    height: 300px;
    pointer-events: none;
    z-index: 1;
}

/* Create rainbow using multiple arc layers */
.rainbow::before,
.rainbow::after {
    content: '';
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    border-radius: 50% 50% 0 0 / 100% 100% 0 0;
}

/* Outer rainbow arc */
.rainbow::before {
    height: 100%;
    background: linear-gradient(to right,
            rgba(255, 0, 0, 0.25) 0%,
            rgba(255, 127, 0, 0.25) 14.28%,
            rgba(255, 255, 0, 0.25) 28.56%,
            rgba(0, 255, 0, 0.25) 42.84%,
            rgba(0, 191, 255, 0.25) 57.12%,
            rgba(0, 0, 255, 0.25) 71.4%,
            rgba(139, 0, 255, 0.25) 85.68%,
            rgba(255, 0, 255, 0.25) 100%);
    filter: blur(2px);
    animation: rainbowPulse 8s ease-in-out infinite;
}

/* Inner rainbow arc (creates depth) */
.rainbow::after {
    height: 85%;
    background: linear-gradient(to right,
            rgba(255, 100, 100, 0.18) 0%,
            rgba(255, 180, 100, 0.18) 14.28%,
            rgba(255, 255, 150, 0.18) 28.56%,
            rgba(150, 255, 150, 0.18) 42.84%,
            rgba(150, 220, 255, 0.18) 57.12%,
            rgba(150, 150, 255, 0.18) 71.4%,
            rgba(200, 150, 255, 0.18) 85.68%,
            rgba(255, 150, 255, 0.18) 100%);
    filter: blur(1px);
    animation: rainbowPulse 8s ease-in-out infinite 0.5s;
}

@keyframes rainbowPulse {

    0%,
    100% {
        opacity: 0.35;
        transform: scaleY(1);
    }

    50% {
        opacity: 0.55;
        transform: scaleY(1.02);
    }
}

/* Twinkling Stars */
.stars {
    position: absolute;
    width: 100%;
    height: 100%;
}

.star {
    position: absolute;
    width: 3px;
    height: 3px;
    background: white;
    border-radius: 50%;
    box-shadow: 0 0 10px rgba(255, 255, 255, 0.8);
    animation: twinkle 3s ease-in-out infinite;
}

@keyframes twinkle {

    0%,
    100% {
        opacity: 0.3;
        transform: scale(1);
    }

    50% {
        opacity: 1;
        transform: scale(1.5);
    }
}

/* Memorial Search Bar */
.memorial-search-container {
    position: relative;
    z-index: 10;
    max-width: 600px;
    margin: 0 auto 30px;
    padding: 0 20px;
}

.memorial-search {
    width: 100%;
    padding: 14px 50px 14px 20px;
    border: 2px solid rgba(155, 126, 189, 0.3);
    border-radius: 30px;
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(10px);
    font-size: 15px;
    font-family: 'Crimson Text', serif;
    color: #5A5A5A;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(155, 126, 189, 0.2);
}

.memorial-search:focus {
    outline: none;
    border-color: rgba(155, 126, 189, 0.6);
    background: rgba(255, 255, 255, 0.95);
    box-shadow: 0 6px 20px rgba(155, 126, 189, 0.3);
}

.memorial-search::placeholder {
    color: #9B7EBD;
    font-style: italic;
}

.search-icon {
    position: absolute;
    right: 35px;
    top: 50%;
    transform: translateY(-50%);
    color: #9B7EBD;
    font-size: 18px;
    pointer-events: none;
}

.search-loading {
    position: absolute;
    right: 35px;
    top: 50%;
    transform: translateY(-50%);
    display: none;
}

.search-loading.active {
    display: block;
}


/* Garden Header */
.garden-header {
    position: relative;
    z-index: 10;
    text-align: center;
    padding: 60px 20px 40px;
}

.garden-header h1 {
    font-family: 'Cinzel', serif;
    font-size: 48px;
    color: #5A5A5A;
    margin-bottom: 15px;
    text-shadow: 0 2px 10px rgba(255, 255, 255, 0.8);
    animation: gentleGlow 3s ease-in-out infinite;
}

.garden-header p {
    font-family: 'Crimson Text', serif;
    font-style: italic;
    font-size: 20px;
    color: #7A7A7A;
}

@keyframes gentleGlow {

    0%,
    100% {
        text-shadow: 0 2px 10px rgba(255, 255, 255, 0.8);
    }

    50% {
        text-shadow: 0 2px 20px rgba(155, 126, 189, 0.6);
    }
}

/* Memorial Grid */
.memorial-grid {
    position: relative;
    z-index: 10;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 40px;
    padding: 40px 60px 200px;
    max-width: 100%;
    width: 100%;
    margin: 0;
    box-sizing: border-box;
}

/* Individual Memorial Stone with 3D Effects */
.memorial-stone {
    position: relative;
    height: auto;
    min-height: 520px;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    perspective: 1000px;
}

.memorial-stone:hover {
    transform: translateY(-8px);
}

.stone-3d {
    position: relative;
    width: 100%;
    height: 100%;
    background: linear-gradient(145deg, rgba(245, 245, 245, 0.85), rgba(232, 232, 232, 0.75));
    backdrop-filter: blur(10px);
    border-radius: 15px;
    padding: 25px 20px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15),
        inset 0 1px 0 rgba(255, 255, 255, 0.6),
        inset 0 -1px 0 rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
    border: 2px solid rgba(211, 211, 211, 0.5);
    overflow: hidden;
}

/* Smooth shine overlay */
.stone-3d::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg,
            transparent 0%,
            rgba(255, 255, 255, 0) 20%,
            rgba(255, 255, 255, 0.3) 50%,
            rgba(255, 255, 255, 0) 80%,
            transparent 100%);
    animation: smoothShine 4s ease-in-out infinite;
    pointer-events: none;
}

@keyframes smoothShine {
    0% {
        left: -100%;
        opacity: 0;
    }

    20% {
        opacity: 1;
    }

    80% {
        opacity: 1;
    }

    100% {
        left: 100%;
        opacity: 0;
    }
}

.memorial-stone:hover .stone-3d {
    box-shadow: 0 15px 40px rgba(155, 126, 189, 0.4),
        0 0 30px rgba(155, 126, 189, 0.2),
        inset 0 1px 0 rgba(255, 255, 255, 0.8),
        inset 0 -1px 0 rgba(0, 0, 0, 0.1);
    border-color: rgba(155, 126, 189, 0.6);
    background: linear-gradient(145deg, rgba(245, 245, 245, 0.9), rgba(232, 232, 232, 0.8));
}

/* Angel Icon */
.angel-icon {
    font-size: 40px;
    text-align: center;
    margin-bottom: 20px;
    filter: drop-shadow(0 0 15px rgba(255, 255, 255, 0.9));
    animation: angelFloat 4s ease-in-out infinite;
}

@keyframes angelFloat {

    0%,
    100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-10px);
    }
}

/* Cat Photo Memorial */
.cat-photo-memorial {
    position: relative;
    width: 150px;
    height: 150px;
    margin: 0 auto 20px;
    border-radius: 50%;
    overflow: visible;
}

.cat-photo-memorial img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
    border: 4px solid #FFD700;
    filter: sepia(30%) grayscale(40%);
    box-shadow: 0 0 20px rgba(255, 215, 0, 0.4);
    transition: all 0.3s ease;
}

.memorial-stone:hover .cat-photo-memorial img {
    filter: sepia(0%) grayscale(0%);
    transform: scale(1.05);
    box-shadow: 0 0 30px rgba(255, 215, 0, 0.6);
}

/* Halo Effect - Always Animated */
.halo {
    position: absolute;
    top: -15px;
    left: 50%;
    transform: translateX(-50%);
    width: 160px;
    height: 30px;
    border: 3px solid #FFD700;
    border-radius: 50%;
    opacity: 0.7;
    box-shadow: 0 0 15px rgba(255, 215, 0, 0.6),
        0 0 25px rgba(255, 215, 0, 0.4),
        inset 0 0 10px rgba(255, 215, 0, 0.3);
    animation: haloGlow 2s ease-in-out infinite, haloFloat 3s ease-in-out infinite;
}

@keyframes haloGlow {

    0%,
    100% {
        opacity: 0.7;
        box-shadow: 0 0 15px rgba(255, 215, 0, 0.6),
            0 0 25px rgba(255, 215, 0, 0.4),
            inset 0 0 10px rgba(255, 215, 0, 0.3);
    }

    50% {
        opacity: 1;
        box-shadow: 0 0 25px rgba(255, 215, 0, 0.8),
            0 0 40px rgba(255, 215, 0, 0.6),
            inset 0 0 15px rgba(255, 215, 0, 0.5);
    }
}

@keyframes haloFloat {

    0%,
    100% {
        transform: translateX(-50%) translateY(0);
    }

    50% {
        transform: translateX(-50%) translateY(-3px);
    }
}

.memorial-stone:hover .halo {
    opacity: 1;
    animation: haloGlow 1s ease-in-out infinite, haloFloat 2s ease-in-out infinite;
}

/* Gravestone Text */
.gravestone-text {
    text-align: center;
    margin-bottom: 15px;
    padding: 12px;
    background: rgba(255, 255, 255, 0.3);
    border-radius: 8px;
    border: 1px solid #D3D3D3;
}

.cat-name {
    font-family: 'Playfair Display', serif;
    font-size: 24px;
    font-weight: 700;
    color: #4A4A4A;
    margin-bottom: 5px;
    text-shadow: 1px 1px 2px rgba(255, 255, 255, 0.8);
}

.dates {
    font-family: 'Georgia', serif;
    font-style: italic;
    font-size: 14px;
    color: #6A6A6A;
    margin: 0;
}

.owner-name {
    font-size: 12px;
    color: #888;
    margin-top: 5px;
}

/* Memorial Message */
.memorial-message {
    font-family: 'Crimson Text', serif;
    font-style: italic;
    font-size: 14px;
    line-height: 1.6;
    color: #5A5A5A;
    text-align: center;
    padding: 12px;
    background: rgba(255, 255, 255, 0.4);
    border-radius: 8px;
    margin-bottom: 15px;
    min-height: 60px;
    max-height: 100px;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 4;
    line-clamp: 4;
    -webkit-box-orient: vertical;
}

/* Memorial Decorations */
.memorial-decorations {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 15px;
    margin: 20px 0;
}

/* Candles with Flame Animation */
.candle {
    font-size: 32px;
    position: relative;
    animation: candleFlicker 2s ease-in-out infinite;
    filter: drop-shadow(0 0 10px rgba(255, 165, 0, 0.8));
}

.candle.left {
    animation-delay: 0s;
}

.candle.right {
    animation-delay: 1s;
}

@keyframes candleFlicker {

    0%,
    100% {
        transform: scale(1);
        filter: drop-shadow(0 0 10px rgba(255, 165, 0, 0.8)) brightness(1);
    }

    25% {
        transform: scale(1.05) translateY(-2px);
        filter: drop-shadow(0 0 15px rgba(255, 140, 0, 1)) brightness(1.2);
    }

    50% {
        transform: scale(0.98);
        filter: drop-shadow(0 0 8px rgba(255, 165, 0, 0.6)) brightness(0.9);
    }

    75% {
        transform: scale(1.03) translateY(-1px);
        filter: drop-shadow(0 0 12px rgba(255, 140, 0, 0.9)) brightness(1.1);
    }
}

/* Flowers with Sway Animation */
.flowers {
    font-size: 28px;
    animation: flowerSway 3s ease-in-out infinite;
    transform-origin: bottom center;
}

@keyframes flowerSway {

    0%,
    100% {
        transform: rotate(0deg);
    }

    25% {
        transform: rotate(-3deg);
    }

    75% {
        transform: rotate(3deg);
    }
}

/* View Profile Button */
.view-profile-btn {
    display: block;
    text-align: center;
    padding: 12px 25px;
    background: linear-gradient(135deg, #9B7EBD, #D0C9E8);
    color: white;
    text-decoration: none;
    border-radius: 25px;
    font-weight: 600;
    font-size: 14px;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(155, 126, 189, 0.3);
}

.view-profile-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(155, 126, 189, 0.5);
    background: linear-gradient(135deg, #8B6EAD, #C0B9D8);
    color: white;
}

/* Loading Spinner */
.loading-spinner {
    text-align: center;
    padding: 40px 20px;
    position: relative;
    z-index: 10;
    display: none;
}

.loading-spinner.active {
    display: block;
}

.spinner {
    display: inline-block;
    width: 50px;
    height: 50px;
    border: 4px solid rgba(155, 126, 189, 0.2);
    border-top-color: #9B7EBD;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

.loading-text {
    margin-top: 15px;
    font-family: 'Crimson Text', serif;
    font-style: italic;
    color: #9B7EBD;
    font-size: 16px;
}

/* Grass Floor with Seamless Tile */
.grass-floor {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 180px;
    background: url('../images/memorial_grass_tile.png') repeat-x bottom center;
    background-size: auto 180px;
    z-index: 5;
    pointer-events: none;
}

.grass-floor::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 60px;
    background: linear-gradient(180deg, rgba(232, 244, 248, 0) 0%, rgba(232, 244, 248, 0.3) 50%, transparent 100%);
}

/* Particles Container */
.particles-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 15;
    overflow: hidden;
}

/* Falling Particles */
.particle {
    position: absolute;
    animation: particleFall linear infinite;
    opacity: 0.7;
}

.particle.feather {
    font-size: 20px;
    animation-duration: 15s;
}

.particle.petal {
    font-size: 16px;
    animation-duration: 12s;
}

.particle.sparkle {
    font-size: 12px;
    animation-duration: 8s;
}

@keyframes particleFall {
    0% {
        transform: translateY(-100px) rotate(0deg);
        opacity: 0;
    }

    10% {
        opacity: 0.7;
    }

    90% {
        opacity: 0.7;
    }

    100% {
        transform: translateY(100vh) rotate(360deg);
        opacity: 0;
    }
}

/* Empty State */
.no-memorials {
    text-align: center;
    padding: 100px 20px;
    color: #7A7A7A;
}

.no-memorials i {
    font-size: 80px;
    color: #9B7EBD;
    margin-bottom: 20px;
    opacity: 0.5;
}

/* Responsive Design */
@media (max-width: 768px) {
    .garden-header h1 {
        font-size: 32px;
    }

    .memorial-grid {
        grid-template-columns: 1fr;
        gap: 40px;
        padding: 20px;
    }

    .memorial-stone {
        height: auto;
        min-height: 520px;
    }

    .cat-photo-memorial {
        width: 150px;
        height: 150px;
    }

    .cat-name {
        font-size: 24px;
    }
}

/* Print Styles */
@media print {

    .sky-background,
    .particles-container,
    .grass-floor {
        display: none;
    }

    .memorial-stone {
        page-break-inside: avoid;
    }
}