/* ===========================================
   CSS Variables & Reset
   =========================================== */
:root {
    --primary-color: #6366f1;
    --primary-dark: #4f46e5;
    --primary-light: #818cf8;
    --secondary-color: #8b5cf6;
    --accent-color: #ec4899;
    --success-color: #10b981;
    --warning-color: #f59e0b;
    
    --bg-primary: #ffffff;
    --bg-secondary: #f9fafb;
    --bg-tertiary: #f3f4f6;
    --bg-dark: #1f2937;
    
    --text-primary: #111827;
    --text-secondary: #6b7280;
    --text-light: #9ca3af;
    
    --border-color: #e5e7eb;
    --border-radius: 12px;
    --border-radius-lg: 16px;
    --border-radius-sm: 8px;
    
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.07);
    --shadow-lg: 0 10px 15px rgba(0, 0, 0, 0.1);
    --shadow-xl: 0 20px 25px rgba(0, 0, 0, 0.15);
    
    --transition: all 0.3s ease;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    line-height: 1.6;
    color: var(--text-primary);
    background-color: var(--bg-secondary);
    overflow-x: hidden;
}

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

/* ===========================================
   Header
   =========================================== */
.header {
    background: var(--bg-primary);
    border-bottom: 1px solid var(--border-color);
    padding: 16px 0;
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: var(--shadow-sm);
}

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

.logo {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 24px;
    font-weight: 800;
    color: var(--primary-color);
}

.logo i {
    font-size: 28px;
}

.nav {
    display: flex;
    gap: 32px;
    align-items: center;
}

.nav a {
    text-decoration: none;
    color: var(--text-secondary);
    font-weight: 500;
    transition: var(--transition);
}

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

.btn-submit {
    background: var(--primary-color);
    color: white !important;
    padding: 10px 24px;
    border-radius: var(--border-radius-sm);
    font-weight: 600;
}

.btn-submit:hover {
    background: var(--primary-dark);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

/* ===========================================
   Hero Section
   =========================================== */
.hero {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 80px 0;
    text-align: center;
}

.hero h1 {
    font-size: 56px;
    font-weight: 800;
    margin-bottom: 16px;
    line-height: 1.2;
}

.hero-subtitle {
    font-size: 20px;
    opacity: 0.95;
    margin-bottom: 40px;
}

.search-container {
    max-width: 700px;
    margin: 0 auto 48px;
    position: relative;
}

.search-container i {
    position: absolute;
    left: 20px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-light);
    font-size: 18px;
}

#searchInput {
    width: 100%;
    padding: 18px 24px 18px 56px;
    border: none;
    border-radius: var(--border-radius);
    font-size: 16px;
    box-shadow: var(--shadow-xl);
    transition: var(--transition);
}

#searchInput:focus {
    outline: none;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.2);
}

.stats {
    display: flex;
    justify-content: center;
    gap: 64px;
    flex-wrap: wrap;
}

.stat-item {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.stat-number {
    font-size: 40px;
    font-weight: 800;
    line-height: 1;
}

.stat-label {
    font-size: 14px;
    opacity: 0.9;
    margin-top: 8px;
}

/* ===========================================
   Featured Section
   =========================================== */
.featured-section {
    padding: 80px 0;
    background: var(--bg-primary);
}

.section-title {
    font-size: 36px;
    font-weight: 700;
    margin-bottom: 40px;
    display: flex;
    align-items: center;
    gap: 12px;
}

.section-title i {
    color: var(--warning-color);
}

.featured-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(360px, 1fr));
    gap: 32px;
}

/* ===========================================
   Tools Section
   =========================================== */
.tools-section {
    padding: 60px 0 100px;
}

.tools-layout {
    display: grid;
    grid-template-columns: 280px 1fr;
    gap: 40px;
}

/* Filters Sidebar */
.filters-sidebar {
    background: var(--bg-primary);
    padding: 24px;
    border-radius: var(--border-radius-lg);
    height: fit-content;
    position: sticky;
    top: 90px;
    box-shadow: var(--shadow-sm);
}

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

.filters-header h3 {
    font-size: 20px;
    font-weight: 700;
}

.clear-btn {
    background: none;
    border: none;
    color: var(--primary-color);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
}

.clear-btn:hover {
    color: var(--primary-dark);
}

.filter-group {
    margin-bottom: 32px;
    padding-bottom: 24px;
    border-bottom: 1px solid var(--border-color);
}

.filter-group:last-child {
    border-bottom: none;
    margin-bottom: 0;
}

.filter-group h4 {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 16px;
    color: var(--text-primary);
}

.filter-options {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.filter-checkbox,
.filter-radio {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    font-size: 14px;
    color: var(--text-secondary);
    transition: var(--transition);
}

.filter-checkbox:hover,
.filter-radio:hover {
    color: var(--text-primary);
}

.filter-checkbox input,
.filter-radio input {
    cursor: pointer;
}

/* Tools Main Area */
.tools-main {
    min-height: 500px;
}

.tools-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 32px;
}

.tools-header h2 {
    font-size: 28px;
    font-weight: 700;
}

.sort-controls {
    display: flex;
    align-items: center;
    gap: 12px;
}

.sort-controls label {
    font-weight: 500;
    color: var(--text-secondary);
}

#sortBy {
    padding: 8px 16px;
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-sm);
    font-size: 14px;
    cursor: pointer;
    background: var(--bg-primary);
    transition: var(--transition);
}

#sortBy:hover {
    border-color: var(--primary-color);
}

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

/* ===========================================
   Tool Card
   =========================================== */
.tool-card {
    background: var(--bg-primary);
    border-radius: var(--border-radius-lg);
    padding: 28px;
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
    border: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
}

.tool-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
    border-color: var(--primary-light);
}

.tool-card.featured {
    border: 2px solid var(--warning-color);
    background: linear-gradient(135deg, #fffbeb 0%, #fff7ed 100%);
}

.tool-header {
    display: flex;
    gap: 16px;
    margin-bottom: 16px;
}

.tool-logo {
    width: 56px;
    height: 56px;
    border-radius: var(--border-radius);
    background: var(--bg-tertiary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
    flex-shrink: 0;
}

.tool-info {
    flex: 1;
    min-width: 0;
}

.tool-name {
    font-size: 20px;
    font-weight: 700;
    margin-bottom: 4px;
    color: var(--text-primary);
}

.tool-rating {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 4px;
}

.stars {
    display: flex;
    gap: 2px;
}

.star {
    color: #d1d5db;
    cursor: pointer;
    font-size: 16px;
    transition: var(--transition);
}

.star.filled {
    color: #fbbf24;
}

.star:hover,
.star.hover {
    color: #fbbf24;
    transform: scale(1.15);
}

.review-count {
    font-size: 13px;
    color: var(--text-light);
}

.tool-description {
    color: var(--text-secondary);
    margin-bottom: 16px;
    line-height: 1.6;
    flex-grow: 1;
}

.tool-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 16px;
}

.badge {
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    background: var(--bg-tertiary);
    color: var(--text-secondary);
}

.badge.category {
    background: #dbeafe;
    color: #1e40af;
}

.badge.pricing {
    background: #dcfce7;
    color: #166534;
}

.badge.pricing.Paid {
    background: #fef3c7;
    color: #92400e;
}

.badge.pricing.Enterprise {
    background: #f3e8ff;
    color: #6b21a8;
}

.tool-features {
    margin-bottom: 16px;
}

.feature-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.feature-tag {
    font-size: 11px;
    padding: 4px 10px;
    background: var(--bg-secondary);
    border-radius: 16px;
    color: var(--text-secondary);
    border: 1px solid var(--border-color);
}

.tool-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: auto;
    padding-top: 16px;
    border-top: 1px solid var(--border-color);
}

.pricing-info {
    font-weight: 600;
    color: var(--text-primary);
}

.visit-btn {
    padding: 10px 20px;
    background: var(--primary-color);
    color: white;
    text-decoration: none;
    border-radius: var(--border-radius-sm);
    font-weight: 600;
    font-size: 14px;
    transition: var(--transition);
    display: inline-block;
}

.visit-btn:hover {
    background: var(--primary-dark);
    transform: translateX(4px);
}

/* ===========================================
   Loading & No Results
   =========================================== */
.loading {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-light);
    font-size: 18px;
}

.no-results {
    text-align: center;
    padding: 80px 20px;
}

.no-results i {
    font-size: 64px;
    color: var(--text-light);
    margin-bottom: 20px;
}

.no-results h3 {
    font-size: 24px;
    margin-bottom: 12px;
    color: var(--text-primary);
}

.no-results p {
    color: var(--text-secondary);
}

/* ===========================================
   Footer
   =========================================== */
.footer {
    background: var(--bg-dark);
    color: white;
    padding: 60px 0 24px;
    margin-top: 80px;
}

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

.footer-section h3,
.footer-section h4 {
    margin-bottom: 16px;
    font-weight: 700;
}

.footer-section h3 {
    font-size: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
}

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

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

.footer-section ul li {
    margin-bottom: 10px;
}

.footer-section ul li a {
    color: #d1d5db;
    text-decoration: none;
    transition: var(--transition);
}

.footer-section ul li a:hover {
    color: var(--primary-light);
}

.social-links {
    display: flex;
    gap: 16px;
}

.social-links a {
    width: 40px;
    height: 40px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 18px;
    transition: var(--transition);
}

.social-links a:hover {
    background: var(--primary-color);
    transform: translateY(-3px);
}

.footer-bottom {
    text-align: center;
    padding-top: 24px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    color: #9ca3af;
}

/* ===========================================
   Responsive Design
   =========================================== */
@media (max-width: 1024px) {
    .tools-layout {
        grid-template-columns: 1fr;
    }
    
    .filters-sidebar {
        position: static;
    }
}

@media (max-width: 768px) {
    .hero h1 {
        font-size: 36px;
    }
    
    .hero-subtitle {
        font-size: 16px;
    }
    
    .stats {
        gap: 32px;
    }
    
    .section-title {
        font-size: 28px;
    }
    
    .tools-grid,
    .featured-grid {
        grid-template-columns: 1fr;
    }
    
    .nav {
        gap: 16px;
    }
    
    .tools-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 16px;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 0 16px;
    }
    
    .hero {
        padding: 60px 0;
    }
    
    .hero h1 {
        font-size: 28px;
    }
    
    .logo span {
        display: none;
    }
    
    .nav a:not(.btn-submit) {
        display: none;
    }
    
    .tool-card {
        padding: 20px;
    }
}
