/* ==========================================================================
   AQUARIUM UNDERWATER TANK AMBIENCE SYSTEM - PHOTOREALISTIC EDITION
   ========================================================================== */

#aquarium-tank-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    pointer-events: none;
    z-index: 0;
    overflow: hidden;
    /* High resolution realistic aquascape backdrop */
    background: url('../img/aquarium-tank-bg.jpg') no-repeat center center fixed;
    background-size: cover;
}

/* Semi-transparent aquatic ambient tint over backdrop to ensure high contrast for text */
#aquarium-tank-container::after {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle at 50% 45%, 
        rgba(255, 255, 255, 0.40) 0%, 
        rgba(230, 245, 255, 0.30) 45%, 
        rgba(10, 35, 60, 0.25) 100%);
    pointer-events: none;
}

body {
    background-color: transparent !important;
    position: relative;
}

#header-placeholder, 
.container, 
.container-fluid, 
.modal, 
footer {
    position: relative;
    z-index: 2;
}

/* Frosted glass effect on content containers so the realistic aquarium is visible behind while text remains crisp */
.card, 
.bg-light, 
.fruite-item {
    background-color: rgba(255, 255, 255, 0.90) !important;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border: 1px solid rgba(255, 255, 255, 0.5) !important;
    box-shadow: 0 8px 32px 0 rgba(0, 30, 60, 0.12) !important;
}

/* Top Water Caustics Shimmer */
.tank-water-shimmer {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 180px;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.6) 0%, rgba(255, 255, 255, 0) 100%);
    opacity: 0.55;
    animation: waterShimmer 7s ease-in-out infinite alternate;
}

@keyframes waterShimmer {
    0% { opacity: 0.3; transform: scaleY(1); }
    100% { opacity: 0.65; transform: scaleY(1.2); }
}

/* Rising Air Bubbles */
.tank-bubbles-layer {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
}

.tank-bubble {
    position: absolute;
    bottom: -30px;
    background: radial-gradient(circle at 35% 35%, rgba(255, 255, 255, 0.95), rgba(180, 230, 255, 0.4) 55%, rgba(60, 180, 240, 0.75) 100%);
    border-radius: 50%;
    box-shadow: 0 0 6px rgba(255, 255, 255, 0.9), inset 0 0 4px rgba(255, 255, 255, 0.95);
    animation: riseBubble linear infinite;
}

@keyframes riseBubble {
    0% {
        transform: translateY(0) translateX(0) scale(0.8);
        opacity: 0;
    }
    10% {
        opacity: 0.8;
    }
    50% {
        transform: translateY(-50vh) translateX(var(--drift)) scale(1.05);
        opacity: 0.9;
    }
    90% {
        opacity: 0.75;
    }
    100% {
        transform: translateY(-105vh) translateX(calc(var(--drift) * -1)) scale(1.2);
        opacity: 0;
    }
}

/* Swimming Fish Fleet */
.tank-fish-layer {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
}

.tank-swimming-fish {
    position: absolute;
    filter: drop-shadow(0 6px 16px rgba(0, 20, 50, 0.35));
    transition: opacity 0.5s ease;
}

/* Left-to-Right Swimmers (all images naturally face LEFT, so flip with scaleX(-1) so head leads forward to the right) */
.tank-swimming-fish.dir-left-to-right {
    left: -220px;
    animation: swimLeftToRight linear infinite;
}

@keyframes swimLeftToRight {
    0% {
        left: -220px;
        transform: scale(var(--scale, 1.0)) scaleX(-1) translateY(0) rotate(-1deg);
    }
    25% {
        transform: scale(var(--scale, 1.0)) scaleX(-1) translateY(-18px) rotate(1deg);
    }
    50% {
        transform: scale(var(--scale, 1.0)) scaleX(-1) translateY(12px) rotate(-1.5deg);
    }
    75% {
        transform: scale(var(--scale, 1.0)) scaleX(-1) translateY(-14px) rotate(0.5deg);
    }
    100% {
        left: calc(100vw + 220px);
        transform: scale(var(--scale, 1.0)) scaleX(-1) translateY(4px) rotate(-1deg);
    }
}

/* Right-to-Left Swimmers (heads naturally face left, so no horizontal flip needed) */
.tank-swimming-fish.dir-right-to-left {
    right: -220px;
    animation: swimRightToLeft linear infinite;
}

@keyframes swimRightToLeft {
    0% {
        right: -220px;
        transform: scale(var(--scale, 1.0)) translateY(0) rotate(1deg);
    }
    30% {
        transform: scale(var(--scale, 1.0)) translateY(16px) rotate(-1.5deg);
    }
    70% {
        transform: scale(var(--scale, 1.0)) translateY(-14px) rotate(1.5deg);
    }
    100% {
        right: calc(100vw + 220px);
        transform: scale(var(--scale, 1.0)) translateY(0) rotate(0deg);
    }
}

/* Bottom Botanical Corner Foliage (Subtle depth framing) */
.tank-plants-layer {
    display: none; /* The photorealistic background already includes lush botanicals along sides and bottom */
}
