/*
Theme Name: Toolcent Clone
Theme URI: http://example.com/toolcent-clone
Author: AI Developer
Description: A custom WordPress theme designed to replicate the functionality and sleek dark-mode aesthetics of Toolcent. Features custom post types for utility tools and an AI directory.
Version: 1.0
*/

:root {
    --bg-main: #0f172a;
    --bg-card: #1e293b;
    --text-primary: #f8fafc;
    --text-secondary: #94a3b8;
    --accent: #0ea5e9;
    --accent-hover: #0284c7;
    --border: #334155;
}

body.light-mode {
    --bg-main: #f8fafc;
    --bg-card: #ffffff;
    --text-primary: #0f172a;
    --text-secondary: #475569;
    --accent: #0ea5e9;
    --accent-hover: #0284c7;
    --border: #e2e8f0;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Inter', sans-serif;
}

body {
    background-color: var(--bg-main);
    color: var(--text-primary);
    line-height: 1.6;
}

a {
    color: var(--accent);
    text-decoration: none;
}

a:hover {
    color: var(--accent-hover);
}

/* Header */
.site-header {
    background-color: var(--bg-card);
    border-bottom: 1px solid var(--border);
    padding: 1rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 100;
}

.site-logo {
    font-size: 1.5rem;
    font-weight: bold;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 10px;
}

.site-logo a {
    color: var(--text-primary);
}

.main-nav ul {
    list-style: none;
    display: flex;
    gap: 1.5rem;
}

.main-nav a {
    color: var(--text-primary);
}

.main-nav a:hover {
    color: var(--accent);
}

/* Hero Section */
.hero-section {
    text-align: center;
    padding: 4rem 2rem;
    background: linear-gradient(180deg, var(--bg-main) 0%, var(--bg-card) 100%);
}

.hero-section h1 {
    font-size: 3rem;
    margin-bottom: 1rem;
    background: -webkit-linear-gradient(#0ea5e9, #38bdf8);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.hero-section p {
    color: var(--text-secondary);
    font-size: 1.2rem;
    margin-bottom: 2rem;
}

.search-bar {
    max-width: 600px;
    margin: 0 auto;
    display: flex;
    gap: 10px;
}

.search-bar input {
    flex: 1;
    padding: 1rem;
    border-radius: 8px;
    border: 1px solid var(--border);
    background-color: var(--bg-main);
    color: var(--text-primary);
    font-size: 1rem;
}

.search-bar button {
    padding: 1rem 2rem;
    background-color: var(--accent);
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-weight: bold;
    transition: background 0.3s;
}

.search-bar button:hover {
    background-color: var(--accent-hover);
}

/* Tool Grid */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem;
}

.section-title {
    font-size: 2rem;
    margin-bottom: 1.5rem;
    border-bottom: 2px solid var(--border);
    padding-bottom: 0.5rem;
}

.tool-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 1.5rem;
    margin-bottom: 3rem;
}

.tool-card {
    background-color: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 1.5rem;
    transition: transform 0.3s, box-shadow 0.3s;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
}

.tool-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(0,0,0,0.5);
    border-color: var(--accent);
}

.tool-icon {
    font-size: 2rem;
    margin-bottom: 1rem;
    background-color: rgba(14, 165, 233, 0.1);
    padding: 10px;
    border-radius: 8px;
}

.tool-title {
    font-size: 1.2rem;
    font-weight: bold;
    margin-bottom: 0.5rem;
    color: var(--text-primary);
}

.tool-desc {
    color: var(--text-secondary);
    font-size: 0.9rem;
    flex-grow: 1;
}

/* Functional Tool Interface */
.tool-interface-container {
    background-color: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 2rem;
    margin-top: 2rem;
}

.tool-input, .tool-output {
    width: 100%;
    background-color: var(--bg-main);
    border: 1px solid var(--border);
    color: var(--text-primary);
    padding: 1rem;
    border-radius: 8px;
    font-family: inherit;
    margin-bottom: 1rem;
}

.tool-input:focus, .tool-output:focus {
    outline: none;
    border-color: var(--accent);
}

.tool-controls {
    display: flex;
    gap: 10px;
    margin-bottom: 1rem;
    flex-wrap: wrap;
}

.btn {
    padding: 0.75rem 1.5rem;
    background-color: var(--accent);
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-weight: bold;
    transition: background 0.3s;
}

.btn:hover {
    background-color: var(--accent-hover);
}

.btn-secondary {
    background-color: var(--border);
}

.btn-secondary:hover {
    background-color: #475569;
}

/* Footer */
.site-footer {
    background-color: var(--bg-card);
    border-top: 1px solid var(--border);
    padding: 3rem 2rem;
    margin-top: 4rem;
}

.footer-content {
    max-width: 1200px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 2rem;
}

.footer-col h3 {
    margin-bottom: 1rem;
    color: var(--text-primary);
}

.footer-col ul {
    list-style: none;
}

.footer-col li {
    margin-bottom: 0.5rem;
}

.footer-col a {
    color: var(--text-secondary);
}

.footer-col a:hover {
    color: var(--accent);
}

/* Category Sidebar Layout */
.homepage-layout {
    display: grid;
    grid-template-columns: 280px 1fr;
    gap: 2.5rem;
    align-items: start;
    margin-top: 2rem;
}

.sidebar-categories {
    position: sticky;
    top: 90px;
    background-color: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 1.5rem;
    max-height: 80vh;
    display: flex;
    flex-direction: column;
    gap: 12px;
    z-index: 10;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
}

.sidebar-title {
    color: var(--accent);
    font-size: 1.15rem;
    font-weight: bold;
    margin-bottom: 0.5rem;
    border-bottom: 1px solid var(--border);
    padding-bottom: 0.5rem;
}

.sidebar-links-wrapper {
    display: flex;
    flex-direction: column;
    gap: 6px;
    overflow-y: auto;
    padding-right: 4px;
}

/* Custom Scrollbar for Sidebar */
.sidebar-links-wrapper::-webkit-scrollbar {
    width: 5px;
}
.sidebar-links-wrapper::-webkit-scrollbar-track {
    background: transparent;
}
.sidebar-links-wrapper::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 10px;
}

.category-link {
    display: flex;
    align-items: center;
    gap: 12px;
    color: var(--text-secondary);
    text-decoration: none;
    padding: 10px 14px;
    border-radius: 10px;
    font-weight: 500;
    font-size: 0.95rem;
    transition: all 0.25s ease;
}

.category-link span {
    font-size: 1.1rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.category-link:hover {
    color: var(--text-primary);
    background-color: rgba(14, 165, 233, 0.05);
    transform: translateX(4px);
}

.category-link.active-link {
    color: var(--text-primary) !important;
    background-color: rgba(14, 165, 233, 0.12) !important;
    border-left: 3px solid var(--accent);
    padding-left: 11px;
}

.main-content-area {
    min-width: 0;
}

/* Responsive category layout - categories always on the left side! */
@media (max-width: 1024px) {
    .homepage-layout {
        grid-template-columns: 240px 1fr;
        gap: 1.5rem;
    }
    
    .sidebar-categories {
        position: sticky;
        top: 80px;
        max-height: calc(100vh - 100px);
        padding: 1rem;
        border-radius: 12px;
        width: 100%;
        max-width: 100%;
        overflow: hidden;
    }
    
    .sidebar-links-wrapper {
        flex-direction: column;
        gap: 6px;
        overflow-y: auto;
        overflow-x: hidden;
        width: 100%;
    }
    
    .category-link {
        display: flex;
        align-items: center;
        gap: 10px;
        padding: 8px 12px;
        font-size: 0.9rem;
    }
    
    .category-link.active-link {
        border-left: 3px solid var(--accent);
        border-bottom: none;
        padding-left: 9px;
    }
}

@media (max-width: 768px) {
    .homepage-layout {
        grid-template-columns: 60px 1fr;
        gap: 1rem;
        padding: 0 0.5rem;
    }
    
    .sidebar-categories {
        position: sticky;
        top: 70px;
        max-height: calc(100vh - 90px);
        padding: 0.5rem 0.25rem;
        border-radius: 8px;
        align-items: center;
    }
    
    .sidebar-title {
        display: none; /* Hide categories title on mobile to save space */
    }
    
    .sidebar-links-wrapper {
        flex-direction: column;
        overflow-y: auto;
        overflow-x: hidden;
        width: 100%;
        align-items: center;
        gap: 8px;
    }
    
    .category-link {
        display: flex;
        justify-content: center;
        align-items: center;
        width: 42px;
        height: 42px;
        padding: 0;
        border-radius: 50%;
        font-size: 0 !important; /* Hide text nodes */
        background-color: var(--bg-card);
        border: 1px solid var(--border);
    }
    
    .category-link span {
        font-size: 1.3rem !important; /* Center and size emoji */
        margin: 0;
    }
    
    .category-link:hover {
        transform: scale(1.05);
    }
    
    .category-link.active-link {
        border-left: none;
        background-color: var(--accent) !important;
        border-color: var(--accent);
    }
    
    .category-link.active-link span {
        filter: brightness(0) invert(1); /* Invert color to match active button */
    }
}

