/* Base styles */
body {
    font-family: Arial, sans-serif;
    background-color: #f5f5f5;
    color: #333;
    margin: 0;
    padding: 0;
    overflow-x: hidden;
    /* Prevent horizontal scrolling */
}

header {
    background-color: #160d62;
    color: #fff;
    padding: 20px;
    text-align: center;
    width: 100%;
    box-sizing: border-box;
    font-family: 'Playfair Display', serif;
    /* Fancy font for the header */
    font-size: 36px;
    /* Increase the font size for the title */
    font-weight: 700;
    /* Make the font bold */
    letter-spacing: 1px;
    /* Add letter spacing for style */
}

footer {
    background-color: lightblue;
    color: black;
    padding: 1px;
    text-align: center;
    bottom: 0;
    width: 100%;
    position: sticky;
    /* Ensure footer takes up full width */
    box-sizing: border-box;
    margin-top: 10%;
}

/* Main content styles */
main {
    padding: 20px;
    text-align: center;
    max-width: 100%;
    /* Prevent content from overflowing */
    box-sizing: border-box;
}

/* Date selector styles */
#date-selector {
    margin-bottom: 20px;
    max-width: 100%;
    /* Ensure the date selector doesn't overflow */
}

#date-selector label {
    font-weight: bold;
}

#date-selector input[type="date"] {
    padding: 10px;
    margin-left: 10px;
    margin-right: 10px;
    font-size: 16px;
    max-width: 100%;
    box-sizing: border-box;
}

#date-selector button {
    padding: 10px 20px;
    background-color: #1a75ff;
    color: #fff;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 16px;
    max-width: 100%;
    box-sizing: border-box;
}

#date-selector button:hover {
    background-color: #004c99;
}

/* APOD content styles */
#apod-content {
    max-width: 1020px;
    max-height: 100%;
    margin: 0 auto;
    background-color: #fff;
    border-radius: 10px;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
    padding: 20px;
    box-sizing: border-box;
    position: relative;
    overflow: hidden;
    /* Prevent content overflow */
}

#apod-content img,
#apod-content iframe {
    width: 100%;
    /* Make the width 100% of its container */
    height: 100%;
    /* Set a fixed height */
    object-fit: cover;
    /* Scale the image to cover the area, cropping if necessary */
    border-radius: 10px;
    margin-bottom: 20px;
}

#apod-content h2 {
    font-size: 24px;
    margin-bottom: 10px;
    word-wrap: break-word;
}

#apod-content p {
    font-size: 16px;
    line-height: 1.6;
    text-align: justify;
}

/* Copyright and date */
#apod-content p:last-child {
    text-align: right;
    font-size: 14px;
    color: #666;
    margin-top: 20px;
}

/* Responsive design */
@media (max-width: 768px) {
    main {
        padding: 15px;
    }

    #date-selector input[type="date"],
    #date-selector button {
        width: 100%;
        font-size: 18px;
        margin: 10px 0;
    }

    #apod-content {
        padding: 15px;
        max-width: 100%;
    }

    #apod-content img,
    #apod-content iframe {
        height: 300px;
        /* Adjust the height for smaller screens */
    }

    #apod-content h2 {
        font-size: 22px;
    }

    #apod-content p {
        font-size: 15px;
    }
}

@media (max-width: 480px) {
    main {
        padding: 10px;
    }

    header {
        padding: 15px;
        font-size: 18px;
    }

    footer {
        padding: 8px;
        font-size: 14px;
    }

    #date-selector input[type="date"],
    #date-selector button {
        width: 100%;
        padding: 10px;
        font-size: 16px;
    }

    #apod-content {
        padding: 10px;
    }

    #apod-content img,
    #apod-content iframe {
        height: 250px;
        /* Further adjust the height for small screens */
    }

    #apod-content h2 {
        font-size: 20px;
    }

    #apod-content p {
        font-size: 14px;
    }
}