/* --- Global Styles --- */
:root { 
    --yt-red: #FF0000; 
    --dark-bg-1: #121212; 
    --dark-bg-2: #1e1e1e; 
    --dark-bg-3: #282828; 
    --text-light: #f1f1f1; 
    --text-mid: #aaaaaa; 
    --text-dark: #777; 
}
* { 
    box-sizing: border-box; 
    margin: 0; 
    padding: 0; 
}
html, body { 
    height: 100%; 
}
body { 
    font-family: 'Roboto', sans-serif; 
    background-color: var(--dark-bg-1); 
    color: var(--text-light); 
    display: flex; 
    flex-direction: column; 
    justify-content: flex-start; 
    align-items: center; 
    padding-top: 40px; 
    min-height: 100vh; 
}
main { 
    width: 100%; 
    display: flex; 
    justify-content: center; 
    flex-grow: 1; /* Makes main content take available space */
}
.container { 
    width: 90%; 
    max-width: 1000px; 
    margin: 0 auto; 
    padding: 25px; 
    background-color: var(--dark-bg-2); 
    border-radius: 12px; 
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5); 
    text-align: center; 
    margin-bottom: 20px; 
}
h1 { 
    color: var(--yt-red); 
    font-weight: 700; 
    font-size: 2.2rem; 
    margin-bottom: 10px; 
}
h2 { 
    color: var(--yt-red); 
    font-size: 1.8rem; 
    margin-bottom: 15px; 
    padding-bottom: 5px; 
    text-align: left; 
    border-bottom: 1px solid #333; 
}
p { 
    font-size: 1.1rem; 
    color: var(--text-mid); 
    margin-bottom: 25px; 
}

/* --- Main App (youtube_thumbnail_downloader.html) --- */
#thumbnailForm { 
    display: flex; 
    flex-direction: column; 
    gap: 10px; 
    margin-bottom: 30px; 
}
@media (min-width: 640px) { 
    #thumbnailForm { flex-direction: row; } 
}
#youtubeUrl { 
    flex-grow: 1; 
    padding: 14px 18px; 
    font-size: 1rem; 
    border: 2px solid #333; 
    border-radius: 8px; 
    background-color: var(--dark-bg-3); 
    color: var(--text-light); 
    outline: none; 
    transition: border-color 0.3s ease; 
}
#youtubeUrl:focus { 
    border-color: var(--yt-red); 
}
#thumbnailForm button { 
    padding: 14px 25px; 
    font-size: 1rem; 
    font-weight: 500; 
    color: #ffffff; 
    background-color: var(--yt-red); 
    border: none; 
    border-radius: 8px; 
    cursor: pointer; 
    transition: background-color 0.3s ease, transform 0.1s ease; 
}
#thumbnailForm button:hover { 
    background-color: #cc0000; 
}
.loader { 
    display: none; 
    margin: 20px auto; 
    border: 5px solid #333; 
    border-top: 5px solid var(--yt-red); 
    border-radius: 50%; 
    width: 50px; 
    height: 50px; 
    animation: spin 1s linear infinite; 
}
@keyframes spin { 
    0% { transform: rotate(0deg); } 
    100% { transform: rotate(360deg); } 
}
.error-message { 
    display: none; 
    padding: 12px; 
    margin-top: 20px; 
    color: #ffcccc; 
    background-color: rgba(255, 0, 0, 0.15); 
    border: 1px solid #ff3333; 
    border-radius: 8px; 
}
.results-grid { 
    display: grid; 
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); 
    gap: 20px; 
    margin-top: 20px; 
    min-height: 150px; 
}
.thumbnail-card { 
    background-color: var(--dark-bg-3); 
    border-radius: 12px; 
    overflow: hidden; 
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4); 
    display: flex; 
    flex-direction: column; 
    transition: transform 0.3s ease, box-shadow 0.3s ease; 
}
.thumbnail-card:hover { 
    transform: translateY(-5px); 
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.5); 
}
.thumbnail-card img { 
    width: 100%; 
    height: auto; 
    display: block; 
    background-color: var(--dark-bg-1); 
    aspect-ratio: 16 / 9; 
    object-fit: cover; 
}
.card-content { 
    padding: 15px; 
    flex-grow: 1; 
    display: flex; 
    flex-direction: column; 
    text-align: left; 
}
.card-content h3 { 
    font-size: 1.1rem; 
    font-weight: 500; 
    color: var(--text-light); 
    margin-bottom: 5px; 
}
.card-content p { 
    font-size: 0.9rem; 
    color: var(--text-mid); 
    margin-bottom: 15px; 
    flex-grow: 1; 
}
.download-btn { 
    display: block; 
    width: 100%; 
    padding: 12px; 
    font-size: 0.95rem; 
    font-weight: 500; 
    text-align: center; 
    text-decoration: none; 
    color: var(--dark-bg-2); 
    background-color: var(--text-light); 
    border: none; 
    border-radius: 8px; 
    cursor: pointer; 
    transition: background-color 0.3s ease; 
}
.download-btn:hover { 
    background-color: #cccccc; 
}
.download-btn:disabled { 
    background-color: #555; 
    color: #999; 
    cursor: not-allowed; 
}
.recent-thumbnail-card { 
    cursor: pointer; 
}
.recent-thumbnail-card .card-content h3 { 
    white-space: nowrap; 
    overflow: hidden; 
    text-overflow: ellipsis; 
    font-size: 1rem; 
}
.recent-thumbnail-card .card-content p { 
    font-size: 0.85rem; 
    margin-bottom: 0; 
}
#all-thumbnails-page { 
    display: none; 
}
.nav-button { 
    padding: 12px 25px; 
    font-size: 1rem; 
    font-weight: 500; 
    color: var(--dark-bg-2); 
    background-color: var(--text-light); 
    border: none; 
    border-radius: 8px; 
    cursor: pointer; 
    transition: background-color 0.3s ease; 
    text-decoration: none; 
    display: inline-block; 
    margin-top: 20px; 
}
.nav-button:hover:not(:disabled) { 
    background-color: #cccccc; 
}
.nav-button:disabled { 
    background-color: #555; 
    color: #999; 
    cursor: not-allowed; 
}
#back-home-btn { 
    background-color: #333; 
    color: var(--text-light); 
    float: left; 
    margin-top: 0; 
    margin-bottom: 20px; 
}
#back-home-btn:hover { 
    background-color: #555; 
}
.pagination-controls { 
    display: flex; 
    justify-content: center; 
    align-items: center; 
    gap: 15px; 
    margin-top: 30px; 
}
.pagination-info { 
    color: var(--text-mid); 
    font-size: 1rem; 
}
.pagination-btn { 
    margin-top: 0; 
}
.content-section { 
    text-align: left; 
    margin-top: 40px; 
    padding-top: 20px; 
    border-top: 1px solid #333; 
}
.content-section h3 { 
    color: var(--text-light); 
    font-size: 1.3rem; 
    margin-top: 20px; 
    margin-bottom: 10px; 
}
.content-section p, .content-section li { 
    font-size: 1rem; 
    color: var(--text-mid); 
    line-height: 1.6; 
    margin-bottom: 15px; 
}
.content-section ol, .content-section ul { 
    padding-left: 25px; 
}
.content-section ol li { 
    margin-bottom: 10px; 
}
code { 
    background-color: #333; 
    padding: 2px 6px; 
    border-radius: 4px; 
    font-family: monospace; 
}
footer { 
    text-align: center; 
    padding: 20px; 
    color: var(--text-dark); 
    font-size: 0.9rem; 
    margin-top: 20px; 
    width: 100%; 
}
.footer-links { 
    margin-bottom: 15px; 
    display: flex; 
    flex-wrap: wrap; 
    justify-content: center; 
    gap: 20px; 
}
.footer-links a { 
    color: var(--text-mid); 
    text-decoration: none; 
    font-size: 0.95rem; 
}
.footer-links a:hover { 
    color: var(--text-light); 
    text-decoration: underline; 
}
.col-span-full { grid-column: 1 / -1; }
.text-center { text-align: center; }
.text-gray-400 { color: var(--text-mid); }
.text-red-400 { color: #ffcccc; }
.text-sm { font-size: 0.875rem; }
.truncate { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* --- NEW: Content Page Styles (About, Privacy, Blog Posts) --- */
.content-page-container {
    width: 90%; 
    max-width: 900px; 
    margin: 0 auto; 
    padding: 25px; 
    background-color: var(--dark-bg-2); 
    border-radius: 12px; 
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5); 
    margin-bottom: 20px; 
    text-align: left;
}
.content-page-container h1 {
    font-size: 2.2rem;
    margin-bottom: 20px;
    border-bottom: 1px solid #333;
    padding-bottom: 10px;
}
.content-page-container h2 {
    font-size: 1.5rem;
    color: var(--text-light);
    border-bottom: none;
    margin-top: 25px;
    margin-bottom: 10px;
}
.content-page-container p, .content-page-container li {
    font-size: 1.1rem;
    color: var(--text-mid);
    margin-bottom: 20px;
    line-height: 1.6;
}
.content-page-container ul {
    padding-left: 20px;
}
.content-page-container a {
    color: var(--yt-red);
    text-decoration: none;
}
.content-page-container a:hover {
    text-decoration: underline;
}
.content-page-container .blog-meta {
    font-size: 0.9rem;
    color: var(--text-mid);
    margin-bottom: 20px;
}
.content-page-container .back-link {
    display: inline-block;
    margin-top: 20px;
    font-weight: 500;
}

/* --- NEW: Blog Index Page (blog.html) --- */
.blog-index-container {
    list-style: none;
    padding: 0;
}
.blog-post-preview {
    background-color: var(--dark-bg-3);
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 20px;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}
.blog-post-preview:hover {
    transform: translateY(-5px); 
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.5);
}
.blog-post-preview h2 {
    border-bottom: none;
    margin-bottom: 10px;
}
.blog-post-preview h2 a {
    color: var(--yt-red);
    text-decoration: none;
    font-size: 1.5rem;
}
.blog-post-preview h2 a:hover {
    text-decoration: underline;
}
.blog-post-preview .blog-excerpt {
    color: var(--text-mid);
    margin-bottom: 15px;
}
.blog-post-preview .read-more {
    color: var(--text-light);
    text-decoration: none;
    font-weight: 500;
}
.blog-post-preview .read-more:hover {
    text-decoration: underline;
}
