/* CSS for NASA APOD Viewer */
:root {
    --bg-color: #f4f4f9;
    --text-color: #333;
    --header-bg: #ffffff;
    --card-bg: #ffffff;
    --border-color: #ddd;
    --box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}

body.dark-mode {
    --bg-color: #121212;
    --text-color: #e0e0e0;
    --header-bg: #1e1e1e;
    --card-bg: #1e1e1e;
    --border-color: #444;
    --box-shadow: 0 4px 8px rgba(0,0,0,0.3);
}

body {
    background-color: var(--bg-color);
    color: var(--text-color);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    line-height: 1.6;
    margin: 0;
    transition: background-color 0.3s, color 0.3s;
}

header {
    background: var(--header-bg);
    padding: 1rem 2rem;
    box-shadow: var(--box-shadow);
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: 0;
    z-index: 1000;
}

header h1 {
    font-size: 1.5rem;
    margin: 0;
}

header nav {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

header nav a {
    text-decoration: none;
    color: var(--text-color);
    font-size: 1rem;
    font-weight: 500;
    transition: color 0.2s;
}

header nav a:hover {
    color: #007bff;
}

header nav h1 a {
    font-size: 1.5rem;
    font-weight: 700;
}

#theme-toggle {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--text-color);
}
main {
    padding: 2rem;
    max-width: 800px;
    margin: 0 auto;
}

#apod-container {
    background: var(--card-bg);
    border-radius: 8px;
    box-shadow: var(--box-shadow);
    overflow: hidden;
    transition: background-color 0.3s, box-shadow 0.3s;
}

.apod-image {
    width: 100%;
    display: block;
}

.apod-video {
    width: 100%;
    aspect-ratio: 16 / 9;
}

#apod-container figure {
    margin: 0;
}

#apod-container figcaption {
    padding: 1.5rem 2rem 1rem;
    text-align: center;
}

#apod-container figcaption h2 {
    font-size: 2rem;
    margin: 0;
}

#apod-container figcaption .date {
    color: #888;
    margin-top: 0.5rem;
    display: block;
}

.apod-explanation {
    padding: 0 2rem 1.5rem;
}

.apod-explanation h3 {
    border-bottom: 2px solid var(--border-color);
    padding-bottom: 0.5rem;
    margin-bottom: 1rem;
}

.apod-explanation p {
    text-align: justify;
}

#loading-message {
    text-align: center;
    padding: 4rem;
}

footer {
    text-align: center;
    padding: 2rem;
    margin-top: 2rem;
    font-size: 0.9rem;
    color: #888;
}

/* Responsive Design */
@media (max-width: 600px) {
    header {
        flex-direction: column;
        padding: 1rem;
    }

    header nav {
        margin-bottom: 1rem;
    }

    main {
        padding: 1rem;
    }
}

/* Styles for Analysis Tool Page */
.tool-container {
    background: var(--card-bg);
    border-radius: 8px;
    box-shadow: var(--box-shadow);
    padding: 2rem;
    text-align: center;
}

.tool-container h2 {
    margin-top: 0;
    font-size: 2rem;
    border-bottom: 2px solid var(--border-color);
    padding-bottom: 0.5rem;
    margin-bottom: 1rem;
}

#image-upload {
    margin: 1rem 0;
    display: block;
    width: 100%;
}

#image-preview-container {
    margin-top: 1rem;
    max-width: 100%;
    max-height: 400px;
    border: 2px dashed var(--border-color);
    border-radius: 5px;
    overflow: hidden;
}

#image-preview {
    max-width: 100%;
    max-height: 400px;
}

#analyze-button {
    margin-top: 1.5rem;
    background-color: #007bff;
    color: white;
    border: none;
    padding: 12px 24px;
    font-size: 1rem;
    border-radius: 5px;
    cursor: pointer;
    transition: background-color 0.2s, transform 0.2s;
}

#analyze-button:hover:not(:disabled) {
    background-color: #0056b3;
    transform: translateY(-2px);
}

#analyze-button:disabled {
    background-color: #555;
    cursor: not-allowed;
}

#label-container {
    margin-top: 1.5rem;
    font-size: 1.2rem;
    line-height: 1.8;
}

#label-container .probability {
    font-weight: bold;
}
