@import url('https://fonts.googleapis.com/css2?family=Nunito:wght@400;700&display=swap');

:root {
    --bg-color-1: #ffd1ff;
    --bg-color-2: #fad0c4;
    --bg-color-3: #c2e9fb;
    --card-bg: rgba(255, 255, 255, 0.4);
    --shadow-color: rgba(255, 180, 200, 0.5);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    background: linear-gradient(-45deg, var(--bg-color-1), var(--bg-color-2), var(--bg-color-3), #ffecd2);
    background-size: 400% 400%;
    animation: gradientBG 15s ease infinite;
    min-height: 100vh;
    font-family: 'Nunito', sans-serif;
    overflow-x: hidden;
    position: relative;
    padding: 2rem;
    display: flex;
    justify-content: center;
}

/* Background Animation */
@keyframes gradientBG {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

.gallery-container {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    gap: 3rem;
    width: 100%;
    max-width: 1400px;
    z-index: 2;
    position: relative;
    padding: 2rem 0;
}

.image-card {
    display: block;
    width: 100%;
    max-width: 600px; /* To hơn */
    border-radius: 24px;
    overflow: hidden;
    position: relative;
    box-shadow: 0 10px 30px var(--shadow-color);
    background: var(--card-bg);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 3px solid rgba(255, 255, 255, 0.8);
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    cursor: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="%23ff6b81" stroke="%23fff" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M20.84 4.61a5.5 5.5 0 0 0-7.78 0L12 5.67l-1.06-1.06a5.5 5.5 0 0 0-7.78 7.78l1.06 1.06L12 21.23l7.78-7.78 1.06-1.06a5.5 5.5 0 0 0 0-7.78z"></path></svg>'), auto;
    animation: fadeIn 1s ease both;
}

/* Staggered animation */
.image-card:nth-child(1) { animation-delay: 0.1s; }
.image-card:nth-child(2) { animation-delay: 0.2s; }
.image-card:nth-child(3) { animation-delay: 0.3s; }
.image-card:nth-child(4) { animation-delay: 0.4s; }
.image-card:nth-child(5) { animation-delay: 0.5s; }
.image-card:nth-child(6) { animation-delay: 0.6s; }

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(30px) scale(0.9);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.image-card::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 50%;
    height: 100%;
    background: linear-gradient(
        to right,
        rgba(255, 255, 255, 0) 0%,
        rgba(255, 255, 255, 0.4) 50%,
        rgba(255, 255, 255, 0) 100%
    );
    transform: skewX(-20deg);
    transition: left 0.7s ease;
}

.image-card img {
    width: 100%;
    height: auto;
    display: block;
    transition: transform 0.4s ease;
    border-radius: 20px;
}

.image-card:hover {
    transform: translateY(-10px) scale(1.02) rotate(1deg);
    box-shadow: 0 15px 40px rgba(255, 107, 129, 0.4);
    border-color: #fff;
}

.image-card:hover::after {
    left: 150%;
}

.image-card:hover img {
    transform: scale(1.05);
}

/* Floating Cute Elements Container */
.bg-shapes {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    z-index: 1;
    pointer-events: none;
}

.shape {
    position: absolute;
    filter: drop-shadow(0 0 10px rgba(255, 255, 255, 0.8));
    animation: floatUp linear infinite;
    opacity: 0;
}

@keyframes floatUp {
    0% {
        transform: translateY(100vh) scale(0) rotate(0deg);
        opacity: 0;
    }
    10% {
        opacity: 0.8;
    }
    90% {
        opacity: 0.8;
    }
    100% {
        transform: translateY(-100px) scale(1) rotate(360deg);
        opacity: 0;
    }
}

/* Flying Hearts on Click */
.flying-heart-container {
    position: fixed;
    pointer-events: none;
    z-index: 9999;
    animation: flyUpHeart 1.5s ease-out forwards;
    filter: drop-shadow(0 0 5px rgba(255, 154, 158, 0.8));
}

@keyframes flyUpHeart {
    0% {
        opacity: 1;
        transform: translate(0, 0) scale(0.5);
    }
    50% {
        opacity: 1;
        transform: translate(calc(var(--tx) * 0.5), -100px) scale(1.2);
    }
    100% {
        opacity: 0;
        transform: translate(var(--tx), -200px) scale(1);
    }
}

/* Cute Heart Counter */
.heart-counter {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    background: rgba(255, 255, 255, 0.6);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 3px solid rgba(255, 255, 255, 0.9);
    padding: 0.8rem 1.5rem;
    border-radius: 50px;
    box-shadow: 0 10px 20px rgba(255, 180, 200, 0.4);
    display: flex;
    align-items: center;
    gap: 10px;
    z-index: 100;
    transition: transform 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    font-size: 1.5rem;
    font-weight: 700;
    color: #ff6b81;
    user-select: none;
    animation: fadeIn 2s ease forwards;
}

.heart-counter:hover {
    transform: scale(1.1) rotate(5deg);
}

.heart-counter.pop {
    animation: pop 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
}

@keyframes pop {
    0% { transform: scale(1); }
    50% { transform: scale(1.2) rotate(-5deg); }
    100% { transform: scale(1); }
}
