/* static/style.css */

/* Import Google Fonts - Place at the very top */
@import url('https://fonts.googleapis.com/css2?family=Playfair+Display:wght@400;700&family=Merriweather:wght@300;400;700&display=swap');

/* Basic Reset & Box Sizing */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Merriweather', 'Georgia', Times, serif; /* Using Merriweather for body */
    line-height: 1.7;
    color: #38302b; /* A slightly warmer dark brown/grey */
    margin: 0;
    padding: 0;
    
    background-image: url('/static/img/Fantasia Background.png');
    background-repeat: no-repeat;
    background-size: cover;
    background-position: center center;
    background-attachment: fixed;
    background-color: #f4f0e8; /* A slightly warmer fallback (ivory/parchment) */
}

h1 {
    font-family: 'Playfair Display', 'Georgia', serif;
    color: #ffffff; 
    margin-bottom: 0.75em;
    line-height: 1.2;
    font-weight: 700; /* Make headings bolder */
}


h2, h3, h4, h5, h6 {
    font-family: 'Playfair Display', 'Georgia', serif;
    color: #4a3b31; 
    margin-bottom: 0.75em;
    line-height: 1.2;
    font-weight: 700; /* Make headings bolder */
}

h1 {
    font-size: 2.6em; /* Slightly larger */
}

h2 {
    font-size: 1.8em;
    margin-top: 1.2em;
    color: #5a4a42; /* Slightly softer color for H2 */
}

p {
    margin-bottom: 1em;
}

a {
    color: #6b5b53; /* Slightly different link color */
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
    color: #4a3b31;
}

/* General Container */
.page-wrapper {
    max-width: 980px; /* Slightly narrower for a more classic feel */
    margin: 30px auto; 
    padding: 30px 40px; /* Increased padding */
    background-color: rgba(255, 250, 240, 0.95); /* Linen/Ivory, slightly more opaque */
    box-shadow: 0 2px 10px rgba(0,0,0,0.15);
    border: 1px solid #e0d8c8; /* Subtle border for the wrapper */
}

/* Header Styling */
.page-header {
    background-image: url('/static/img/Pattern Header.png');
    background-repeat: repeat-x; 
    background-size: auto 100%; /* Let it scale with header height if pattern allows */
    background-position: center;
    padding: 25px 20px; 
    text-align: center;
    border-bottom: 2px solid #4a3b31; 
    margin-bottom: 0; 
    position: relative; 
    min-height: 80px; /* Ensure header has some height for the pattern */
}

.page-header {
    background-image: url('/static/img/Pattern Header.png');
    background-repeat: repeat-x; 
    background-size: auto 100%; 
    background-position: center;
    padding: 25px 20px; 
    text-align: center; /* Fallback, but flex will primarily control alignment */
    border-bottom: 2px solid #4a3b31; 
    margin-bottom: 0; 
    position: relative; 
    min-height: 80px;

    /* --- ADD/CHANGE THESE FLEXBOX PROPERTIES --- */
    display: flex;            /* Enables flexbox layout */
    justify-content: center;  /* Centers items horizontally on the line */
    align-items: center;      /* Vertically aligns items in the middle of the line */
    flex-wrap: wrap;          /* Allows items to wrap if not enough space (optional) */
}

/* Styles for header accent images (if used as <img> tags) */
.header-accent {
    height: 45px; 
    width: auto;
    vertical-align: middle;
    margin: 0 10px;
    opacity: 0.8; /* Make them slightly subtle if desired */
}
/* For more precise left/right positioning if you uncomment the <img> tags with these classes:
.header-accent-left { float: left; margin-left: -20px; }
.header-accent-right { float: right; margin-right: -20px; }
Ensure .page-header has clearfix or overflow:hidden if using floats.
*/

/* Section Divider Styling */
.regency-divider {
    border: none; 
    height: 15px; /* Or the natural height of your divider image */
    background-image: url('/static/img/Section Divider.png');
    background-repeat: repeat-x;  
    background-position: center;
    margin: 40px auto; /* Increased margin */
    max-width: 70%; /* Slightly narrower */
}

/* Main Content Area */
.main-content {
    padding: 10px 0; 
}

.interactive-section {
    margin-bottom: 25px;
    padding: 20px;
    background-color: rgba(248, 244, 237, 0.6); /* Slightly different section bg */
    border: 1px solid #d7cec0;
    border-radius: 2px; /* Sharper radius */
}

.interactive-section label {
    display: block; 
    margin-bottom: 8px; /* More space after label */
    font-family: 'Playfair Display', serif; 
    color: #4a3b31; 
    font-size: 1.15em; /* Slightly larger labels */
    font-weight: 400;
}

/* Form Styling */
textarea#prompt,
.form-controls input[type="number"],
.form-controls select {
    width: 100%; 
    padding: 12px; /* More padding */
    border: 1px solid #c5b8af; /* Period-appropriate border color */
    border-radius: 2px; /* Sharper radius */
    font-family: 'Merriweather', serif;
    font-size: 1em;
    background-color: #fff; /* White background for inputs */
    color: #38302b;
    margin-bottom: 15px; 
    box-shadow: inset 0 1px 2px rgba(0,0,0,0.07);
}

.form-controls {
    margin-bottom: 20px; /* More space */
    display: flex; 
    flex-wrap: wrap;
    gap: 10px 20px; /* Row gap, Column gap */
    align-items: center;
}

.form-controls div { /* Assuming labels and inputs are wrapped in divs for flex alignment */
    display: flex;
    flex-direction: column; /* Labels above inputs */
}

.form-controls label { /* More specific for form controls if needed */
    margin-bottom: 4px;
    font-size: 1em;
}

.form-controls input[type="number"],
.form-controls select {
    width: auto; 
    min-width: 120px; /* Adjust as needed */
    padding: 10px; /* Consistent padding */
}

/* Button Styling */
button#generateButton,
button.example-prompt-btn,
button#copyButton,
button#continueButton {
    background-color: #4a3b31; 
    color: #fdfcf9; 
    padding: 12px 20px; /* Larger padding */
    border: 1px solid #3b2e26; /* Darker border */
    border-radius: 2px;
    cursor: pointer;
    font-family: 'Playfair Display', serif;
    font-size: 1.1em; /* Slightly larger button text */
    margin-right: 10px; 
    margin-top: 10px; /* More consistent top margin for all buttons */
    transition: background-color 0.2s ease-in-out, box-shadow 0.2s ease-in-out;
    box-shadow: 1px 1px 3px rgba(0,0,0,0.2);
}

button#generateButton:hover,
button.example-prompt-btn:hover,
button#copyButton:hover,
button#continueButton:hover {
    background-color: #604c42; /* Lighter hover */
    box-shadow: 1px 1px 5px rgba(0,0,0,0.3);
}

button#copyButton,
button#continueButton {
    background-color: #7a6a5f; 
    border-color: #5a4a42;
    font-size: 1em;
}

button#copyButton:hover,
button#continueButton:hover {
    background-color: #5a4a42;
}

button:disabled {
    background-color: #d4cdc5; 
    border-color: #c5b8af;
    color: #8e8076;
    cursor: not-allowed;
    box-shadow: none;
}

/* Results Area Styling */
.result-controls {
    margin-bottom: 10px;
    text-align: right; /* Align buttons to the right */
}

#generatedTextOutput {
    background-color: #fffaf0; /* Floral white - very light cream */
    border: 1px dashed #d7cec0; /* Dashed border for a softer look */
    padding: 20px;
    border-radius: 2px;
    min-height: 60px; 
    line-height: 1.75; /* More leading for generated text */
    color: #403833; /* Slightly softer than body text */
}

/* Feedback Areas Styling */
.feedback-area {
    margin-top: 15px;
    padding: 12px;
    border-radius: 2px;
    font-size: 0.95em;
}

.error-message {
    background-color: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

#loadingIndicator {
    color: #4a3b31;
    font-style: italic;
}

/* Footer Styling */
.page-footer {
    text-align: center;
    margin-top: 50px;
    padding-top: 25px;
    border-top: 2px solid #4a3b31; /* Match header border-bottom */
    font-size: 0.9em;
    color: #5a4a42;
}

.footer-image {
    max-width: 200px; /* Keep Chawton cottage not too large */
    height: auto;
    margin: 0 auto 15px auto; /* Center it */
    border: 3px solid #d7cec0; 
    border-radius: 2px; 
    box-shadow: 1px 1px 4px rgba(0,0,0,0.1);
}