/**
 * ToolHub WordPress Theme Styles
 * Main stylesheet for ToolHub theme
 */

/* ===== CSS Variables ===== */
:root {
    /* Primary Colors */
    --blue-500: #3b82f6;
    --blue-600: #2563eb;
    --blue-700: #1d4ed8;
    --green-500: #22c55e;
    --red-500: #ef4444;
    --purple-500: #a855f7;
    --indigo-500: #6366f1;
    --yellow-500: #eab308;
    --pink-500: #ec4899;
    --orange-500: #f97316;
    --teal-500: #0d9488;
    --cyan-500: #06b6d4;
    --emerald-500: #10b981;
    --violet-500: #8b5cf6;
    
    /* Gray Scale */
    --gray-50: #f9fafb;
    --gray-100: #f3f4f6;
    --gray-200: #e5e7eb;
    --gray-300: #d1d5db;
    --gray-400: #9ca3af;
    --gray-500: #6b7280;
    --gray-600: #4b5563;
    --gray-700: #374151;
    --gray-800: #1f2937;
    --gray-900: #111827;
    --white: #ffffff;
    
    /* Theme Colors */
    --primary-color: var(--blue-600);
    --secondary-color: #8b5cf6;
    --background-color: var(--gray-50);
    --surface-color: var(--white);
    --text-primary: var(--gray-900);
    --text-secondary: var(--gray-600);
    --text-muted: var(--gray-500);
    --border-color: var(--gray-200);
    
    /* Shadows */
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    
    /* Border Radius */
    --radius-sm: 0.375rem;
    --radius-md: 0.5rem;
    --radius-lg: 0.75rem;
    --radius-xl: 1rem;
    
    /* Spacing */
    --space-xs: 0.5rem;
    --space-sm: 0.75rem;
    --space-md: 1rem;
    --space-lg: 1.5rem;
    --space-xl: 2rem;
    --space-2xl: 3rem;
}

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

*::before,
*::after {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: var(--background-color);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
}

/* Center all headings globally */
h1, h2, h3, h4, h5, h6 {
    text-align: center;
}

/* ===== Layout & Container ===== */
.container {
    width: 100%;
    max-width: 76rem;
    margin: 0 auto;
    padding: 0 1rem;
}

/* ===== Header & Navigation ===== */
.site-header {
    background-color: var(--white);
    box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    border-bottom: 1px solid var(--gray-200);
    position: sticky;
	display: flex;
    flex-direction: row-reverse;
    top: 0;
    z-index: 100;
}

.header-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 4rem;
}

/* Logo Styles */
.site-branding {
    display: flex;
    align-items: center;
}

.logo {
    display: flex;
    align-items: center;
    text-decoration: none;
    color: inherit;
}

.logo-icon {
    background: linear-gradient(to right, var(--blue-600), #8b5cf6);
    padding: 0.5rem;
    border-radius: 0.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

.logo-icon i {
    color: var(--white);
    font-size: 1.5rem;
}

.logo-text {
    margin-left: 0.75rem;
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--gray-900);
}

/* Desktop Navigation */
.main-navigation {
    display: none;
}

.nav-menu {
    display: flex;
    list-style: none;
    gap: 2rem;
    margin: 0;
    padding: 0;
}

.nav-menu li {
    margin: 0;
}

.nav-menu a {
    color: #4b5563;
    font-weight: 500;
    text-decoration: none;
    transition: color 0.2s;
    padding: 0.5rem 0;
}

.nav-menu a:hover {
    color: var(--blue-600);
}

.nav-menu .current-menu-item > a {
    color: var(--blue-600);
    font-weight: 600;
}

/* Header Actions */
.header-actions {
    display: flex;
    align-items: center;
    gap: 1rem;
}

/* Search Styles */
.search-container {
    position: relative;
    display: none;
}

.search-form {
    position: relative;
}

.search-input {
    width: 16rem;
    padding: 0.5rem 1rem 0.5rem 2.5rem;
    border: 1px solid var(--gray-200);
    border-radius: 0.5rem;
    font-size: 0.875rem;
    background-color: var(--white);
    transition: all 0.2s;
}

.search-input:focus {
    outline: none;
    border-color: var(--blue-600);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.search-icon {
    position: absolute;
    left: 0.75rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--gray-400);
    pointer-events: none;
}

/* Mobile Menu Button */
.mobile-menu-toggle {
    display: flex;
    padding: 0.5rem;
    border-radius: 0.375rem;
    color: #4b5563;
    background: none;
    border: none;
    cursor: pointer;
    font-size: 1.5rem;
    transition: all 0.2s;
}

.mobile-menu-toggle:hover {
    background-color: #f3f4f6;
    color: var(--blue-600);
}

/* Mobile Search (Visible on mobile) */
.mobile-search {
    display: block;
    margin-top: 1rem;
    padding-bottom: 1rem;
}

.mobile-search .search-container {
    display: block;
    width: 100%;
}

.mobile-search .search-input {
    width: 100%;
}

/* Mobile Menu */
.mobile-menu {
    display: none;
    background-color: var(--white);
    border-top: 1px solid var(--gray-200);
    padding: 1rem 0;
}

.mobile-menu.active {
    display: block;
    animation: slideDown 0.3s ease;
}

.mobile-menu .nav-menu {
    flex-direction: column;
    gap: 0;
}

.mobile-menu .nav-menu a {
    display: block;
    padding: 0.5rem 0.75rem;
    border-radius: 0.375rem;
    margin: 0.25rem 0;
}

.mobile-menu .nav-menu a:hover {
    background-color: #f9fafb;
    color: var(--blue-600);
}

/* ===== Main Content ===== */
main {
    padding: 2rem 0;
}

.hero {
    text-align: center;
    margin-bottom: 3rem;
}

.hero h1 {
    font-size: 2.25rem;
    font-weight: 700;
    margin-bottom: 1rem;
    line-height: 1.2;
}

.hero p {
    font-size: 1.25rem;
    color: var(--gray-600);
    max-width: 48rem;
    margin: 0 auto;
    line-height: 1.6;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.section-title {
    font-size: 1.5rem;
    font-weight: 700;
	justify-content: center;
}

.section-count {
    font-size: 0.875rem;
    color: var(--gray-600);
}

/* ===== Categories Grid ===== */
.categories-grid {
    display: grid;
    grid-template-columns: repeat(1, minmax(0, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.category-card {
    background-color: var(--white);
    border-radius: 0.75rem;
    box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    border: 1px solid var(--gray-200);
    transition: box-shadow 0.2s;
    overflow: hidden;
}

.category-card:hover {
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
}

.category-content {
    padding: 1.5rem;
}

.category-header {
    display: flex;
    align-items: flex-start;
    margin-bottom: 1rem;
}

.category-icon {
    width: 3rem;
    height: 3rem;
    border-radius: 0.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--white);
    font-size: 1.25rem;
}

.category-info {
    margin-left: 1rem;
}

.category-name {
    font-size: 1.125rem;
    font-weight: 600;
    margin-bottom: 0.25rem;
}

.category-description {
    font-size: 0.875rem;
    color: var(--gray-600);
}

.category-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 1rem;
}

.category-tools {
    font-size: 0.875rem;
    color: #6b7280;
	text-align: center;
}

.view-category-btn {
    display: flex;
    align-items: center;
    color: var(--blue-600);
    font-weight: 500;
    background: none;
    border: none;
    cursor: pointer;
    transition: transform 0.2s;
    text-decoration: none;
}

.view-category-btn:hover {
    transform: translateX(0.25rem);
}

.view-category-btn i {
    margin-left: 0.25rem;
    font-size: 0.875rem;
}

/* ===== No Results State ===== */
.no-results {
    text-align: center;
    padding: 3rem 0;
}

.no-results i {
    font-size: 3rem;
    color: var(--gray-400);
    margin-bottom: 1rem;
}

.no-results h3 {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.no-results p {
    color: var(--gray-600);
}

/* ===== Featured Tools Section ===== */
.featured-section {
    background: linear-gradient(to right, #eff6ff, #f5f3ff);
    border-radius: 1rem;
    padding: 2rem;
    margin-bottom: 2rem;
}

.featured-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.view-all-btn {
    display: flex;
    align-items: center;
    color: var(--blue-600);
    font-weight: 500;
    background: none;
    border: none;
    cursor: pointer;
    text-decoration: none;
}

.view-all-btn i {
    margin-left: 0.25rem;
    font-size: 0.875rem;
}

.featured-grid {
    display: grid;
    grid-template-columns: repeat(1, minmax(0, 1fr));
    gap: 1.5rem;
}

.featured-card {
    background-color: var(--white);
    border-radius: 0.75rem;
    padding: 1.5rem;
    box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    border: 1px solid var(--gray-200);
}

.featured-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 1rem;
}

.featured-name {
    font-weight: 600;
	display: flex
    margin-bottom: 0.25rem;	
	justify-content: center;
}

.featured-rating {
    display: flex;
    align-items: center;
    color: #f59e0b;
}

.featured-rating i {
    font-size: 0.875rem;
}

.featured-rating span {
    margin-left: 0.25rem;
    font-size: 0.875rem;
    color: var(--gray-600);
}

.featured-category {
    font-size: 0.875rem;
    color: var(--gray-600);
    margin-bottom: 1rem;
	
}

.try-now-btn {
    width: 100%;
    background-color: var(--blue-600);
    color: var(--white);
    padding: 0.5rem;
    border-radius: 0.5rem;
    font-weight: 500;
    border: none;
    cursor: pointer;
    transition: background-color 0.2s;
    text-decoration: none;
    display: block;
    text-align: center;
}

.try-now-btn:hover {
    background-color: var(--blue-700);
}

/* ===== Footer ===== */
.site-footer {
    background-color: var(--gray-900);
    color: var(--white);
    padding: 3rem 0 2rem;
}

.footer-grid {
    display: grid;
    grid-template-columns: repeat(1, minmax(0, 1fr));
    gap: 2rem;
}

.footer-column {
    display: flex;
    flex-direction: column;
}

.footer-brand {
    grid-column: span 2;
}

.footer-logo {
    display: flex;
    align-items: center;
    margin-bottom: 1rem;
}

.footer-logo-icon {
    background: linear-gradient(to right, var(--blue-600), #8b5cf6);
    padding: 0.5rem;
    border-radius: 0.5rem;
}

.footer-logo-icon i {
    color: var(--white);
    font-size: 1.5rem;
}

.footer-logo-text {
    margin-left: 0.75rem;
    font-size: 1.25rem;
    font-weight: 700;
}

.footer-description {
    color: #9ca3af;
    margin-bottom: 1.5rem;
    max-width: 32rem;
    line-height: 1.6;
}

.footer-stats {
    display: flex;
    gap: 1.5rem;
}

.footer-stat {
    display: flex;
    align-items: center;
    color: #9ca3af;
}

.footer-stat i {
    margin-right: 0.5rem;
    color: #9ca3af;
}

.footer-title {
    font-size: 1.125rem;
    font-weight: 600;
    margin-bottom: 1.25rem;
}

.footer-links {
    list-style: none;
}

.footer-links li {
    margin-bottom: 0.75rem;
}

.footer-links a {
    color: #9ca3af;
    text-decoration: none;
    transition: color 0.2s;
}

.footer-links a:hover {
    color: var(--white);
}

.footer-copyright {
    border-top: 1px solid #374151;
    margin-top: 2rem;
    padding-top: 2rem;
    text-align: center;
    color: #9ca3af;
}

/* ===== 404 Page Styles ===== */
.error-404 {
    padding: 2rem 0;
}

.error-content {
    text-align: center;
    padding: 4rem 0;
    animation: fadeInUp 0.6s ease-out;
}

.error-icon {
    font-size: 8rem;
    color: var(--blue-500);
    margin-bottom: 2rem;
    animation: bounce 2s infinite;
}

.error-code {
    font-size: 6rem;
    font-weight: 700;
    color: var(--gray-900);
    margin-bottom: 1rem;
}

.error-title {
    font-size: 2rem;
    font-weight: 600;
    color: var(--gray-900);
    margin-bottom: 1.5rem;
}

.error-description {
    font-size: 1.125rem;
    color: var(--gray-600);
    max-width: 500px;
    margin: 0 auto 2.5rem;
    line-height: 1.6;
}

.error-actions {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
    margin-bottom: 3rem;
    animation: fadeIn 0.8s ease-out 0.3s both;
}

.error-search {
    max-width: 500px;
    margin: 0 auto 3rem;
    animation: fadeIn 0.8s ease-out 0.6s both;
}

.error-search-title {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 1rem;
    color: var(--gray-900);
}

/* ===== Responsive Design ===== */

/* Small devices (640px and up) */
@media (min-width: 640px) {
    .categories-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
    
    .featured-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

/* Medium devices (768px and up) */
@media (min-width: 768px) {
    .main-navigation {
        display: block;
    }
    
    .search-container {
        display: block;
    }
    
    .mobile-search {
        display: none;
    }
    
    .categories-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
    
    .featured-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
    
    .footer-grid {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }
}

/* Large devices (1024px and up) */
@media (min-width: 1024px) {
    .categories-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

/* Extra large devices (1280px and up) */
@media (min-width: 1280px) {
    .categories-grid {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }
}

/* Mobile adjustments */
@media (max-width: 767px) {
    .header-container {
        flex-wrap: wrap;
        height: auto;
        padding: 0.5rem 0;
    }
    
    .hero h1 {
        font-size: 1.875rem;
    }
    
    .hero p {
        font-size: 1.125rem;
    }
    
    .section-header {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .error-code {
        font-size: 4rem;
    }
    
    .error-title {
        font-size: 1.5rem;
    }
    
    .error-actions {
        flex-direction: column;
        align-items: center;
    }
    
    .error-actions .try-now-btn,
    .error-actions .view-category-btn {
        width: 100%;
        max-width: 250px;
        justify-content: center;
    }
    
    .error-search form {
        flex-direction: column;
    }
}

/* ===== Animations ===== */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes bounce {
    0%, 20%, 50%, 80%, 100% {
        transform: translateY(0);
    }
    40% {
        transform: translateY(-10px);
    }
    60% {
        transform: translateY(-5px);
    }
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ===== Utility Classes ===== */
.bg-blue-500 { background-color: var(--blue-500); }
.bg-green-500 { background-color: var(--green-500); }
.bg-red-500 { background-color: var(--red-500); }
.bg-purple-500 { background-color: var(--purple-500); }
.bg-indigo-500 { background-color: var(--indigo-500); }
.bg-yellow-500 { background-color: var(--yellow-500); }
.bg-pink-500 { background-color: var(--pink-500); }
.bg-orange-500 { background-color: var(--orange-500); }
.bg-teal-500 { background-color: var(--teal-500); }
.bg-cyan-500 { background-color: var(--cyan-500); }
.bg-emerald-500 { background-color: var(--emerald-500); }
.bg-violet-500 { background-color: var(--violet-500); }

.text-center { text-align: center; }
.text-left { text-align: left; }
.text-right { text-align: right; }

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}
/* ===== Custom Fixes: Center Titles & Shorten Descriptions ===== */

/* Center category and tool titles */
.category-name,
.featured-name,
.section-title,
.featured-header-card h1,
.category-header h2,
.tool-title {
    text-align: center;
    justify-content: center;
    display: flex;
    align-items: center;
    font-weight: 500;
}

/* Clamp category and tool descriptions to max 3 lines */
.category-description,
.tool-content p,
.featured-card p,
.featured-category,
.footer-description {
    display: -webkit-box;
    -webkit-line-clamp: 3; /* show max 3 lines */
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Adjust featured card layout */
.featured-card {
    
    display: flex;
    flex-direction: column;
    align-items: center;
}

/* Center button and footer elements */
.category-footer,
.featured-category,
.try-now-btn {
    justify-content: center;
    text-align: center;
}

/* Reduce excessive width for centered sections */
.category-content,
.tool-content {
    margin: 0 auto;
    max-width: 700px;
}

/* Optional: add subtle hover focus for better UI */
.category-card:hover .category-name,
.featured-card:hover .featured-name {
    color: var(--blue-600);
    transition: color 0.3s ease;
}
/* Hide the tool icon */
.category-icon {
    display: none !important;
}
