/* --- Core Setup, Variables, & Layout Fixes --- */
:root {
    --primary-yellow: #dfff00;
    --card-background: #ffffff;
    --text-color: #111827;
    --text-muted: #6b7280;
    --font-sans: 'Poppins', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

a {color: black;
background: var(--primary-yellow);
text-decoration: none;}

html {
    box-sizing: border-box;
    overflow-x: hidden;
    width: 100%;
}
*, *::before, *::after {
    box-sizing: inherit;
}
body {
    background-color: #ffffff; /* Solid white background */
    color: var(--text-color);
    font-family: var(--font-sans);
    padding-top: 80px;
    position: relative;
    overflow-x: hidden;
    width: 100%;
}

/* --- UPDATED: Header with No Background Color --- */
.site-header {
    width: 100%;
    height: 80px;
    position: fixed;
    top: 0;
    left: 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 1.5rem;
    background-color: rgba(255, 255, 255, 0.6); /* Mostly transparent for blur */
    -webkit-backdrop-filter: blur(10px); /* Safari */
    backdrop-filter: blur(10px);
    z-index: 100;
}

/* --- Giant Logo & Navigation (No Changes) --- */
.site-logo {
    position: absolute; top: -50px; left: -25px; font-size: 12rem; font-weight: 900; color: var(--primary-yellow); text-decoration: none; line-height: 1; transform: rotate(-15deg); z-index: 110; pointer-events: none;
}
.desktop-nav { display: none; margin-left: auto; }
.desktop-nav a { font-weight: 700; color: var(--text-color); text-decoration: none; padding: 4px 8px; margin-left: 1rem; transition: background-color 0.2s ease; }
.desktop-nav a:hover { background-color: var(--primary-yellow); }
.hamburger-btn { background: none; border: none; cursor: pointer; padding: 0.5rem; z-index: 120; margin-left: auto; }
.hamburger-btn span { display: block; width: 28px; height: 3px; background-color: var(--text-color); margin: 5px 0; transition: transform 0.3s ease, opacity 0.3s ease; }
.main-nav { background-color: var(--primary-yellow); padding: 6rem 2rem 2rem 2rem; position: fixed; top: 0; right: 0; width: 300px; max-width: 90vw; height: 100%; transform: translateX(100%); transition: transform 0.3s ease-in-out; z-index: 110; display: flex; flex-direction: column; }
body.nav-open .main-nav { transform: translateX(0); }
body.nav-open .hamburger-btn span:nth-child(1) { transform: translateY(8px) rotate(45deg); }
body.nav-open .hamburger-btn span:nth-child(2) { opacity: 0; }
body.nav-open .hamburger-btn span:nth-child(3) { transform: translateY(-8px) rotate(-45deg); }
.nav-links a { font-size: 2.25rem; font-weight: 800; line-height: 1.2; text-decoration: none; color: var(--text-color); margin-bottom: 1rem; display: block; }

/* --- Main Layout & Content --- */
.content-wrapper { max-width: 1200px; margin: 0 auto; padding: 1rem 1.5rem; display: grid; grid-template-columns: 1fr; gap: 2rem; }
.articles-grid { display: grid; grid-template-columns: 1fr; gap: 2rem; }

/* FIX: This prevents grid children from expanding past their container */
.main-content, .sidebar {
    min-width: 0;
}

/* --- UPDATED: Article Cards with White Background & Shadow --- */
.article-card {
    background-color: var(--card-background);
    padding: 1.5rem;
    text-decoration: none;
    color: var(--text-color);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    box-shadow: 0 4px 6px -1px rgb(0 0 0 / 0.05), 0 2px 4px -2px rgb(0 0 0 / 0.05);
}
.article-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 15px -3px rgb(0 0 0 / 0.07), 0 4px 6px -4px rgb(0 0 0 / 0.07);
}
.article-card.is-featured { grid-column: 1 / -1; }
.article-card img { width: 100%; height: auto; aspect-ratio: 16 / 10; object-fit: cover; margin-bottom: 1rem; }
.article-card .meta { font-size: 0.8rem; color: var(--text-muted); font-weight: 500; margin-bottom: 0.25rem; }
.article-card .meta span, .single-article-content .meta span {
    text-transform: uppercase; font-weight: 700; color: var(--text-color); background-color: var(--primary-yellow); padding: 3px 6px;
}
.article-card h2 { font-size: 1.25rem; font-weight: 700; line-height: 1.3; }
.article-card.is-featured h2 { font-size: 2rem; }

/* --- UPDATED: Sidebar with White Background & Shadow --- */
.sidebar-widget {
    background-color: var(--card-background);
    padding: 1.5rem;
    margin-bottom: 2rem;
    box-shadow: 0 4px 6px -1px rgb(0 0 0 / 0.05), 0 2px 4px -2px rgb(0 0 0 / 0.05);
}
.widget-title { font-size: 1.25rem; font-weight: 700; margin-bottom: 1rem; }
.sidebar-widget ul { list-style: none; padding: 0; margin: 0; }
.sidebar-widget ul a { font-weight: 500; color: var(--text-color); text-decoration: none; display: inline; transition: background-color 0.2s ease; }
.sidebar-widget ul a:hover { background-color: var(--primary-yellow); }

/* --- UPDATED: Single Article Page with White Background & Shadow --- */
.single-article-content {
    background-color: var(--card-background);
    padding: 1.5rem;
    box-shadow: 0 4px 6px -1px rgb(0 0 0 / 0.05), 0 2px 4px -2px rgb(0 0 0 / 0.05);
}
.single-article-content h1 { font-size: 2rem; font-weight: 800; line-height: 1.2; margin-bottom: 1rem; }
.single-article-content .meta { color: var(--text-muted); margin-bottom: 2rem; }
.single-article-content .featured-image { margin: 2rem 0; overflow: hidden; }
.single-article-content .article-body { font-size: 1.1rem; line-height: 1.7; }
.single-article-content .article-body p { margin-bottom: 1.5rem; }

/* --- NEW: Styling for the Get Featured/Chat Page --- */
.page-box { /* Wrapper for advertise/submit pages */
    background: var(--card-background);
    padding: 1.5rem;
    box-shadow: 0 4px 6px -1px rgb(0 0 0 / 0.05), 0 2px 4px -2px rgb(0 0 0 / 0.05);
}
#chat-container { border: 1px solid #e5e7eb; border-radius: 4px; }
#chat-form input {
    border: 1px solid #d1d5db; border-radius: 4px; padding: 0.75rem; font-family: var(--font-sans); transition: border-color 0.2s, box-shadow 0.2s;
}
#chat-form input:focus { border-color: var(--text-color); box-shadow: 0 0 0 2px var(--primary-yellow); outline: none; }
#chat-form button {
    background-color: var(--primary-yellow); color: var(--text-color); font-weight: 700; padding: 0.75rem 1.25rem; border: none; border-radius: 4px; cursor: pointer; transition: opacity 0.2s;
}
#chat-form button:hover { opacity: 0.85; }

/* --- NEW: Solid Footer --- */
.site-footer {
    background-color: #fff; /* Dark background */
    color: #9ca3af; /* Light grey text */
    margin-top: 3rem;
    padding: 3rem 1.5rem;
}
.footer-grid {
    max-width: 1200px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 2rem;
}
@media (min-width: 768px) { .footer-grid { grid-template-columns: repeat(4, 1fr); } }
.footer-column h3 {
    font-size: 0.875rem;
    font-weight: 700;
    
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 1rem;
}
.footer-column ul { list-style: none; padding: 0; margin: 0; space-y: 0.5rem; }
.footer-column a { color: inherit; text-decoration: none; transition: color 0.2s; }
.footer-column a:hover {  }
.footer-bottom {
    max-width: 1200px;
    margin: 2rem auto 0 auto;
    padding-top: 2rem;
    border-top: 1px solid #374151;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    font-size: 0.875rem;
}
@media (min-width: 768px) {
    .footer-bottom { flex-direction: row; justify-content: space-between; }
}
.footer-bottom-links a { margin: 0 0.5rem; }

/* --- Desktop Styles --- */
@media (min-width: 768px) { .articles-grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1024px) {
    .content-wrapper { grid-template-columns: 2fr 1fr; gap: 3rem; padding: 2rem 1.5rem; }
    .content-wrapper.full-width { grid-template-columns: 1fr; } /* For advertise/submit pages */
    .single-article-content { padding: 2.5rem; }
    .single-article-content h1 { font-size: 3rem; }
    .hamburger-btn { display: none; }
    .desktop-nav { display: flex; }
}

/* --- Core Setup, Variables, & Layout Fixes --- */
/* ... all the existing CSS from the previous step remains the same ... */
/* ... scroll down to the very end of the file and replace the old chat styles with these ... */

/* --- NEW & IMPROVED: Styling for the Get Featured/Chat Page --- */
.get-featured-page h1 {
    font-size: 2.5rem; font-weight: 800; margin-bottom: 1rem;
}
.get-featured-page p {
    color: var(--text-muted); line-height: 1.6;
}
.get-featured-page a {
    color: #2563eb; font-weight: 500; text-decoration: none;
}
.get-featured-page a:hover {
    text-decoration: underline;
}

/* Chat Window Styling */
.chat-window {
    margin-top: 2rem;
    border: 1px solid #e5e7eb;
    display: flex;
    flex-direction: column;
    height: 60vh; /* Give the chat window a fixed height */
    background-color: white;
}
.chat-history {
    flex-grow: 1;
    padding: 1.5rem;
    overflow-y: auto; /* Allows scrolling of messages */
    display: flex;
    flex-direction: column;
    gap: 1rem;
}
.chat-bubble {
    padding: 0.75rem 1.25rem;
    border-radius: 1.25rem;
    max-width: 80%;
    line-height: 1.5;
}
.chat-bubble.ai {
    background-color: #f3f4f6; /* Light grey for AI */
    color: var(--text-color);
    align-self: flex-start; /* AI messages on the left */
    border-bottom-left-radius: 0.25rem; /* Classic chat bubble look */
}
.chat-bubble.user {
    background-color: #fff; /* Blue for user */
    color: white;
    align-self: flex-end; /* User messages on the right */
    border-bottom-right-radius: 0.25rem; /* Classic chat bubble look */
}

.chat-form {
    display: flex;
    gap: 0.5rem;
    padding: 1rem;
    border-top: 1px solid #e5e7eb;
}
#chat-input {
    flex-grow: 1;
    border: 1px solid #d1d5db;
    border-radius: 0.375rem;
    padding: 0.75rem 1rem;
    font-family: var(--font-sans);
    font-size: 1rem;
}
#chat-submit {
    background-color: var(--primary-yellow);
    color: var(--text-color);
    font-weight: 700;
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 0.375rem;
    cursor: pointer;
}

.generate-story-area {
    margin-top: 1rem;
}
#generate-story-btn {
    background-color: transparent;
    color: var(--text-muted);
    font-weight: 500;
    padding: 0.75rem 1.5rem;
    border: 1px solid #d1d5db;
    border-radius: 0.375rem;
    cursor: pointer;
}
#generate-story-btn:hover:not(:disabled) {
    border-color: var(--text-color);
    color: var(--text-color);
}
#generate-story-btn:disabled {
    opacity: 0.5; cursor: not-allowed;
}

.single-article-content .featured-image img {
    width: 100%; /* Make the image fill the container's width */
    height: auto; /* Maintain the aspect ratio */
    display: block; /* Removes any extra space below the image */
}

/* Review & Submit Section Styling (No change from before, but included for completeness) */
.review-section { margin-top: 4rem; padding-top: 2rem; border-top: 1px solid #e5e7eb; }
.review-section h2 { font-size: 2rem; font-weight: 800; margin-bottom: 2rem; }
#submission-form .form-group { margin-bottom: 1.5rem; }
#submission-form label { display: block; font-weight: 700; margin-bottom: 0.5rem; }
#submission-form input[type="text"], #submission-form textarea { width: 100%; border: 1px solid #d1d5db; border-radius: 0.375rem; padding: 0.75rem 1rem; font-family: var(--font-sans); font-size: 1rem; }
#submission-form textarea { min-height: 150px; }
#submission-form .form-actions button { background-color: transparent; color: var(--text-muted); font-weight: 500; padding: 0.75rem 1.5rem; border: 1px solid #d1d5db; border-radius: 0.375rem; cursor: pointer; margin-right: 0.5rem; }
#submission-form .form-actions button[type="submit"] { border-color: var(--text-color); color: var(--text-color); }


/* --- NEW: Pagination Styling --- */
.pagination {
    grid-column: 1 / -1; /* Make it span the full width of the grid */
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem;
    margin-top: 2rem;
    border-top: 1px solid #e5e7eb;
}
.pagination-link {
    font-weight: 700;
    color: var(--text-color);
    text-decoration: none;
    padding: 8px 16px;
    transition: background-color 0.2s ease;
}
.pagination-link:hover {
    background-color: var(--primary-yellow);
}