/* General Body Styles */
body {
    font-family: 'Helvetica Neue', Arial, sans-serif;
    margin: 0;
    padding: 0;
    background-color: #FFFFFF;
    color: #2A2A2A;
    line-height: 1.6;
}

/* Header Styles */
header {
    background-color: #FFFFFF;
    padding: 1rem 2rem;
    text-align: center;
    border-bottom: 1px solid #e0e0e0;
}

header h1 {
    margin: 0;
    color: #FF6161;
    font-size: 2.5rem;
}

header p {
    margin: 0 0 1rem 0;
    color: #555;
    font-size: 1.1rem;
}

/* Header Bottom Wrapper */
.header-bottom {
    display: flex;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
    gap: 2rem;
}

/* Main Nav */
.main-nav {}

/* Dropdown Navigation Styles */
.main-nav ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.main-nav ul li {
    display: inline-block;
    position: relative;
    margin: 0 10px 0 0;
}

.main-nav a {
    text-decoration: none;
    color: #5586FF;
    font-weight: bold;
    font-size: 1.1rem;
    padding: 10px;
    display: block;
    transition: color 0.3s ease;
}

.main-nav > ul > li > a:hover {
    color: #6DCCC4;
}

/* Search Form Styles */
.search-form {
    display: flex;
    align-items: center;
}

.search-form input[type="search"] {
    border: 1px solid #ccc;
    padding: 8px 12px;
    font-size: 1rem;
    border-radius: 8px;
    outline: none;
    min-width: 200px;
    transition: border-color 0.3s ease;
}

.search-form input[type="search"]:focus {
    border-color: #5586FF;
}

.search-form button {
    padding: 8px 12px;
    margin-left: 8px;
    border: 1px solid #5586FF;
    background-color: #5586FF;
    color: white;
    cursor: pointer;
    border-radius: 8px;
    transition: background-color 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.search-form button:hover {
    background-color: #4477ee;
}

.search-form button svg {
    display: block;
}


.dropdown-menu {
    display: none;
    position: absolute;
    left: 0;
    top: 100%;
    background-color: #FFFFFF;
    border: 1px solid #ddd;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    list-style: none;
    padding: 0;
    margin: 0;
    min-width: 180px;
    z-index: 100;
    text-align: left;
}

.dropdown-menu li {
    display: block;
    width: 100%;
}

.dropdown-menu a {
    font-weight: normal;
    text-align: left;
    padding: 10px 15px;
    color: #5586FF;
}

.dropdown:hover .dropdown-menu {
    display: block;
}

.dropdown-menu a:hover {
    background-color: #f8f9fa;
    color: #6DCCC4;
}

/* Top Offer Bar Styles */
.top-offer-bar {
    background-color: #6DCCC4;
    color: white;
    text-align: center;
    padding: 0.5rem 1rem;
}

.top-offer-bar p {
    margin: 0;
    font-weight: bold;
    font-size: 1.1rem;
}

/* Social Icons Styles */
.social-icons {
    text-align: center;
    padding: 1rem 1rem;
}

.social-icons a {
    display: inline-block;
    align-items: center;
    justify-content: center;
    margin: 0 10px;
    transition: color 0.3s ease;
    vertical-align: middle;
}

.social-icons a:hover {
    opacity: 0.8;
}

.social-icons img {
    height: 30px;
    width: auto;
    display: block; /* Removes any extra space below the image */
}

/* Main Content Styles */
main {
    max-width: 1200px;
    margin: 2rem auto;
    padding: 0 2rem;
}

/* Category Section Styles */
.category-section {
    background-color: transparent;
    padding: 0;
    border-radius: 0;
    box-shadow: none;
}

.category-section .page-header h1 {
    font-size: 2.8rem;
    text-align: center;
    margin-top: 0;
    margin-bottom: 1rem;
    color: #FF6161; /* Primary Red */
}

.category-section .page-header p {
    font-size: 1.2rem;    
    text-align: center;
    color: #555;
    margin-bottom: 2rem;
}

.category-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
}

.category-tile {
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    text-align: center;
    padding-bottom: 1rem;
    background-color: #FFFFFF;
    overflow: hidden;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.category-tile:hover {
    transform: translateY(-5px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}

.category-tile img {
    width: 100%;
    height: 150px;
    object-fit: cover;
    background-color: #f0f0f0;
}

.category-tile h3 {
    margin: 1rem 0 0 0;
    font-weight: bold;
}

/* Applying repeating colors to all category tiles */
.category-grid .category-tile:nth-child(4n + 1) h3 { color: #5586FF; } /* Blue */
.category-grid .category-tile:nth-child(4n + 2) h3 { color: #FECB00; } /* Yellow */
.category-grid .category-tile:nth-child(4n + 3) h3 { color: #6DCCC4; } /* Green */
.category-grid .category-tile:nth-child(4n + 4) h3 { color: #FF6161; } /* Red */


/* Footer Styles */
footer {
    padding: 2rem 1rem;
    margin-top: 2rem;
    background-color: #6DCCC4;
    color: #FFFFFF;
}

.footer-menus {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 4rem;
    margin-bottom: 2rem;
    text-align: left;
}

.footer-menu-block h3 {
    margin-top: 0;
    margin-bottom: 1rem;
    font-size: 1.2rem;
}

.footer-menu-block ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.footer-menu-block li {
    margin-bottom: 0.5rem;
}

.footer-menu-block a {
    text-decoration: none;
    color: white;
    transition: opacity 0.3s ease;
}

.footer-menu-block a:hover {
    opacity: 0.8;
}

.copyright-notice {
    text-align: center;
    padding-top: 2rem;
    border-top: 1px solid rgba(255, 255, 255, 0.3);
}

.copyright-notice p {
    margin: 0;
}

/* ====================================================== */
/* SINGLE PAGE STYLES                                     */
/* ====================================================== */

.coloring-page .page-header {
    text-align: center;
    margin-bottom: 2rem;
}

.coloring-page .page-header h1 {
    font-size: 2.8rem;
    color: #FF6161; /* Primary Red */
    margin-bottom: 0.5rem;
}

.coloring-page .page-header p {
    font-size: 1.2rem;
    color: #555;
    max-width: 800px;
    margin: 0 auto;
}

.page-content {
    display: flex;
    flex-wrap: wrap;
    gap: 2rem;
    justify-content: center;
}

.coloring-image-container {
    flex: 2; /* Takes up more space */
    min-width: 300px;
    text-align: center;
}

.coloring-image-container img {
    max-width: 100%;
    border: 1px solid #ddd;
    border-radius: 8px;
}

.download-and-meta {
    flex: 1; /* Takes up less space */
    min-width: 250px;
}

/* --- UPDATED: Download Button Style --- */
.download-button {
    display: inline-block; /* Changed to inline-block to allow it to center properly */
    width: auto; /* Allow button to size to its content */
    background-color: #6DCCC4; /* Teal background */
    color: white;
    text-align: center;
    padding: 1rem 2.5rem; /* More padding for a better look */
    font-size: 1.5rem;
    font-weight: bold;
    text-decoration: none;
    border-radius: 8px; /* Rounded edges */
    margin-bottom: 2rem;
    transition: background-color 0.3s ease;
    border: none; /* Ensure no default border */
}

.download-button:hover {
    background-color: #5aa99d; /* A slightly darker teal for mouseover effect */
}


.meta-section {
    margin-bottom: 1.5rem;
}

.meta-section h3 {
    margin-top: 0;
    margin-bottom: 0.5rem;
    border-bottom: 2px solid #f0f0f0;
    padding-bottom: 0.5rem;
}

.meta-tags a, .meta-tags .tag {
    display: inline-block;
    background-color: #f0f0f0;
    padding: 5px 12px;
    margin: 4px;
    border-radius: 15px;
    font-size: 0.9rem;
    text-decoration: none;
    color: #333;
}

.meta-tags a:hover {
    background-color: #e0e0e0;
}

.not-found {
    text-align: center;
    padding: 4rem 1rem;
}

/* ====================================================== */
/* UNIFIED GRID AND TILE STYLES (CORRECTED)               */
/* ====================================================== */

/* This is the main grid container used on ALL pages */
.category-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1.5rem;
}

/* A general style for ANY tile inside the grid */
.category-grid > div {
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    text-align: center;
    background-color: #FFFFFF;
    overflow: hidden;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    padding-bottom: 1rem;
}

.category-grid > div:hover {
    transform: translateY(-5px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}

.category-grid > div a {
    text-decoration: none;
    color: inherit;
    display: block;
}

/* Style for generic category tiles (used on search and category pages) */
.category-tile img {
    width: 100%;
    height: 150px;
    object-fit: cover;
    background-color: #f0f0f0;
}

.category-tile h3 {
    margin: 1rem 0 0 0;
    font-weight: bold;
}


/* Style for the MAIN category tiles on the homepage */
.main-category-tile {
    border-color: #FF6161; /* Primary red border */
    border-width: 2px;
}

.main-category-tile img {
    width: 100%;
    height: 150px;
    object-fit: cover;
    background-color: #f0f0f0;
}

.main-category-tile h3 {
    margin: 1rem 0 0 0;
    font-weight: bold;
    color: #FF6161; /* Match the border */
    font-size: 1.5rem;
}

/* Style for the SUB-category tiles on the homepage */
.subcategory-tile {
    border-color: #ccc; /* More subtle border */
}

.subcategory-tile img {
    width: 100%;
    height: 120px; /* Slightly smaller image */
    object-fit: cover;
    background-color: #f0f0f0;
}

.subcategory-tile h4 { 
    margin: 1rem 0 0 0;
    font-weight: bold;
    color: #5586FF; /* blue */
    font-size: 1.5rem;
}

/* ====================================================== */
/* AD BLOCK STYLES                                        */
/* ====================================================== */

.ad-block-container {
    width: 100%;
    margin: 2rem 0; /* Add space above and below the ad block */
    text-align: center; /* Horizontally centers the content inside */
}

/* ====================================================== */
/* SINGLE PAGE CENTERING CORRECTION                       */
/* ====================================================== */

/* Ensure the main centered container uses text-align center for its children */
.page-content-centered {
    max-width: 800px;
    margin: 0 auto;
    text-align: center; 
}

/* This is the key fix: Center the block that holds the button and meta info */
.download-and-meta {
    /* No need to set width, let it be natural */
    margin-left: auto;
    margin-right: auto;
    margin-top: 2rem;
    text-align: center; /* Ensure content inside this block is also centered */
}

/* The button styling is mostly correct, just ensure it's inline-block */
.download-button {
    display: inline-block; /* This allows it to be centered by the parent's text-align:center */
    width: auto;
    background-color: #6DCCC4; /* Teal */
    color: white;
    text-align: center;
    padding: 1rem 2.5rem;
    font-size: 1.5rem;
    font-weight: bold;
    text-decoration: none;
    border-radius: 8px;
    margin-bottom: 2rem;
    transition: background-color 0.3s ease;
    border: none;
}

.download-button:hover {
    background-color: #5aa99d;
}


/* The meta sections and their content should also be centered */
.meta-section {
    margin-bottom: 1.5rem;
    text-align: center; /* Force centering */
}

.meta-section h3 {
    margin-top: 0;
    margin-bottom: 0.5rem;
    border-bottom: 2px solid #f0f0f0;
    padding-bottom: 0.5rem;
    display: inline-block; /* Allows the border to fit the text width */
    width: auto;
}

.meta-tags {
    text-align: center; /* Center the container of tags/categories */
}

.meta-tags a, .meta-tags .tag {
    display: inline-block;
    background-color: #f0f0f0;
    padding: 5px 12px;
    margin: 4px;
    border-radius: 15px;
    font-size: 0.9rem;
    text-decoration: none;
    color: #333;
}

/* ====================================================== */
/* CATEGORY PAGE TITLE STYLES                             */
/* ====================================================== */

.category-page-title {
    text-align: center;
    color: #FF6161; /* Primary Red */
    margin-bottom: 2rem; /* Add some space below the title */
    font-size: 2.8rem; /* Make it consistent with the single page title */
}

/* ====================================================== */
/* 350x350 SQUARE TILE STYLES                             */
/* ====================================================== */

/* Update the main grid to better accommodate larger tiles */
.category-grid {
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr)); /* Minimum size is now 350px */
    gap: 1.5rem;
}

/* This targets ALL tiles in ANY grid: category, search, sub-category, etc. */
.category-grid .category-tile,
.category-grid .main-category-tile,
.category-grid .subcategory-tile {
    width: 350px; /* Set a fixed width */
    margin: 0 auto; /* Center the tile within its grid column if there's extra space */
}

/* This targets the image inside ANY tile */
.category-grid .category-tile img,
.category-grid .main-category-tile img,
.category-grid .subcategory-tile img {
    height: 350px; /* Set a fixed height */
    width: 100%;    /* Make the image fill the container's width */
    object-fit: cover; /* THIS IS THE MAGIC! It crops the image to fit without stretching */
    background-color: #f0f0f0;
}

/* We no longer need different image heights for sub-category tiles */
.subcategory-tile img {
    height: 350px;
}

/* ====================================================== */
/* TEXT PAGE STYLES - ABOUT, CONTACT, ADVERTISE, PRIVACY POLICY, TOS, ETC */
/* ====================================================== */

.text-page .page-header h1 {
font-size: 2.8rem; 
text-align: center; 
margin-top: 0; 
margin-bottom: 1rem; 
color: #FF6161; /\* Primary Red \*/
}

.text-page .page-header p {
font-size: 1.2rem; 
text-align: center; 
color: #555; 
margin-bottom: 2rem;
}

.text-page .page-body p {
font-size: 1.2rem;
color: #555;
margin-bottom: 2rem;


