/* 
   style.css
   Modern Manuscript Theme for Obscure History Facts
*/

@import url('https://fonts.googleapis.com/css2?family=Lora:ital,wght@0,400;0,700;1,400&family=Roboto:wght@300;400;500&display=swap');

/* --- Root Variables and Resets --- */
:root {
    --background-color: #f5f5f0; /* Parchment-like off-white */
    --text-color: #333333; /* Dark Charcoal */
    --accent-color: #8B4513; /* SaddleBrown / Muted historical accent */
    --accent-hover-color: #A0522D; /* Sienna */
    --container-bg: rgba(255, 255, 255, 0.6); /* Slightly transparent white */
    --border-color: rgba(0, 0, 0, 0.1);
    
    --font-heading: 'Lora', serif;
    --font-body: 'Roboto', sans-serif;
}

html {
    box-sizing: border-box;
    font-size: 16px;
    scroll-behavior: smooth;
}

*, *:before, *:after {
    box-sizing: inherit;
    margin: 0;
    padding: 0;
}

body {
    font-family: var(--font-body);
    background-color: var(--background-color);
    background-image: url('data:image/svg+xml,%3Csvg width="60" height="60" viewBox="0 0 60 60" xmlns="http://www.w3.org/2000/svg"%3E%3Cg fill="none" fill-rule="evenodd"%3E%3Cg fill="%23e8e6d9" fill-opacity="0.4"%3E%3Cpath d="M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z"/%3E%3C/g%3E%3C/g%3E%3C/svg%3E');
    color: var(--text-color);
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    padding: 2rem;
}

/* --- Main Layout & Content Wrapper --- */
.content-wrapper {
    width: 100%;
    max-width: 700px;
    text-align: center;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

/* --- Header & Typography --- */
header h1 {
    font-family: var(--font-heading);
    font-weight: 700;
    font-size: 3rem;
    margin-bottom: 0.5rem;
    letter-spacing: 1px;
}

header .subtitle {
    font-size: 1.1rem;
    font-weight: 300;
    color: var(--text-color);
    opacity: 0.8;
    max-width: 500px;
    margin: 0 auto;
}

/* --- Fact Container & Animations --- */
#fact-container {
    background: var(--container-bg);
    backdrop-filter: blur(5px);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 2.5rem;
    min-height: 200px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    box-shadow: 0 8px 30px rgba(0,0,0,0.08);
    transition: all 0.5s ease;
    opacity: 0;
    transform: translateY(20px);
}

#fact-container.visible {
    opacity: 1;
    transform: translateY(0);
}

#fact-text {
    font-family: var(--font-heading);
    font-style: italic;
    font-size: 1.75rem;
    line-height: 1.6;
    margin-bottom: 1rem;
}

#fact-era {
    font-family: var(--font-body);
    font-weight: 500;
    font-size: 1rem;
    color: var(--accent-color);
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* --- Loader Animation --- */
.loader {
    width: 50px;
    aspect-ratio: 1;
    border-radius: 50%;
    border: 8px solid #0000;
    border-right-color: var(--accent-color);
    position: relative;
    animation: l24 1s infinite linear;
}
.loader:before,
.loader:after {
    content: "";
    position: absolute;
    inset: -8px;
    border-radius: 50%;
    border: inherit;
    animation: inherit;
    animation-duration: 2s;
}
.loader:after {
    animation-duration: 4s;
}
@keyframes l24 {
    100% {transform: rotate(1turn)}
}

/* --- Generate Button --- */
#generate-button {
    font-family: var(--font-body);
    font-size: 1.1rem;
    font-weight: 500;
    padding: 1rem 2.5rem;
    border: 1px solid var(--accent-color);
    border-radius: 50px;
    background-color: var(--accent-color);
    color: #ffffff;
    cursor: pointer;
    transition: all 0.3s ease;
    align-self: center;
}

#generate-button:hover:not(:disabled) {
    background-color: var(--accent-hover-color);
    box-shadow: 0 6px 15px rgba(0,0,0,0.1);
    transform: translateY(-3px);
}

#generate-button:active:not(:disabled) {
    transform: translateY(0);
    box-shadow: none;
}

#generate-button:disabled {
    background-color: #cccccc;
    border-color: #cccccc;
    cursor: not-allowed;
}

/* --- Action Buttons Container --- */
.action-buttons {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 1rem;
    margin-top: 1rem;
}

/* --- Share Button --- */
#share-button {
    font-family: var(--font-body);
    font-size: 1rem;
    font-weight: 500;
    padding: 0.75rem 1.5rem;
    border: 1px solid var(--border-color);
    border-radius: 50px;
    background-color: var(--background-color);
    color: var(--text-color);
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: all 0.3s ease;
}

#share-button svg {
    height: 1.1em;
}

#share-button:hover:not(:disabled) {
    background-color: #e9e9e2;
    border-color: #aaa;
    transform: translateY(-2px);
}

#share-button.hidden {
    display: none;
}

/* --- SEO Content Section --- */
.seo-content {
    background: transparent;
    padding: 2rem 1rem;
    margin: 1rem 0;
    text-align: center;
    border-top: 1px solid var(--border-color);
    border-bottom: 1px solid var(--border-color);
}

.seo-content h2 {
    font-family: var(--font-heading);
    font-size: 1.8rem;
    margin-bottom: 1rem;
}

.seo-content p {
    font-size: 1rem;
    line-height: 1.7;
    max-width: 650px;
    margin: 0 auto;
    color: var(--text-color);
    opacity: 0.8;
}

/* --- AdSense Placeholders --- */
.adsense-slot {
    min-height: 90px;
    width: 100%;
    background: repeating-linear-gradient(
      45deg,
      #f0f0f0,
      #f0f0f0 10px,
      #e9e9e9 10px,
      #e9e9e9 20px
    );
    border: 1px dashed var(--border-color);
    display: flex;
    justify-content: center;
    align-items: center;
    color: #aaa;
    font-size: 0.9em;
    border-radius: 8px;
    margin: 0.5rem 0;
}

/* --- Footer --- */
footer {
    font-size: 0.9em;
    color: var(--text-color);
    opacity: 0.7;
}

footer a {
    color: var(--text-color);
    text-decoration: none;
    font-weight: 500;
    border-bottom: 1px dotted;
    transition: color 0.3s;
}

footer a:hover {
    color: var(--accent-color);
}

/* --- Responsive Design --- */
@media (max-width: 600px) {
    body {
        padding: 1rem;
    }
    header h1 {
        font-size: 2.2rem;
    }
    .subtitle {
        font-size: 1rem;
    }
    #fact-container {
        padding: 1.5rem;
    }
    #fact-text {
        font-size: 1.4rem;
    }
} 