/* Album foto styles */
.photo-album {
    padding: 20px;
    margin-top: 50px; /* Increased top margin */
    margin-bottom: 40px;
    opacity: 0;
    max-height: 0;
    overflow: hidden;
    transition: opacity 1s, max-height 1s, margin 1s;
    text-align: center;
    background: linear-gradient(to bottom, rgba(255, 249, 251, 0.7), rgba(245, 245, 255, 0.7));
    border-radius: 20px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.08);
    width: 100%;
    max-width: 1200px;
    margin-left: auto;
    margin-right: auto;
    position: relative; /* Ensure proper stacking context */
    z-index: 5; /* Ensure visibility */
}

.photo-album.show {
    opacity: 1;
    max-height: 2000px;
    margin-top: 40px;
}

.photo-album h3 {
    font-family: 'Dancing Script', cursive;
    font-size: 2.2rem;
    margin-bottom: 20px;
    color: #ff6b8b;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.1);
}

.photo-album-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 15px;
    margin: 0 auto;
    max-width: 900px;
}

.photo-item {
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
    position: relative;
    transition: transform 0.3s, box-shadow 0.3s;
    cursor: pointer;
    height: 0;
    padding-bottom: 100%; /* Membuat gambar persegi */
}

.photo-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

.photo-item img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s;
}

.photo-item:hover img {
    transform: scale(1.1);
}

.photo-caption {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(transparent, rgba(0,0,0,0.7));
    color: white;
    padding: 15px 10px 10px;
    font-size: 0.9rem;
    opacity: 0;
    transform: translateY(10px);
    transition: opacity 0.3s, transform 0.3s;
}

.photo-item:hover .photo-caption {
    opacity: 1;
    transform: translateY(0);
}

/* Animasi muncul */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.photo-item {
    animation: fadeInUp 0.6s backwards;
}

/* Lightbox untuk melihat gambar besar */
.lightbox {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.9);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 2000;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s, visibility 0.3s;
}

.lightbox.show {
    opacity: 1;
    visibility: visible;
}

.lightbox-content {
    max-width: 90%;
    max-height: 80%;
    position: relative;
}

.lightbox-image {
    max-width: 100%;
    max-height: 100%;
    border-radius: 5px;
    box-shadow: 0 5px 35px rgba(0,0,0,0.3);
}

.lightbox-close {
    position: absolute;
    top: -40px;
    right: -40px;
    color: white;
    font-size: 30px;
    cursor: pointer;
    background: none;
    border: none;
    opacity: 0.7;
    transition: opacity 0.3s;
}

.lightbox-close:hover {
    opacity: 1;
}

.lightbox-caption {
    position: absolute;
    bottom: -40px;
    left: 0;
    right: 0;
    color: white;
    text-align: center;
    padding: 10px;
    font-size: 1rem;
}

/* Responsif */
@media (max-width: 768px) {
    .photo-album-container {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .photo-album h3 {
        font-size: 1.8rem;
    }
}

@media (max-width: 480px) {
    .photo-album {
        padding: 15px 10px;
        margin-top: 30px;
        margin-bottom: 20px;
    }
    
    .photo-album.show {
        margin-top: 20px;
        max-height: 3000px; /* Pastikan cukup tinggi untuk semua foto */
    }
    
    .photo-album-container {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }
    
    .photo-album h3 {
        font-size: 1.5rem;
        margin-bottom: 15px;
    }
    
    .photo-item {
        border-radius: 8px;
        box-shadow: 0 3px 10px rgba(0, 0, 0, 0.1);
    }
    
    .photo-caption {
        font-size: 0.8rem;
        padding: 10px 5px 8px;
    }
    
    .lightbox-close {
        top: -30px;
        right: -10px;
        font-size: 24px;
    }
    
    .lightbox-caption {
        bottom: -30px;
        font-size: 0.9rem;
    }
}

/* Placeholder loading styles */
.photo-placeholder {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    background-color: rgba(240, 240, 255, 0.7);
    z-index: 2;
    transition: opacity 0.3s ease;
}

.loading-spinner {
    width: 40px;
    height: 40px;
    border: 4px solid rgba(255, 107, 139, 0.3);
    border-top: 4px solid #ff6b8b;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.error-icon {
    font-size: 30px;
    margin-bottom: 10px;
}

/* Thank you message styling */
.thank-you-message {
    margin: 40px auto 20px;
    padding: 20px;
    text-align: center;
    font-family: 'Dancing Script', cursive;
    font-size: 1.5rem;
    color: #ff6b8b;
    max-width: 500px;
    animation: fadeIn 1.5s forwards;
    animation-delay: 1s;
    opacity: 0;
}

.thank-you-message p:last-child {
    font-size: 1.2rem;
    margin-top: 10px;
    font-weight: bold;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}
