/**
 * AI Tools Directory - Main Stylesheet
 * 
 * @package AI_Tools_Directory
 */

/* CSS Variables */
:root {
    --primary-color: #2563eb;
    --primary-dark: #1d4ed8;
    --secondary-color: #64748b;
    --accent-color: #8b5cf6;
    --success-color: #22c55e;
    --warning-color: #f97316;
    --danger-color: #ef4444;
    --purple-color: #8b5cf6;
    
    --bg-color: #ffffff;
    --bg-secondary: #f8fafc;
    --bg-dark: #1e293b;
    
    --text-primary: #1e293b;
    --text-secondary: #64748b;
    --text-light: #94a3b8;
    
    --border-color: #e2e8f0;
    --border-radius: 12px;
    --border-radius-sm: 8px;
    --border-radius-lg: 16px;
    
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
    --shadow-xl: 0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1);
    
    --transition: all 0.3s ease;
    --max-width: 1400px;
    --header-height: 70px;
}

/* Reset & Base */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-size: 16px;
    line-height: 1.6;
    color: var(--text-primary);
    background-color: var(--bg-color);
    -webkit-font-smoothing: antialiased;
}

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

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

img {
    max-width: 100%;
    height: auto;
}

h1, h2, h3, h4, h5, h6 {
    font-weight: 600;
    line-height: 1.3;
    color: var(--text-primary);
}

/* Container */
.container {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 20px;
}

/* Site Header */
.site-header {
    position: sticky;
    top: 0;
    z-index: 1000;
    background: var(--bg-color);
    border-bottom: 1px solid var(--border-color);
    height: var(--header-height);
    display: flex;
    align-items: center;
}

.header-container {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 20px;
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 30px;
}

.site-branding {
    flex-shrink: 0;
}

.site-logo {
    display: flex;
    align-items: center;
    gap: 10px;
}

.site-logo img {
    height: 40px;
    width: auto;
}

.site-title {
    font-size: 24px;
    font-weight: 700;
    color: var(--text-primary);
}

/* Main Navigation */
.main-navigation {
    flex: 1;
    display: flex;
    justify-content: center;
}

#primary-menu {
    display: flex;
    list-style: none;
    gap: 8px;
    margin: 0;
    padding: 0;
}

#primary-menu li a {
    display: block;
    padding: 8px 16px;
    color: var(--text-secondary);
    font-weight: 500;
    border-radius: var(--border-radius-sm);
    transition: var(--transition);
}

#primary-menu li a:hover {
    background: var(--bg-secondary);
    color: var(--primary-color);
}

#primary-menu li.current-menu-item a {
    color: var(--primary-color);
    background: rgba(37, 99, 235, 0.1);
}

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

.header-actions .search-form {
    display: none;
}

.btn-submit {
    display: inline-block;
    padding: 10px 20px;
    background: var(--primary-color);
    color: white;
    font-weight: 500;
    border-radius: var(--border-radius-sm);
    transition: var(--transition);
}

.btn-submit:hover {
    background: var(--primary-dark);
    color: white;
}

/* Mobile Toggle */
.mobile-toggle {
    display: none;
    flex-direction: column;
    gap: 5px;
    padding: 8px;
    background: none;
    border: none;
    cursor: pointer;
}

.mobile-toggle span {
    display: block;
    width: 24px;
    height: 2px;
    background: var(--text-primary);
    transition: var(--transition);
}

/* Mobile Navigation */
.mobile-navigation {
    position: fixed;
    top: 0;
    right: -100%;
    width: 300px;
    height: 100vh;
    background: var(--bg-color);
    z-index: 2000;
    transition: right 0.3s ease;
    padding: 20px;
    overflow-y: auto;
}

.mobile-navigation.active {
    right: 0;
}

.mobile-nav-close {
    text-align: right;
    margin-bottom: 20px;
}

.mobile-nav-close button {
    background: none;
    border: none;
    font-size: 32px;
    cursor: pointer;
    color: var(--text-primary);
}

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

.hero-title {
    font-size: 48px;
    font-weight: 800;
    margin-bottom: 16px;
    color: white;
}

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

.hero-search {
    max-width: 600px;
    margin: 0 auto 30px;
}

.search-input-wrapper {
    display: flex;
    background: white;
    border-radius: var(--border-radius);
    overflow: hidden;
    box-shadow: var(--shadow-lg);
}

.search-input-wrapper input {
    flex: 1;
    padding: 16px 24px;
    border: none;
    font-size: 16px;
    outline: none;
}

.search-input-wrapper button {
    padding: 16px 24px;
    background: var(--primary-color);
    border: none;
    color: white;
    cursor: pointer;
    transition: var(--transition);
}

.search-input-wrapper button:hover {
    background: var(--primary-dark);
}

.quick-links {
    display: flex;
    justify-content: center;
    gap: 15px;
    flex-wrap: wrap;
}

.quick-link {
    padding: 8px 16px;
    background: rgba(255, 255, 255, 0.2);
    color: white;
    border-radius: 20px;
    font-size: 14px;
    font-weight: 500;
    transition: var(--transition);
}

.quick-link:hover {
    background: rgba(255, 255, 255, 0.3);
    color: white;
}

/* Section Styles */
section {
    padding: 60px 20px;
}

.section-header {
    max-width: var(--max-width);
    margin: 0 auto 40px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.section-header h2 {
    font-size: 28px;
}

.view-all-link {
    font-weight: 500;
}

/* Categories Grid */
.categories-section {
    background: var(--bg-secondary);
}

.categories-grid {
    max-width: var(--max-width);
    margin: 0 auto;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 16px;
}

.category-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 24px 16px;
    background: var(--bg-color);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
    text-align: center;
}

.category-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
}

.category-icon {
    font-size: 32px;
}

.category-name {
    font-weight: 600;
    color: var(--text-primary);
}

.category-count {
    font-size: 14px;
    color: var(--text-secondary);
}

.category-all {
    background: var(--primary-color);
    color: white;
}

.category-all .category-name,
.category-all .category-count {
    color: white;
}

/* Tools Grid */
.tools-grid {
    max-width: var(--max-width);
    margin: 0 auto;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 24px;
}

/* Tool Card */
.tool-card {
    position: relative;
    background: var(--bg-color);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-lg);
    overflow: hidden;
    transition: var(--transition);
}

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

.featured-badge {
    position: absolute;
    top: 10px;
    right: 10px;
    width: 30px;
    height: 30px;
    background: #f59e0b;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    font-size: 14px;
    z-index: 10;
}

.tool-card-inner {
    padding: 20px;
}

.tool-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 16px;
}

.tool-icon {
    position: relative;
    width: 60px;
    height: 60px;
    flex-shrink: 0;
}

.tool-icon img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: var(--border-radius-sm);
}

.tool-icon-placeholder {
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, var(--primary-color), var(--accent-color));
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    font-weight: 700;
    border-radius: var(--border-radius-sm);
}

.verified-icon {
    position: absolute;
    bottom: -4px;
    right: -4px;
    width: 20px;
    height: 20px;
    background: var(--success-color);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.verified-icon svg {
    width: 12px;
    height: 12px;
}

.tool-pricing {
    flex-shrink: 0;
}

.tool-card-body {
    margin-bottom: 16px;
}

.tool-name {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 8px;
    line-height: 1.4;
}

.tool-name a {
    color: var(--text-primary);
}

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

.tool-excerpt {
    font-size: 14px;
    color: var(--text-secondary);
    margin-bottom: 12px;
    line-height: 1.5;
}

.tool-categories {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.category-tag {
    display: inline-block;
    padding: 4px 10px;
    background: var(--bg-secondary);
    color: var(--text-secondary);
    font-size: 12px;
    border-radius: 12px;
}

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

.tool-votes .vote-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 12px;
    background: var(--bg-secondary);
    border: none;
    border-radius: var(--border-radius-sm);
    cursor: pointer;
    font-size: 14px;
    color: var(--text-secondary);
    transition: var(--transition);
}

.tool-votes .vote-btn:hover {
    background: var(--primary-color);
    color: white;
}

.tool-actions .btn-visit {
    display: inline-block;
    padding: 8px 16px;
    background: var(--primary-color);
    color: white;
    font-weight: 500;
    border-radius: var(--border-radius-sm);
    font-size: 14px;
}

.tool-actions .btn-visit:hover {
    background: var(--primary-dark);
    color: white;
}

/* Pricing Labels */
.pricing-label {
    display: inline-block;
    padding: 4px 10px;
    font-size: 12px;
    font-weight: 600;
    border-radius: 12px;
}

.pricing-free {
    background: rgba(34, 197, 94, 0.1);
    color: var(--success-color);
}

.pricing-freemium {
    background: rgba(249, 115, 22, 0.1);
    color: var(--warning-color);
}

.pricing-paid {
    background: rgba(239, 68, 68, 0.1);
    color: var(--danger-color);
}

.pricing-trial {
    background: rgba(139, 92, 246, 0.1);
    color: var(--purple-color);
}

/* Featured Section */
.featured-section {
    background: var(--bg-color);
}

.featured-grid {
    max-width: var(--max-width);
    margin: 0 auto;
}

/* Pricing Cards */
.pricing-section {
    background: var(--bg-secondary);
}

.pricing-cards {
    max-width: var(--max-width);
    margin: 0 auto;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
}

.pricing-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 30px 20px;
    background: var(--bg-color);
    border: 2px solid var(--border-color);
    border-radius: var(--border-radius-lg);
    transition: var(--transition);
    text-align: center;
}

.pricing-card:hover {
    border-color: var(--accent);
    transform: translateY(-4px);
}

.pricing-name {
    font-size: 20px;
    font-weight: 700;
    color: var(--accent);
}

.pricing-count {
    font-size: 14px;
    color: var(--text-secondary);
}

/* Latest Section */
.latest-section {
    background: var(--bg-color);
}

.latest-grid {
    max-width: var(--max-width);
    margin: 0 auto;
}

/* Newsletter Section */
.newsletter-section {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    padding: 80px 20px;
}

.newsletter-content {
    max-width: 600px;
    margin: 0 auto;
    text-align: center;
    color: white;
}

.newsletter-content h2 {
    font-size: 32px;
    color: white;
    margin-bottom: 16px;
}

.newsletter-content p {
    font-size: 18px;
    opacity: 0.9;
    margin-bottom: 30px;
}

.newsletter-form {
    display: flex;
    gap: 10px;
    max-width: 500px;
    margin: 0 auto;
}

.newsletter-form input {
    flex: 1;
    padding: 14px 20px;
    border: none;
    border-radius: var(--border-radius-sm);
    font-size: 16px;
}

.newsletter-form button {
    padding: 14px 30px;
    background: var(--text-primary);
    color: white;
    border: none;
    border-radius: var(--border-radius-sm);
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
}

.newsletter-form button:hover {
    background: var(--bg-dark);
}

/* Single Tool Page */
.single-tool-page {
    padding: 40px 20px;
}

.tool-article {
    max-width: 1000px;
    margin: 0 auto;
    background: var(--bg-color);
    border-radius: var(--border-radius-lg);
    padding: 40px;
    box-shadow: var(--shadow-md);
}

.tool-header {
    display: flex;
    gap: 24px;
    align-items: flex-start;
    margin-bottom: 40px;
    padding-bottom: 30px;
    border-bottom: 1px solid var(--border-color);
}

.tool-header .tool-icon {
    width: 100px;
    height: 100px;
}

.tool-title-area {
    flex: 1;
}

.tool-title {
    font-size: 32px;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.verified-badge {
    color: var(--success-color);
}

.tool-meta {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.tool-actions .btn-visit {
    padding: 14px 32px;
    font-size: 16px;
}

.tool-content {
    display: grid;
    grid-template-columns: 1fr 300px;
    gap: 40px;
}

.tool-description h2,
.tool-full-description h2 {
    font-size: 20px;
    margin-bottom: 16px;
}

.tool-sidebar {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.tool-stats {
    background: var(--bg-secondary);
    border-radius: var(--border-radius);
    padding: 24px;
}

.stat-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 0;
    border-bottom: 1px solid var(--border-color);
}

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

.stat-label {
    font-size: 14px;
    color: var(--text-secondary);
}

.stat-value {
    font-weight: 600;
    color: var(--text-primary);
}

.stat-item .btn-vote {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: var(--border-radius-sm);
    cursor: pointer;
    font-size: 14px;
    margin-top: 10px;
    width: 100%;
    justify-content: center;
}

.tool-share {
    background: var(--bg-secondary);
    border-radius: var(--border-radius);
    padding: 24px;
    text-align: center;
}

.share-label {
    display: block;
    font-weight: 600;
    margin-bottom: 16px;
}

.share-buttons {
    display: flex;
    justify-content: center;
    gap: 12px;
}

.share-btn {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-color);
    border-radius: 50%;
    color: var(--text-secondary);
    transition: var(--transition);
}

.share-btn:hover {
    color: var(--primary-color);
    transform: translateY(-2px);
}

/* Archive Page */
.archive-page {
    padding: 40px 20px;
    max-width: var(--max-width);
    margin: 0 auto;
}

.archive-header {
    margin-bottom: 40px;
}

.archive-title {
    font-size: 36px;
    margin-bottom: 20px;
}

.archive-filters {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
    flex-wrap: wrap;
}

.filter-section {
    display: flex;
    align-items: center;
    gap: 12px;
}

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

.pricing-filters {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.filter-btn {
    padding: 8px 16px;
    background: var(--bg-secondary);
    color: var(--text-secondary);
    border-radius: 20px;
    font-size: 14px;
    font-weight: 500;
    transition: var(--transition);
}

.filter-btn:hover,
.filter-btn.active {
    background: var(--primary-color);
    color: white;
}

.filter-section select {
    padding: 10px 16px;
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-sm);
    font-size: 14px;
    cursor: pointer;
    background: var(--bg-color);
}

/* Footer */
.site-footer {
    background: var(--bg-dark);
    color: white;
    padding: 60px 20px 30px;
}

.footer-container {
    max-width: var(--max-width);
    margin: 0 auto;
}

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

.footer-widget h3 {
    color: white;
    font-size: 18px;
    margin-bottom: 20px;
}

.footer-widget p {
    color: rgba(255, 255, 255, 0.7);
    line-height: 1.6;
}

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

.footer-links li {
    margin-bottom: 12px;
}

.footer-links a {
    color: rgba(255, 255, 255, 0.7);
    transition: var(--transition);
}

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

.site-info {
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    padding-top: 30px;
}

.footer-bottom {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 20px;
}

.footer-bottom p {
    color: rgba(255, 255, 255, 0.5);
    font-size: 14px;
}

#footer-menu {
    display: flex;
    list-style: none;
    gap: 20px;
}

#footer-menu a {
    color: rgba(255, 255, 255, 0.7);
    font-size: 14px;
}

/* Pagination */
.aitd-pagination {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin: 40px 0;
}

.aitd-pagination a,
.aitd-pagination span {
    display: inline-block;
    padding: 10px 16px;
    background: var(--bg-secondary);
    color: var(--text-secondary);
    border-radius: var(--border-radius-sm);
    font-weight: 500;
    transition: var(--transition);
}

.aitd-pagination a:hover,
.aitd-pagination .current {
    background: var(--primary-color);
    color: white;
}

/* Responsive */
@media (max-width: 1024px) {
    .tool-content {
        grid-template-columns: 1fr;
    }
    
    .tool-sidebar {
        order: -1;
    }
}

@media (max-width: 768px) {
    .main-navigation {
        display: none;
    }
    
    .mobile-toggle {
        display: flex;
    }
    
    .header-actions .btn-submit {
        display: none;
    }
    
    .hero-title {
        font-size: 32px;
    }
    
    .hero-subtitle {
        font-size: 16px;
    }
    
    .section-header {
        flex-direction: column;
        gap: 16px;
        text-align: center;
    }
    
    .categories-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .tools-grid {
        grid-template-columns: 1fr;
    }
    
    .tool-header {
        flex-direction: column;
        text-align: center;
    }
    
    .tool-header .tool-icon {
        margin: 0 auto;
    }
    
    .tool-title-area {
        text-align: center;
    }
    
    .tool-meta {
        justify-content: center;
    }
    
    .tool-actions {
        width: 100%;
    }
    
    .tool-actions .btn-visit {
        display: block;
        text-align: center;
    }
    
    .archive-filters {
        flex-direction: column;
    }
    
    .filter-section {
        width: 100%;
        justify-content: center;
    }
    
    .newsletter-form {
        flex-direction: column;
    }
    
    .footer-bottom {
        flex-direction: column;
        text-align: center;
    }
}

/* No Results */
.no-results,
.no-tools,
.no-tools-message {
    text-align: center;
    padding: 60px 20px;
    grid-column: 1 / -1;
}

.no-results h1,
.no-tools h1 {
    font-size: 24px;
    margin-bottom: 16px;
}

/* Search Form */
.search-form {
    position: relative;
}

.search-form label {
    display: block;
}

.search-form input[type="search"] {
    width: 100%;
    padding: 10px 16px;
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-sm);
    font-size: 14px;
}

.search-form input[type="search"]:focus {
    outline: none;
    border-color: var(--primary-color);
}

/* Screen Reader Text */
.screen-reader-text {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.skip-link {
    position: absolute;
    top: -40px;
    left: 0;
    background: var(--primary-color);
    color: white;
    padding: 8px 16px;
    z-index: 100;
    transition: top 0.3s;
}

.skip-link:focus {
    top: 0;
}
