/*
 Theme Name: ToolKit
 Theme URI: https://example.com/toolkit
 Author: Your Name
 Author URI: https://example.com
 Description: A professional WordPress theme for an online tools website with multiple tool categories.
 Version: 1.0.1
 License: GNU General Public License v2 or later
 License URI: http://www.gnu.org/licenses/gpl-2.0.html
 Text Domain: toolkit
 Tags: custom-post-type, tools, responsive, online-tools
*/

/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Open Sans', sans-serif;
    line-height: 1.6;
    color: #333;
}

/* Tailwind CSS CDN */
@import url('https://cdn.jsdelivr.net/npm/tailwindcss@2.2.19/dist/tailwind.min.css');

/* Header */
header.site-header {
    background: linear-gradient(90deg, #1a73e8, #0d47a1);
    color: white;
    padding: 1rem 0;
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

header .header-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: nowrap;
}

header .site-branding {
    display: flex;
    align-items: center;
    gap: 1rem;
}

header .site-logo img {
    max-height: 40px;
    width: auto;
    height: auto;
    display: block;
}

header .site-title a {
    font-size: 1.5rem;
    font-weight: 700;
    color: white;
    text-decoration: none;
    transition: opacity 0.2s ease;
}

header .site-title a:hover {
    opacity: 0.9;
}

header .search-form {
    display: flex;
    align-items: center;
    background: #ffffff;
    border-radius: 9999px;
    overflow: hidden;
    width: 100%;
    max-width: 300px; /* Adjusted to extend closer to the right end */
}

header .search-form input[type="search"] {
    padding: 0.5rem 1rem;
    border: none;
    background: transparent;
    color: #333;
    width: 100%;
    font-size: 0.875rem;
}

header .search-form input[type="search"]::placeholder {
    color: #666;
}

header .search-form input[type="search"]:focus {
    outline: none;
    box-shadow: 0 0 0 2px #1a73e8 inset;
}

header .search-form button {
    background: #1a73e8;
    color: white;
    padding: 0.5rem 1rem;
    border: none;
    border-radius: 0 9999px 9999px 0;
    cursor: pointer;
    transition: background 0.2s ease;
    font-size: 0.875rem;
}

header .search-form button:hover {
    background: #0d47a1;
}

header .nav-wrapper {
    margin-top: 1rem;
}

header .menu-toggle {
    display: none;
    background: none;
    border: none;
    color: white;
    font-size: 1.5rem;
    cursor: pointer;
    padding: 0.5rem;
}

header nav.primary-nav {
    display: block;
}

header nav ul.nav-menu {
    list-style: none;
    display: flex;
    gap: 1.5rem;
    align-items: center;
    margin: 0;
    padding: 0;
}

header nav a {
    color: white;
    text-decoration: none;
    font-size: 1rem;
    font-weight: 500;
    transition: color 0.2s ease;
}

header nav a:hover {
    color: #bbdefb;
}

header nav .menu-item-has-children {
    position: relative;
}

header nav .sub-menu {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    background: #ffffff;
    color: #333;
    min-width: 200px;
    border-radius: 4px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
    z-index: 100;
    opacity: 0;
    transform: translateY(10px);
    transition: opacity 0.2s ease, transform 0.2s ease;
}

header nav .menu-item-has-children:hover .sub-menu {
    display: block;
    opacity: 1;
    transform: translateY(0);
}

header nav .sub-menu li {
    padding: 0.75rem 1rem;
    border-bottom: 1px solid #e2e8f0;
}

header nav .sub-menu li:last-child {
    border-bottom: none;
}

header nav .sub-menu a {
    color: #333;
    font-weight: 400;
    display: block;
    text-decoration: none;
}

header nav .sub-menu a:hover {
    color: #1a73e8;
}

/* Responsive Design */
@media (max-width: 768px) {
    header .header-top {
        flex-wrap: wrap;
    }

    header .site-branding {
        flex: 1;
    }

    header .site-title a {
        font-size: 1.25rem;
    }

    header .search-form {
        width: 100%;
        max-width: 200px;
        margin-top: 0.5rem;
    }

    header .nav-wrapper {
        display: flex;
        justify-content: flex-end;
        margin-top: 0.5rem;
    }

    header .menu-toggle {
        display: block;
    }

    header nav.primary-nav {
        width: 100%;
    }

    header nav ul.nav-menu {
        display: none;
        flex-direction: column;
        gap: 0.5rem;
        background: #e3f2fd;
        padding: 1rem;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        z-index: 999;
    }

    header nav ul.nav-menu.active {
        display: flex;
    }

    header nav .sub-menu {
        position: static;
        background: #ffffff;
        opacity: 1;
        transform: none;
        width: 100%;
        box-shadow: none;
    }
}

/* Non-header styles remain unchanged */
.hero {
    background: #f8fafc;
    padding: 4rem 0;
    text-align: center;
}

.hero h1 {
    font-size: 2.5rem;
    margin-bottom: 1rem;
}

.hero p {
    font-size: 1.25rem;
    color: #666;
}

main {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem;
    display: flex;
    gap: 2rem;
}

.content-area {
    flex: 3;
}

.sidebar {
    flex: 1;
    background: #f8fafc;
    padding: 1.5rem;
    border-radius: 8px;
}

.tools-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
}

.tool-card {
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 1.5rem;
    text-align: center;
    transition: transform 0.2s;
}

.tool-card:hover {
    transform: translateY(-5px);
}

.tool-card h3 {
    font-size: 1.25rem;
    margin-bottom: 0.5rem;
}

.tool-card p {
    color: #666;
}

.tool-content {
    max-width: 800px;
    margin: 2rem auto;
}

.tool-content h1 {
    font-size: 2rem;
    margin-bottom: 1rem;
}

.tool-input {
    margin: 1rem 0;
}

.tool-input input,
.tool-input textarea {
    width: 100%;
    padding: 0.5rem;
    border: 1px solid #e2e8f0;
    border-radius: 4px;
}

.tool-output {
    background: #f8fafc;
    padding: 1rem;
    border-radius: 4px;
    margin-top: 1rem;
}

.widget {
    margin-bottom: 1.5rem;
}

.widget h3 {
    font-size: 1.2rem;
    margin-bottom: 0.5rem;
}

.widget ul {
    list-style: none;
}

.widget ul li {
    margin-bottom: 0.5rem;
}

.widget ul li a {
    color: #1a73e8;
    text-decoration: none;
}

.widget ul li a:hover {
    text-decoration: underline;
}

footer {
    background: #1a73e8;
    color: white;
    text-align: center;
    padding: 1rem 0;
    margin-top: 2rem;
}