body {
    font-family: Arial, sans-serif;
    background: #f4f4f9;
    text-align: center;
    padding: 0;
    margin: 0;
}

.container {
    margin: 20px auto;
    padding: 20px;
    background: white;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    max-width: 90%;
    width: 500px; /* Limit max width on larger screens */
}

h1 {
    font-size: 1.5rem;
    margin-bottom: 20px;
}

img {
    max-width: 100%; /* Ensure image fits horizontally */
    max-height: 60vh; /* Ensure image fits vertically in 60% of viewport */
    object-fit: contain; /* Maintain aspect ratio */
    border-radius: 10px;
    margin-bottom: 20px;
}

button {
    padding: 10px 20px;
    margin: 10px;
    border: none;
    border-radius: 5px;
    background: #007bff;
    color: white;
    font-size: 16px;
    cursor: pointer;
    width: 100px; /* Ensure consistent button size */
}

button:hover {
    background: #0056b3;
}

@media (max-width: 768px) {
    h1 {
        font-size: 1.2rem;
    }
    img {
        max-height: 50vh; /* Adjust image height for smaller screens */
    }
    button {
        font-size: 14px;
        padding: 8px 16px;
        width: 80px; /* Smaller buttons for mobile */
    }


    /* for image continer *
    .image-container {
    position: relative;
    width: 100%; /* Adjust as needed */
    max-width: 500px; /* Reserve space for the image */
    height: auto;
    max-height: 60vh;
    overflow: hidden; /* Prevent layout shifts */
    background: #f4f4f4; /* Light gray background for loading state */
    display: flex;
    justify-content: center;
    align-items: center;
}

.image-container img {
    display: block;
    max-width: 100%;
    max-height: 60vh;
    object-fit: contain; /* Ensure aspect ratio is preserved */
    transition: opacity 0.2s ease-in-out; /* Smooth image loading */
    opacity: 0; /* Hide image initially */
}

.image-container img.loaded {
    opacity: 1; /* Show image once loaded */
}


    /* for stats page*/

    table {
        width: 100%;
        border-collapse: collapse;
        margin: 20px 0;
    }
    
    table, th, td {
        border: 1px solid #ddd;
    }
    
    th, td {
        padding: 10px;
        text-align: center;
    }
    
    th {
        background: #007bff;
        color: white;
    }
    
    td img {
        max-height: 100px;
        border-radius: 5px;
    }
    
    .back-link {
        display: inline-block;
        margin-top: 20px;
        text-decoration: none;
        color: #007bff;
        font-weight: bold;
    }
    
    .back-link:hover {
        color: #0056b3;
    }

    /* for link stats */

    .stats-link {
        display: inline-block;
        margin-top: 20px;
        text-decoration: none;
        color: #28a745;
        font-weight: bold;
    }
    
    .stats-link:hover {
        color: #1c7c31;
    }
    
    
    .footer-link {
        display: inline-block;
        margin-top: 20px;
        text-decoration: none;
        color: #007bff;
        font-weight: bold;
        font-size: 14px; /* Slightly smaller font size */
    }
    
    .footer-link:hover {
        color: #0056b3;
    }
    

    .total-images {
        margin-top: 20px;
        font-size: 14px;
        color: #555;
        font-style: italic;
    }
    


}
