@import url('https://fonts.googleapis.com/css2?family=Lato:wght@400;700&family=Playfair+Display:wght@700&display=swap');

/* --- Global Styles & Variables (Mobile First) --- */
:root {
    /* Warm and muted color palette */
    --primary-color: #2D2D2D;    /* Dark Charcoal Gray for text */
    --background-color: #FAF8F5;    /* Warm Off-White for the page background */
    --form-background: #FFFFFF;    /* Pure White for the main content boxes */

    /* A single, muted accent color - a warm terracotta */
    --button-color: #B58A85;
    --button-hover-color: #A37B77;    /* A slightly darker version for hover */
}

body {
    /* Default font for all paragraphs and UI elements */
    font-family: 'Lato', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    margin: 0;
    padding: 0;
    background-color: var(--background-color);
    color: var(--primary-color);
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    align-items: center;
}

/* Target all headings to use Playfair Display serif font */
h1,
h2,
h3 {
    font-family: 'Playfair Display', serif;
}

main {
    width: 90%; /* Use 90% of the screen width (for mobile) */
    max-width: 850px; /* But don't let it get wider than 500px */
    margin: 10px 0;
    padding: 20px;
    background-color: var(--form-background);
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    /* A subtle shadow for depth */
}

main, 
header,
footer {
    text-align: center;
    width: 90%;
    max-width: 850px; /* Match the width of the main body */
    padding-top: 20px;    /* Adds space at the top of each section */
    padding-bottom: 20px;        /* Adds space at the bottom of each section */
}

h1 {
    font-size: 1.8em;
}


.example-image {
    width: 200px;
    height: 200px;
    background-color: #e9ecef;
    border-radius: 8px;
    /* Add this line to make sure the image scales nicely */
    object-fit: contain;
    cursor: zoom-in;
    transition: transform 0.2s ease; /* A nice transition for the zoom */
}

/* --- Form Specific Styles --- */
.form-group {
    margin-top: 10px;
    margin-bottom: 10px;
    /* Space out the form sections */
}

label {
    display: block;
    /* Make the label take up its own line */
    font-weight: bold;
    margin-bottom: 8px;
}

input[type="text"],
input[type="file"] {
    width: 100%;
    padding: 10px;
    border: 1px solid #ccc;
    border-radius: 4px;
    box-sizing: border-box;
    /* Ensures padding doesn't add to the width */
}

.slider-container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    /* Puts "Realistic" and "Silly" on the ends */
}

.slider-container span {
    font-size: 0.9em;
    color: #666;
}

.warning-text {
    font-size: 0.9em;
    color: #856404;
    /* A dark yellow/brown color */
    background-color: #F5EAE9;
    /* A light yellow */
    border: 1px solid #F5EAE9;
    padding: 10px;
    border-radius: 4px;
    margin-top: 0;
    margin-bottom: 20px;
}

input[type="range"] {
    flex-grow: 1;
    /* Allows the slider to take up the available space */
    margin: 0 10px;
}

button[type="submit"] {
    width: 100%;
    padding: 12px;
    background-color: var(--button-color);
    color: white;
    font-size: 1.1em;
    font-weight: bold;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    margin-top: 20px;
    /* Changes the mouse to a pointer on hover */
    transition: background-color 0.2s;
    /* A smooth transition for the hover effect */
}

button[type="submit"]:hover {
    background-color: var(--button-hover-color);
}


/* --- Media Query for Larger Screens (Desktops/Tablets) --- */
/* This block of CSS will only apply if the screen width is 768px or more */
@media (min-width: 768px) {

    main,
    header,
    footer {
        padding: 30px;
    }

    h1 {
        font-size: 2.5em;
        /* Make the title bigger on larger screens */
    }
}

/* --- Loading Overlay Styles --- */
#loading-overlay {
    display: none;
    /* Hidden by default */
    position: fixed;
    /* Sits on top of all other content */
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(255, 255, 255, 0.8);
    /* Semi-transparent white background */
    z-index: 1000;
    /* Ensures it's on top */

    /* Flexbox to center the content */
    justify-content: center;
    align-items: center;
    text-align: center;
    padding: 20px;
    box-sizing: border-box;
}

.loading-box {
    background-color: var(--form-background);
    padding: 30px;
    border-radius: 8px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.15);
}

.generated-image {
    max-width: 100%;
    /* New: Set a maximum height relative to the viewport height */
    max-height: 60vh;
    /* 60% of the viewport height */
    height: auto;
    border: 5px solid var(--primary-color);
    border-radius: 8px;
    margin-bottom: 20px;
    cursor: zoom-in; /* Indicates the image is clickable */
    transition: max-height 0.3s ease; /* Smooth transition */

    /* Trigger the animation */
    opacity: 0;
    transform: scale(0.97);
    animation: fadeInReveal 4.0s ease-out 0.2s forwards; /* Added 0.2s delay */
}
 /* Define the keyframes for our animation */
 @keyframes fadeInReveal {
     to {
         opacity: 1;
         transform: scale(1);
     }
}

.generated-image.expanded {
    max-height: none; /* Remove the height constraint */
    cursor: zoom-out;
}

.form-hint {
    font-size: 0.85em;
    color: #6c757d; /* A muted gray color */
    margin-top: 5px;
    margin-bottom: 0;
}

/* --- Polished Header Styles --- */

/* 1. Add some vertical spacing to the header container itself */
header {
    padding-top: 10px;
    margin-bottom: 0px;
    /* Creates more space between header and main content */
}

/* 2. Style the navigation bar for a cleaner look */
.main-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-bottom: 15px;
    /* Adds space below the nav links */
    margin-bottom: 15px;
    /* Adds space above the main H1 title */
    border-bottom: 1px solid #dee2e6;
    /* A soft line to separate nav from title */
}

/* 3. Make the brand/logo text more prominent */
.nav-brand {
    font-weight: 600;
    /* A bit bolder */
    font-size: 1.3em;
    text-decoration: none;
    color: var(--primary-color);
}

/* 4. Style the navigation link */
.nav-link {
    text-decoration: none;
    color: var(--button-color);
    font-weight: 500;
    font-size: 1.1em;
    transition: color 0.2s;
    /* Add a smooth hover effect */
}

.nav-link:hover {
    color: var(--button-hover-color);
}

/* 5. Control the main H1 title inside the header */
header h1 {
    margin-top: 0;
    /* Remove any default extra space above the title */
    margin-bottom: 0;
    /* Let the header's margin handle the spacing */
}

.alpha-banner {
    background-color: #F5EAE9;
    color: var(--button-color);
    text-align: center;
    padding: 10px;
    border-bottom: 1px solid #EAE0DF;
    font-family: 'Lato', sans-serif;
}

.alpha-banner a {
    /* Use the main text color for the link to make it stand out */
    color: #A37B77;
    font-weight: 600;
    text-decoration: underline;
}

.alpha-banner a:hover {
    color: #000;
}

.alpha-banner p {
    margin: 0;
    font-size: 0.9em;
}

.waitlist-form {
    margin-top: 50px;
    padding: 20px;
    background-color: #f8f9fa;
    border-radius: 8px;
}

.waitlist-form input[type="email"] {
    padding: 10px;
    width: 250px;
    border: 1px solid #ccc;
    border-radius: 4px;
}

.waitlist-form button {
    padding: 10px 15px;
    background-color: var(--button-color);
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
}

/* Style for generator submit button when it is disabled */
button[type="submit"]:disabled {
    background-color: #6c757d; /* Grey */
    color: #ccc; /* Light grey */
    cursor: not-allowed;
}

/* Add a hover effect to show the tooltip is there */
button[type="submit"]:disabled:hover {
    background-color: #5b5d5f;/* Slightly darken the gray on hover */
}

.dedication-text {
    text-align: center;
    margin-top: 15px;
    font-style: italic;
    color: var(--primary-color);
    display: none;
    /* Hidden by default */
}