/* CSS Variables with fallbacks */
:root {
    --primary-color: #1a73e8; 
    --secondary-color: #34a853; 
    --background-color: #f8f9fa; 
    --text-color: #202124; 
    --font-family: 'Roboto', sans-serif;
    --font-size-base: 1rem;
    --spacing-unit: 1em;
}

body {
    font-family: var(--font-family), Arial, sans-serif;
    font-size: var(--font-size-base);
    line-height: 1.6;
    margin: 0;
    padding: 0;
    background-color: var(--background-color);
    color: var(--text-color);
}

h1{
    text-align: center;
}

h1, h2 {
    font-size: 2rem;
    margin-bottom: var(--spacing-unit);
}

p {
    font-size: 1rem;
    margin-bottom: var(--spacing-unit);
}

main {
    padding: 5dvh 5dvw;
}

#nasapic {
    border-radius: 8px;
    width: 100%;
    max-width: 400px;
    height: auto;
    border: 1px solid #ddd;
    object-fit: cover;
    object-position: center;
}

#regencypic {
    border-radius: 8px;
    width: 100%; 
    max-width: 400px; 
    height: auto; 
    border: 1px solid #ddd;
    object-fit: cover;
    object-position: center;
}

#webvideo {
    border-radius: 8px;
    width: 100%;
    max-width: 400px; 
    height: auto; 
    border: 1px solid #ddd;
}

#website {
    border: 1px solid #ddd;
    padding: var(--spacing-unit);
    border-radius: 8px;
    margin-bottom: var(--spacing-unit);
}

#homepage {
    text-align: center;
    width: 100px; 
    height: 40px; 
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid black;
    background-color: lightgray; 
    margin: auto; 
    padding: 5px; 
    border-radius: 5px; 
}

#homepage a {
    text-decoration: none; 
    color: black;
    font-weight: bold;
}

#homepage:hover {
    background-color: darkgray; 
}

/* Responsive Design */
@media (max-width: 768px) {
    :root {
        --font-size-base: 0.9rem;
    }

    #nasa, #regency, #website {
        flex-direction: column;
        gap: 1em;
    }

    #nasapic, #regencypic, #webvideo {
        width: 100%;
        margin-left: 0;
    }
}

/* Small Screens */
@media (max-width: 480px) {
    :root {
        --font-size-base: 0.8rem;
    }

    h1, h2 {
        font-size: 1.5rem;
    }

    #homepage {
        width: 100%;
        padding: 10px;
    }
}

#homepage {
    background-color: color-mix(in srgb, var(--primary-color), white 20%);
    color: white;
    border-radius: 8px;
}

/* New selectors like has() */
section:has(img) {
    border: 1px solid #ddd;
    padding: var(--spacing-unit);
    border-radius: 8px;
}

/* Nested and Scoped CSS */
main {
    & section {
        margin-bottom: var(--spacing-unit);
    }

    & h2 {
        color: var(--primary-color);
    }
}

footer {
    text-align: center;
    padding: var(--spacing-unit);
    background-color: var(--secondary-color);
    color: white;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

header, main, footer {
    animation: fadeIn 1s ease-in-out;
}


:root {
    --bg-color: white;
    --text-color: black;
    --header-color: #007BFF;
    --link-color: #007BFF;
    --font-family: Arial, sans-serif;
}

[data-theme="dark"] {
    --bg-color: #121212;
    --text-color: #e0e0e0;
    --header-color: #1E90FF;
    --link-color: #1E90FF;
    --font-family: Arial, sans-serif;
}

body {
    font-family: var(--font-family);
    background-color: var(--bg-color);
    color: var(--text-color);
    margin: 0;
    padding: 0;
    transition: background-color 0.3s, color 0.3s, font-family 0.3s;
}

main {
    padding: 20px;
    max-width: 800px;
    margin: 0 auto;
}

h1, h2 {
    color: var(--header-color);
}

section {
    margin-bottom: 40px;
}

picture img {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    margin-bottom: 20px;
}

video {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    margin-bottom: 20px;
}

#theme-toggle {
    color: #007BFF;
    position: fixed;
    top: 10px;
    right: 10px;
    background: none;
    font-size: 1.5rem;
    cursor: pointer;
    border: none;
    z-index: 1001;
}

#theme-customizer {
    position: fixed;
    top: 60px; 
    right: 10px;
    background: var(--bg-color);
    padding: 10px;
    border: 1px solid var(--text-color);
    border-radius: 4px;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
    z-index: 1000;
    max-width: 250px; 
}

#theme-customizer label {
    display: block;
    margin-bottom: 5px;
}

#theme-customizer input, #theme-customizer select {
    margin-bottom: 10px;
    width: 100%;
}

#save-theme, #reset-theme {
    background-color: var(--header-color);
    color: white;
    padding: 10px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    width: 100%; 
    margin-top: 10px;
}

#reset-theme {
    background-color: #ff4444;
}

#reset-theme:hover {
    background-color: #cc0000;
}

#homepage {
    text-align: center;
    margin-top: 20px;
}

#homepage a {
    color: var(--link-color);
    text-decoration: none;
}

#homepage a:hover {
    text-decoration: underline;
}
