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

body {
    font-family: Arial, sans-serif;
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Header Styles */
.header-wrapper {
    width: 100%;
    background-color: #62AEA1;
    padding: 1rem;
    display: flex;
    justify-content: center;
    align-items: center;
}

header {
    max-width: 1400px;
    width: 80%;
    height: 120px;
    background-image: url('images/header.png');
    background-size: contain;
    background-position: center center;
    background-repeat: no-repeat;
}

header h1 {
    color: transparent;
    user-select: none;
    height: 100%;
    margin: 0;
}

/* Main Content */
main {
    flex: 1;
    padding: 1rem;
    padding-bottom: 5rem;
    background-color: #62AEA1;
}

.image-grid {
    display: grid;
    grid-template-columns: repeat(9, 1fr);
    gap: 0.1rem;
    max-width: 1000px;
    margin: 0 auto;
}

/* Flip Card Styles */
.image-card {
    aspect-ratio: 1;
    cursor: pointer;
    border-radius: 8px;
    perspective: 1000px; /* Creates 3D effect */
    /* box-shadow: 0 1px 3px rgba(0,0,0,0.2); */
    /* max-width: 180px; */
    position: relative;
    z-index: 200;
}

.flip-card-inner {
    position: relative;
    width: 100%;
    height: 100%;
    transition: transform 0.6s;
    transform-style: preserve-3d;
}

.image-card.flipped .flip-card-inner {
    transform: rotateY(180deg);
}

.flip-card-front, .flip-card-back {
    position: absolute;
    width: 100%;
    height: 100%;
    -webkit-backface-visibility: hidden; /* Safari */
    backface-visibility: hidden;
    border-radius: 8px;
    overflow: hidden;
}

.flip-card-front {
    /* background-color: #f1f1f1; */
}

.flip-card-back {
    /* background-color: rgb(255, 255, 255); */
    transform: rotateY(180deg);
    width: 100%;
    height: 100%;
    padding: 0rem;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    position: relative;
}

.flip-card-back::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 1;
}

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

.card-details {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 2;
    width: 100%;
    display: flex;
    justify-content: center;
}

.card-details h3 {
    margin-bottom: 0.5rem;
    font-size: 1rem;
}

.card-details p {
    font-size: 0.8rem;
    margin-bottom: 0.8rem;
}

.view-more-btn {
    background-color: #f3e010;
    color: rgb(34, 34, 34);
    border: none;
    padding: 0.8rem 1.6rem;
    border-radius: 4px;
    cursor: pointer;
    font-size: 1rem;
    transition: background-color 0.3s ease;
}

.view-more-btn:hover {
    background-color: #d3c313;
}

/* Footer Styles */
footer {
    max-width: 1000px;
    background-color: transparent;
    text-align: center;
    padding: 0;
    position: fixed;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 100%;
    z-index: 100;
}

.footer-image {
    width: 80%;
    height: auto;
    display: block;
    margin: 0;
    margin-left: auto;
}

/* Modal Styles */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.8);
    z-index: 1000;
}

.modal-content {
    position: relative;
    background-color: #409285;
    margin: 0;
    padding: 2rem;
    width: 100%;
    height: 100%;
    max-width: none;
    border-radius: 0;
    overflow-y: auto;
}

.close-button {
    display: none;
}

.go-back-button {
    position: absolute;
    left: 2rem;
    top: 2rem;
    padding: 0.6rem 1.2rem;
    background-color: #f3e010;
    color: rgb(36, 36, 36);
    border: none;
    border-radius: 4px;
    font-size: 1rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.go-back-button:hover {
    background-color: #ffffff;
}

.go-back-button::before {
    content: "←";
    font-size: 1.2rem;
}

.detail-wrapper {
    background-color: #62AEA1;
    padding: 20px;
    border-radius: 0px;
    margin-top: 1rem;
    margin-left: 1rem;
    margin-right: 1rem;
}

.detail-container {
    display: flex;
    gap: 2rem;
}

.detail-left {
    flex: 0.2;
}

.detail-right {
    flex: 0.8;
    background-color: #f4f4f4;
    padding: 1rem;
    border-radius: 8px;
}

#detailImage {
    width: 240px;
    height: 240px;
    object-fit: contain;
    border-radius: 8px;
    display: block;
    margin: 0;
    position: relative;
    /* top: -80px;
    left: -80px; */
}

.detail-bottom {
    display: flex;
    gap: 0rem;
    margin-top: 1rem;
}

.qr-code, .external-link {
    flex: 1;
    padding: 0rem;
    background-color: #62AEA1;
    border-radius: 8px;
    text-align: center;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    min-height: 200px;
}

#qrCode {
    margin: 0.5rem auto;
    padding: 0.5rem;
    width: 100%;
    max-width: 150px;
    flex-grow: 1;
    display: flex;
    align-items: flex-start;
    justify-content: center;
}
#externalLink {
    margin: 0.5rem auto;
    padding: 0.5rem;
    width: 100%;
    max-width: 150px;
    flex-grow: 1;
}

.external-link a {
    display: flex;
    align-items: flex-start;
    justify-content: center;
    flex-grow: 1;
}

.qr-code h3, .external-link h3 {
    margin-top: 0.5rem;
    margin-bottom: 0;
    align-self: center;
    font-family: "Comic Sans MS", "Comic Sans", cursive;
    font-size: 2.2rem;
    color: #ffffff;
}

.external-link a:hover {
    /* background-color: #444; */
}

.detail-text {
    margin-top: 1rem;
    line-height: 1.8;
}

#detailTitle {
    color: #FFD700;
    font-family: "Comic Sans MS", "Comic Sans", cursive;
    font-size: 3rem;
    font-weight: bold;
    text-shadow: 2px 2px 0 #000;
    -webkit-text-stroke: 2px black;
    margin-bottom: 0.5rem;
    text-align: center;
} 

.additional-details-row {
    margin-top: 1.5rem;
    padding: 1rem;
    background-color: #9cccc4;
    border-radius: 8px;
    width: 100%;
}

.additional-details-row h3 {
    margin-bottom: 0.5rem;
    color: #333;
}

#additionalDetails {
    line-height: 1.6;
}

.qr-code-image {
    max-width: 100%;
    max-height: 100%;
    display: block;
    margin: 0 auto;
}

/* Responsive Design */
@media (max-width: 1400px) {
    .image-grid {
        grid-template-columns: repeat(9, 1fr);
        gap: 0.5rem;
    }
}

@media (max-width: 1200px) {
    .image-grid {
        grid-template-columns: repeat(6, 1fr);
    }
    footer {
        z-index: 1000;
    }
}

@media (max-width: 900px) {
    .image-grid {
        grid-template-columns: repeat(4, 1fr);
    }
    
    footer {
        z-index: 1000;
    }
}

@media (max-width: 600px) {
    .image-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    footer {
        margin-top: 100px;
        z-index: 1000;
    }
    
    .detail-container {
        flex-direction: column;
        margin: 0;
        padding: 0;
    }

    .detail-wrapper {
        margin: 0;
        margin-top: 1rem;
        padding: 10px;
        border-radius: 0;
    }
    
    .go-back-button {
        position: relative;
        left: 0;
        top: 0;
        margin-bottom: 1rem;
        width: 100%;
        justify-content: center;
    }
    
    #detailTitle {
        margin-top: 0.5rem;
    }
}

/* Bob animation */
@keyframes bob-animation {
    0% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-5px);
    }
    100% {
        transform: translateY(0);
    }
}

.external-link img {
    transition: all 0.3s ease;
}

.external-link img:hover {
    animation: bob-animation 1s ease infinite;
}

