/* Global Styles */
body {
    font-family: 'Georgia', serif; /* More academic serif font for body */
    line-height: 1.7;
    margin: 0;
    padding: 0;
    background-color: #fdfdfd; /* Slightly off-white background */
    color: #2c3e50; /* Darker, softer text color */
    display: flex;
    justify-content: center;
    align-items: flex-start; /* Align container to top */
    min-height: 100vh;
    padding-top: 40px; /* Add padding at the top */
}

.container {
    max-width: 750px;
    width: 90%;
    margin: 0 auto; /* Center container */
    padding: 40px;
    background-color: #ffffff;
    border: 1px solid #e0e0e0; /* Subtle border */
    border-radius: 5px; /* Slightly softer edges */
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08); /* More subtle shadow */
}

h1 {
    text-align: center;
    color: #34495e; /* Deeper blue-gray for heading */
    margin-bottom: 35px;
    font-weight: 400; /* Normal weight for a classic look */
    font-size: 2.2rem; /* Slightly larger heading */
    border-bottom: 1px solid #eee; /* Subtle separator */
    padding-bottom: 15px;
}

/* Loading Indicator Style */
#loading {
    text-align: center;
    padding: 20px;
    font-style: italic;
    color: #555;
    margin-top: 20px;
    border: 1px dashed #ccc;
    background-color: #f9f9f9;
    border-radius: 4px;
}

/* Form Styles */
.form-group {
    margin-bottom: 25px;
}

label {
    display: block;
    margin-bottom: 10px;
    font-weight: 500; /* Keep label weight */
    color: #34495e; /* Match heading color */
    font-size: 1.05rem;
    font-family: 'Lato', sans-serif; /* Cleaner sans-serif for labels */
}

textarea,
select {
    width: 100%;
    padding: 15px;
    border: 1px solid #d5dbe0; /* Lighter border */
    border-radius: 4px;
    box-sizing: border-box;
    font-size: 1rem;
    font-family: 'Lato', sans-serif; /* Consistent sans-serif */
    background-color: #f8f9fa; /* Light background for inputs */
    color: #333;
    transition: border-color 0.3s ease;
}

textarea:focus,
select:focus {
    outline: none;
    border-color: #80bdff; /* Highlight focus */
    box-shadow: 0 0 0 0.2rem rgba(0, 123, 255, 0.25); /* Subtle focus glow */
}

textarea {
    resize: vertical;
    min-height: 180px; /* More space for description */
}

button[type="submit"] {
    background-color: #3498db; /* Professional blue */
    color: white;
    border: none;
    cursor: pointer;
    transition: background-color 0.3s ease, box-shadow 0.3s ease;
    font-weight: 500;
    padding: 15px 25px; /* More padding */
    font-size: 1.1rem;
    border-radius: 4px;
    display: block; /* Center button */
    margin: 20px auto 0 auto; /* Center button with top margin */
    width: auto; /* Allow button to size based on content */
    min-width: 150px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

button[type="submit"]:hover {
    background-color: #2980b9; /* Darker blue on hover */
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

/* Result & Message Styles */
#result-container {
    margin-top: 40px;
    padding: 25px;
    background-color: #f8f9fa; /* Consistent light background */
    border-radius: 4px;
    border-left: 6px solid #3498db; /* Match button color */
    box-shadow: inset 0 1px 3px rgba(0,0,0,0.05);
}

#result-container h2 {
    margin-top: 0;
    margin-bottom: 20px;
    color: #34495e; /* Match heading color */
    font-size: 1.4rem;
    font-weight: 500;
    font-family: 'Lato', sans-serif; /* Sans-serif for result heading */
    border-bottom: 1px solid #e0e0e0;
    padding-bottom: 10px;
}

#result-text {
    white-space: pre-wrap;
    word-wrap: break-word;
    font-size: 1rem;
    line-height: 1.8; /* Increased line height for readability */
    color: #333;
}

#loading,
#error-message {
    text-align: center;
    margin-top: 25px;
    padding: 15px;
    border-radius: 4px;
    font-size: 1rem;
    font-family: 'Lato', sans-serif;
}

#loading {
    color: #5a6772;
    background-color: #eef1f3;
    border: 1px solid #d6dde3;
}

#error-message {
    background-color: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

/* Footer (Optional - Add if needed) */
/*
footer {
    text-align: center;
    margin-top: 40px;
    padding-top: 20px;
    border-top: 1px solid #eee;
    font-size: 0.9rem;
    color: #777;
    font-family: 'Lato', sans-serif;
}
*/

/* Responsive adjustments */
@media (max-width: 768px) {
    .container {
        padding: 30px;
    }
    h1 {
        font-size: 2rem;
    }
}

@media (max-width: 600px) {
    body {
        padding-top: 20px;
    }
    .container {
        margin: 20px auto;
        padding: 20px;
        width: 95%;
    }

    h1 {
        font-size: 1.8rem;
        margin-bottom: 25px;
    }

    textarea,
    select,
    button[type="submit"] {
        padding: 12px;
        font-size: 0.95rem;
    }

    textarea {
        min-height: 150px;
    }

    button[type="submit"] {
        width: 100%; /* Full width on smaller screens */
    }

    #result-container {
        padding: 20px;
    }

    #result-container h2 {
        font-size: 1.2rem;
    }
}