/* ===== CATALOG STYLES ===== */

/* Performance optimizations for Core Web Vitals */
html {
    scroll-behavior: smooth;
}

/* Critical CSS - Above the fold content */
.navbar,
.hero,
.filters-section {
    contain: layout style paint;
}

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

/* Performance hints */
img {
    loading: lazy;
    decode: async;
}

/* Reduce layout shift */
.tool-image {
    contain: size layout style paint;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', sans-serif;
    line-height: 1.6;
    color: #1a202c;
    background: #f8fafc;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 1.5rem;
}

/* Navigation */
.navbar {
    background: #ffffff;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.nav-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 1.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 70px;
}

.logo {
    text-decoration: none;
    display: flex;
    flex-direction: column;
    line-height: 1.2;
}

.logo-text {
    font-size: 1.5rem;
    font-weight: 800;
    color: #2563eb;
    letter-spacing: -0.02em;
}

.logo-subtitle {
    font-size: 0.75rem;
    color: #64748b;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.nav-links {
    display: flex;
    gap: 2rem;
}

.nav-links a {
    color: #475569;
    text-decoration: none;
    font-weight: 500;
    transition: color 0.2s ease;
}

.nav-links a:hover {
    color: #2563eb;
}

/* Hero Section */
.hero {
    background: #ffffff;
    color: #1a202c;
    padding: 4rem 0;
    text-align: center;
    border-bottom: 1px solid #e2e8f0;
}

.hero-content h1 {
    font-size: 3rem;
    font-weight: 800;
    margin-bottom: 1rem;
    letter-spacing: -0.02em;
}

.subtitle {
    font-size: 1.25rem;
    opacity: 0.9;
    margin-bottom: 3rem;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

/* Search */
.search-container {
    max-width: 600px;
    margin: 0 auto;
    position: relative;
}

.search-box {
    position: relative;
    display: flex;
    background: white;
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    overflow: hidden;
    border: 2px solid #e2e8f0;
}

#searchInput {
    flex: 1;
    padding: 1rem 1.5rem;
    border: none;
    font-size: 1rem;
    outline: none;
    color: #1a202c;
}

#searchInput::placeholder {
    color: #94a3b8;
}

.search-btn {
    background: #2563eb;
    border: none;
    padding: 1rem 1.5rem;
    color: white;
    cursor: pointer;
    transition: background 0.2s ease;
}

.search-btn:hover {
    background: #1d4ed8;
}

.search-suggestions {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: white;
    border-radius: 0 0 12px 12px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
    max-height: 300px;
    overflow-y: auto;
    z-index: 1000;
    display: none;
}

.suggestion-item {
    padding: 1rem 1.5rem;
    cursor: pointer;
    border-bottom: 1px solid #e2e8f0;
    transition: all 0.2s ease;
}

.suggestion-item:hover {
    background: #f8fafc;
    transform: translateX(4px);
}

.suggestion-item:last-child {
    border-bottom: none;
}

.suggestion-content {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.suggestion-type {
    font-size: 0.8rem;
    color: #64748b;
    font-weight: 500;
    flex-shrink: 0;
}

.suggestion-text {
    color: #1a202c;
    font-weight: 500;
}

.suggestion-item.highlighted {
    background: #f1f5f9 !important;
    transform: translateX(4px);
}

/* Filters Section */
.filters-section {
    background: white;
    padding: 2rem 0;
    border-bottom: 1px solid #e2e8f0;
}

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

.filters-header h3 {
    font-size: 1.25rem;
    font-weight: 600;
    color: #1a202c;
}

.results-count {
    color: #64748b;
    font-weight: 500;
}

/* Mobile Categories Toggle */
.categories-toggle {
    display: none;
    background: #2563eb;
    color: white;
    border: none;
    padding: 0.75rem 1rem;
    border-radius: 8px;
    font-weight: 500;
    cursor: pointer;
    align-items: center;
    gap: 0.5rem;
    transition: all 0.2s ease;
    font-size: 0.9rem;
}

.categories-toggle:hover {
    background: #1d4ed8;
}

.toggle-icon {
    transition: transform 0.2s ease;
}

.categories-toggle.expanded .toggle-icon {
    transform: rotate(180deg);
}

.filters-container {
    display: block; /* Always visible on desktop */
}

.category-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
}

.filter-btn {
    background: #f1f5f9;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 6px;
    font-weight: 500;
    color: #475569;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 0.875rem;
    text-decoration: none;
    display: inline-block;
}

.filter-btn:hover {
    background: #e2e8f0;
    color: #1a202c;
}

.filter-btn.active {
    background: #2563eb;
    color: white;
}

/* Tools Grid */
.tools-section {
    padding: 3rem 0;
}

.tools-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 2rem;
}

.tool-card {
    background: white;
    border-radius: 12px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
    overflow: hidden;
    transition: all 0.2s ease;
    border: 1px solid #e2e8f0;
}

.tool-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
}

.tool-image-link {
    display: block;
    text-decoration: none;
}

.tool-image {
    width: 100%;
    aspect-ratio: 1;
    overflow: hidden;
    background: #f8fafc;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.tool-image img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    transition: transform 0.2s ease;
}

.tool-card:hover .tool-image img {
    transform: scale(1.02);
}

.tool-content {
    padding: 1.5rem;
}

.tool-name {
    margin-bottom: 1rem;
}

.tool-name a {
    color: #1a202c;
    text-decoration: none;
    font-size: 1.25rem;
    font-weight: 600;
    line-height: 1.3;
}

.tool-name a:hover {
    color: #2563eb;
}

.tool-categories {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
}

.category-tag {
    background: #e0e7ff;
    color: #3730a3;
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
    display: inline-block;
}

.category-tag:hover {
    background: #c7d2fe;
    color: #312e81;
}

.tool-actions {
    display: flex;
    justify-content: center;
    margin-top: 1rem;
}

.btn-details {
    background: #2563eb;
    color: white;
    padding: 1rem 2rem;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 600;
    transition: all 0.2s ease;
    font-size: 1rem;
    width: 100%;
    text-align: center;
    box-shadow: 0 2px 8px rgba(37, 99, 235, 0.2);
}

.btn-details:hover {
    background: #1d4ed8;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3);
}

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

.no-results-content h3 {
    font-size: 1.5rem;
    font-weight: 600;
    color: #374151;
    margin-bottom: 0.5rem;
}

.no-results-content p {
    color: #6b7280;
    margin-bottom: 2rem;
}

.btn-clear {
    background: #2563eb;
    color: white;
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.2s ease;
}

.btn-clear:hover {
    background: #1d4ed8;
}

/* Pagination */
.pagination-section {
    padding: 2rem 0;
    background: white;
    border-top: 1px solid #e2e8f0;
}

.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.5rem;
}

.page-btn {
    padding: 0.5rem 0.75rem;
    border-radius: 6px;
    text-decoration: none;
    color: #475569;
    font-weight: 500;
    transition: all 0.2s ease;
    min-width: 40px;
    text-align: center;
}

.page-btn:hover {
    background: #f1f5f9;
    color: #1a202c;
}

.page-btn.active {
    background: #2563eb;
    color: white;
}

.page-btn.dots {
    cursor: default;
}

.page-btn.dots:hover {
    background: transparent;
    color: #475569;
}

/* Footer */
.footer {
    background: #1a202c;
    color: white;
    padding: 3rem 0 1.5rem;
    margin-top: 4rem;
}

.footer-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
    margin-bottom: 2rem;
}

.footer-logo {
    margin-bottom: 1rem;
}

.footer-logo .logo-text {
    color: white;
}

.footer-logo .logo-subtitle {
    color: #94a3b8;
}

.footer-section h4 {
    font-weight: 600;
    margin-bottom: 1rem;
    color: white;
}

.footer-section a {
    color: #cbd5e1;
    text-decoration: none;
    display: block;
    margin-bottom: 0.5rem;
    transition: color 0.2s ease;
}

.footer-section a:hover {
    color: white;
}

.footer-section p {
    color: #94a3b8;
    line-height: 1.6;
}

.footer-bottom {
    border-top: 1px solid #374151;
    padding-top: 1.5rem;
    text-align: center;
    color: #94a3b8;
}

.footer-bottom a {
    color: #94a3b8;
    text-decoration: none;
    transition: color 0.2s ease;
}

.footer-bottom a:hover {
    color: #cbd5e1;
}

/* Responsive Design */
@media (max-width: 1024px) {
    .container {
        padding: 0 1rem;
    }
    
    .tools-grid {
        grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
        gap: 1.5rem;
    }
}

@media (max-width: 768px) {
    .nav-container {
        padding: 0 1rem;
    }
    
    .nav-links {
        gap: 1rem;
    }
    
    .hero-content h1 {
        font-size: 2rem;
    }
    
    .subtitle {
        font-size: 1rem;
        margin-bottom: 2rem;
    }
    
    .filters-header {
        flex-direction: row;
        align-items: center;
        justify-content: space-between;
        gap: 1rem;
    }
    
    .filters-header h3 {
        font-size: 1.1rem;
    }
    
    .results-count {
        display: none;
    }
    
    /* Show categories toggle on mobile */
    .categories-toggle {
        display: flex;
    }
    
    /* Hide categories by default on mobile */
    .filters-container {
        display: none;
        margin-top: 1rem;
    }
    
    .filters-container.show {
        display: block;
        animation: slideDown 0.3s ease-out;
    }
    
    .category-filters {
        gap: 0.5rem;
    }
    
    .filter-btn {
        font-size: 0.8rem;
        padding: 0.4rem 0.8rem;
    }
    
    .tools-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .pagination {
        flex-wrap: wrap;
        gap: 0.25rem;
    }
    
    .page-btn {
        padding: 0.4rem 0.6rem;
        font-size: 0.875rem;
    }
}

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

@media (max-width: 480px) {
    .hero {
        padding: 2rem 0;
    }
    
    .hero-content h1 {
        font-size: 1.75rem;
    }
    
    .search-box {
        flex-direction: column;
    }
    
    .search-btn {
        border-radius: 0;
    }
    
    .tool-content {
        padding: 1rem;
    }
    
    .tool-image {
        aspect-ratio: 1;
    }
    
    .btn-details {
        padding: 0.875rem 1.5rem;
        font-size: 0.95rem;
    }
    
    .footer-content {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
} 