/* General Layout */
body {
    background: #0d0d0d;
    color: #eee;
    font-family: sans-serif;
    padding: 2rem;
    max-width: 1000px;
    margin: auto;
}

/* Header */
.header {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 2rem;
}

.nasa-logo {
    width: 60px;
    height: auto;
}

h1 {
    font-size: 2rem;
    margin: 0;
}

/* Description Section */
.description {
    background: #1a1a1a;
    padding: 0.75rem 1rem;
    border-radius: 8px;
    margin-bottom: 1.5rem;
    font-size: 0.95rem;
    color: #ccc;
    line-height: 1.5;
}

.description a {
    color: #fff;
    text-decoration: underline;
}

.description a:hover {
    color: #0b3d91;
}

/* Form */
form {
    background-color: #1a1a1a;
    padding: 1rem;
    border-radius: 10px;
    margin-bottom: 2rem;
    box-shadow: 0 0 8px rgba(255, 255, 255, 0.05);
}

.form-row {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    align-items: flex-end;
}

.form-row label {
    display: flex;
    flex-direction: column;
    font-weight: bold;
    color: #ccc;
    font-size: 0.95rem;
    gap: 0.3rem;
    flex: 1;
    min-width: 180px;
}

input[type="number"],
input[type="date"],
select {
    padding: 0.4rem;
    border: 1px solid #444;
    background-color: #222;
    color: #eee;
    border-radius: 6px;
    font-size: 1rem;
}

/* Buttons */
button,
.pagination button,
.pagination-btn {
    padding: 0.4rem 0.9rem;
    background-color: #0b3d91;
    color: white;
    font-weight: 600;
    font-size: 0.9rem;
    border-radius: 6px;
    border: none;
    cursor: pointer;
    transition: background 0.2s ease;
    text-align: center;
}

button:hover,
.pagination button:hover,
.pagination-btn:hover {
    background-color: #0a3480;
}

button:disabled,
.pagination button:disabled,
.pagination-btn:disabled {
    background-color: #444;
    cursor: not-allowed;
}

/* Error Message */
.error {
    color: #ff4c4c;
    background: #220000;
    padding: 1rem;
    border-radius: 6px;
    margin-bottom: 1.5rem;
}

/* Gallery */
.gallery {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 1rem;
}

.image-card img {
    width: 100%;
    border-radius: 8px;
    box-shadow: 0 0 8px rgba(255, 255, 255, 0.1);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    cursor: zoom-in;
}

.image-card img:hover {
    transform: scale(1.03);
    box-shadow: 0 0 12px rgba(255, 255, 255, 0.2);
}

/* Links */
a {
    color: white;
    text-decoration: underline;
}

a:hover {
    color: #0b3d91;
}

/* Spinner */
.spinner {
    border: 6px solid #222;
    border-top: 6px solid #0b3d91;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
    margin: 2rem auto;
    display: none;
}

.spinner.show {
    display: block;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Lightbox */
.lightbox {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0, 0, 0, 0.9);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.lightbox img {
    max-width: 90%;
    max-height: 90%;
    border-radius: 10px;
    box-shadow: 0 0 20px black;
}

.hidden {
    display: none;
}

/* Pagination */
.pagination {
    margin: 1rem 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
    font-size: 0.9rem;
}

.pagination span {
    color: #ccc;
    font-weight: 500;
    flex: 1;
    text-align: center;
}

.pagination form {
    margin: 0;
}

/* Sticky Top Pagination */
.sticky-top {
    position: sticky;
    top: 0;
    z-index: 100;
    background: #0d0d0d;
    padding: 0.6rem 0;
    margin-bottom: 1rem;
    box-shadow: 0 2px 8px rgba(0,0,0,0.4);
}

/* Mobile Responsiveness */
@media (max-width: 600px) {
    .form-row {
        flex-direction: column;
        align-items: stretch;
    }

    .form-button {
        width: 100%;
    }

    button,
    .pagination button {
        width: 100%;
        font-size: 1rem;
    }

    .pagination {
        flex-direction: column;
        align-items: stretch;
        text-align: center;
    }

    .pagination form {
        width: 100%;
    }

    .gallery {
        grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    }
}
.error {
    color: #d32f2f;
    font-weight: bold;
    margin-top: 1rem;
    background-color: #ffe6e6;
    padding: 10px;
    border-radius: 8px;
}