/*
Theme Name: Tools Grid Theme
Description: A complete responsive grid-style WordPress theme for tools websites with search functionality, AdSense integration, and SEO optimization.
Author: Tools Theme Developer
Version: 1.0.0
License: GPL v2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: tools-grid-theme
Tags: grid-layout, responsive, clean, tools, adsense-ready, seo-friendly
*/

/* CSS Reset */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    font-size: 16px;
    line-height: 1.6;
}

body {
    font-family: 'Arial', sans-serif;
    color: #333;
    background-color: #f8f9fa;
    line-height: 1.6;
}

a {
    text-decoration: none;
    color: inherit;
}

img {
    max-width: 100%;
    height: auto;
}

/* Container */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Header Styles */
.site-header {
    background: #fff;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    position: sticky;
    top: 0;
    z-index: 1000;
    padding: 15px 0;
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
}

.site-logo h1 {
    font-size: 2rem;
    color: #007cba;
    margin: 0;
}

.site-logo a {
    color: #007cba;
    text-decoration: none;
}

.site-logo a:hover {
    color: #005a87;
}

/* Navigation */
.main-navigation {
    display: flex;
    align-items: center;
}

.main-navigation ul {
    display: flex;
    list-style: none;
    margin: 0;
    padding: 0;
    gap: 25px;
}

.main-navigation a {
    color: #333;
    font-weight: 500;
    padding: 10px 0;
    transition: color 0.3s ease;
}

.main-navigation a:hover {
    color: #007cba;
}

/* Search Form */
.header-search {
    margin-left: 20px;
}

.search-form {
    display: flex;
    position: relative;
}

.search-form input[type="search"] {
    padding: 10px 45px 10px 15px;
    border: 2px solid #007cba;
    border-radius: 25px;
    width: 250px;
    font-size: 14px;
    outline: none;
}

.search-form input[type="search"]:focus {
    border-color: #005a87;
    box-shadow: 0 0 5px rgba(0, 124, 186, 0.3);
}

.search-form button {
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    background: #007cba;
    color: white;
    border: none;
    border-radius: 50%;
    width: 32px;
    height: 32px;
    cursor: pointer;
    font-size: 14px;
}

.search-form button:hover {
    background: #005a87;
}

/* Main Content */
.main-content {
    padding: 40px 0;
}

/* Ad Spaces */
.ad-header {
    text-align: center;
    margin: 20px 0;
    padding: 20px;
    background: #f1f3f4;
    border: 2px dashed #ddd;
    border-radius: 8px;
    min-height: 100px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #666;
}

.ad-sidebar {
    margin: 20px 0;
    padding: 20px;
    background: #f1f3f4;
    border: 2px dashed #ddd;
    border-radius: 8px;
    min-height: 300px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #666;
}

.ad-between-content {
    text-align: center;
    margin: 40px 0;
    padding: 20px;
    background: #f1f3f4;
    border: 2px dashed #ddd;
    border-radius: 8px;
    min-height: 120px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #666;
}

/* Tools Grid Layout */
.tools-container {
    display: flex;
    gap: 30px;
}

.tools-main {
    flex: 1;
}

.tools-sidebar {
    width: 300px;
}

.tools-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 25px;
    margin: 30px 0;
}

.tool-card {
    background: #fff;
    border-radius: 12px;
    padding: 25px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.08);
    transition: all 0.3s ease;
    border: 1px solid #e9ecef;
    text-align: center;
}

.tool-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 15px 35px rgba(0,0,0,0.15);
}

.tool-icon {
    width: 70px;
    height: 70px;
    margin: 0 auto 20px;
    background: linear-gradient(135deg, #007cba, #005a87);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 28px;
    font-weight: bold;
}

.tool-card h3 {
    margin-bottom: 15px;
    font-size: 1.4rem;
    color: #333;
    font-weight: 600;
}

.tool-card h3 a {
    color: #333;
    transition: color 0.3s ease;
}

.tool-card h3 a:hover {
    color: #007cba;
}

.tool-description {
    color: #666;
    margin-bottom: 20px;
    line-height: 1.6;
    font-size: 14px;
}

.tool-button {
    display: inline-block;
    background: linear-gradient(135deg, #007cba, #005a87);
    color: white;
    padding: 12px 25px;
    border-radius: 25px;
    font-weight: 500;
    transition: all 0.3s ease;
    border: none;
    cursor: pointer;
}

.tool-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 124, 186, 0.4);
}

.tool-meta {
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px solid #eee;
    font-size: 12px;
    color: #888;
}

/* No Posts Found */
.no-posts {
    text-align: center;
    padding: 60px 20px;
    background: #fff;
    border-radius: 12px;
    margin: 30px 0;
}

.no-posts h2 {
    color: #333;
    margin-bottom: 15px;
    font-size: 1.8rem;
}

.no-posts p {
    color: #666;
    font-size: 16px;
}

/* Pagination Styles */
.pagination-wrapper {
    margin: 50px 0 30px;
    text-align: center;
}

.pagination {
    display: inline-flex;
    list-style: none;
    gap: 8px;
    margin: 0;
    padding: 0;
    align-items: center;
    flex-wrap: wrap;
    justify-content: center;
}

.pagination li {
    margin: 0;
}

.pagination a,
.pagination span {
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 45px;
    height: 45px;
    padding: 0 15px;
    background: #fff;
    border: 2px solid #007cba;
    border-radius: 8px;
    color: #007cba;
    font-weight: 500;
    transition: all 0.3s ease;
    text-decoration: none;
}

.pagination a:hover {
    background: #007cba;
    color: white;
    transform: translateY(-2px);
}

.pagination .current span {
    background: #007cba;
    color: white;
}

.pagination .prev,
.pagination .next {
    padding: 0 20px;
}

/* Sidebar Styles */
.sidebar {
    background: #fff;
    border-radius: 12px;
    padding: 25px;
    margin-bottom: 30px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.08);
}

.widget {
    margin-bottom: 30px;
}

.widget:last-child {
    margin-bottom: 0;
}

.widget-title {
    font-size: 1.3rem;
    color: #333;
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 2px solid #007cba;
    font-weight: 600;
}

.widget ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.widget ul li {
    padding: 8px 0;
    border-bottom: 1px solid #eee;
}

.widget ul li:last-child {
    border-bottom: none;
}

.widget ul li a {
    color: #666;
    transition: color 0.3s ease;
}

.widget ul li a:hover {
    color: #007cba;
}

/* Footer Styles */
.site-footer {
    background: #2c3e50;
    color: #ecf0f1;
    padding: 50px 0 30px;
    margin-top: 60px;
}

.footer-content {
    text-align: center;
}

.footer-widgets {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 30px;
    margin-bottom: 40px;
}

.footer-widget h4 {
    color: #007cba;
    margin-bottom: 15px;
    font-size: 1.2rem;
}

.footer-info {
    padding-top: 30px;
    border-top: 1px solid #34495e;
    color: #bdc3c7;
}

.footer-info p {
    margin: 5px 0;
}

/* Responsive Design */
@media (max-width: 1024px) {
    .tools-container {
        flex-direction: column;
    }
    
    .tools-sidebar {
        width: 100%;
    }
    
    .tools-grid {
        grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
        gap: 20px;
    }
}

@media (max-width: 768px) {
    .header-content {
        flex-direction: column;
        gap: 20px;
    }
    
    .main-navigation ul {
        flex-wrap: wrap;
        justify-content: center;
        gap: 15px;
    }
    
    .search-form input[type="search"] {
        width: 200px;
    }
    
    .tools-grid {
        grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
        gap: 20px;
    }
    
    .container {
        padding: 0 15px;
    }
    
    .main-content {
        padding: 20px 0;
    }
    
    .pagination {
        gap: 5px;
    }
    
    .pagination a,
    .pagination span {
        min-width: 40px;
        height: 40px;
        font-size: 14px;
    }
}

@media (max-width: 480px) {
    .site-logo h1 {
        font-size: 1.5rem;
    }
    
    .search-form input[type="search"] {
        width: 180px;
    }
    
    .tools-grid {
        grid-template-columns: 1fr;
    }
    
    .tool-card {
        padding: 20px;
    }
    
    .pagination a,
    .pagination span {
        min-width: 35px;
        height: 35px;
        padding: 0 10px;
    }
}

/* Single Post Styles */
.single-post {
    background: #fff;
    border-radius: 12px;
    padding: 40px;
    margin: 30px 0;
    box-shadow: 0 5px 15px rgba(0,0,0,0.08);
}

.post-title {
    font-size: 2.5rem;
    color: #333;
    margin-bottom: 20px;
    text-align: center;
}

.post-meta {
    text-align: center;
    margin-bottom: 30px;
    color: #666;
    font-size: 14px;
}

.post-content {
    line-height: 1.8;
    font-size: 16px;
}

.post-content h2,
.post-content h3,
.post-content h4 {
    color: #333;
    margin: 30px 0 15px;
}

.post-content p {
    margin-bottom: 20px;
}

/* Search Results */
.search-results-title {
    background: #fff;
    padding: 30px;
    margin-bottom: 30px;
    border-radius: 12px;
    text-align: center;
    box-shadow: 0 5px 15px rgba(0,0,0,0.08);
}

.search-results-title h1 {
    color: #333;
    font-size: 2rem;
    margin-bottom: 10px;
}

.search-query {
    color: #007cba;
    font-weight: 600;
}

/* Accessibility */
.screen-reader-text {
    clip: rect(1px, 1px, 1px, 1px);
    position: absolute !important;
    height: 1px;
    width: 1px;
    overflow: hidden;
}

/* Print Styles */
@media print {
    .site-header,
    .site-footer,
    .pagination-wrapper,
    .ad-header,
    .ad-sidebar,
    .ad-between-content {
        display: none;
    }
}
