/*
Purpose: Stylesheet for Minds4AI Free Tools page
Author: AI Assistant
Last Modified: 2025-01-27
*/

/* CSS Variables for consistency */
:root {
    --primary-color: #8f4ff0;
    --primary-dark: #7c3aed;
    --secondary-color: #8f4ff0;
    --accent-color: #100d28;
    --text-primary: #1e293b;
    --text-secondary: #64748b;
    --text-light: #cbd5e1;
    --background-light: #f8fafc;
    --background-white: #ffffff;
    --border-color: #e2e8f0;
    --shadow-light: 0 10px 30px rgba(0, 0, 0, 0.1);
    --shadow-medium: 0 20px 40px rgba(0, 0, 0, 0.15);
    --gradient-primary: linear-gradient(135deg, #100d28 0%, #100d28 80%, #3d0e82 100%);
    --border-radius: 20px;
    --border-radius-small: 12px;
    --transition: all 0.3s ease;
}

/* Tools Hero Section */
.tools-hero {
    padding: 120px 0 80px;
    background: linear-gradient(135deg, 
        #000000 0%, 
        #100d28 70%, 
        #3d0e82 99%, 
        #3d0e82 100%);
    color: white;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.tools-hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><defs><pattern id="grid" width="10" height="10" patternUnits="userSpaceOnUse"><path d="M 10 0 L 0 0 0 10" fill="none" stroke="rgba(255,255,255,0.1)" stroke-width="0.5"/></pattern></defs><rect width="100" height="100" fill="url(%23grid)"/></svg>') repeat;
    opacity: 0.3;
}

.tools-hero .hero-content {
    position: relative;
    z-index: 2;
    max-width: 800px;
    margin: 0 auto;
}

.tools-hero h1 {
    font-size: 3.5rem;
    margin-bottom: 1.5rem;
    font-weight: 700;
    line-height: 1.2;
}

.tools-hero p {
    font-size: 1.3rem;
    margin-bottom: 3rem;
    opacity: 0.9;
    line-height: 1.6;
}

/* Hero Stats */
.hero-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 2rem;
    max-width: 600px;
    margin: 0 auto;
}

.stat {
    text-align: center;
}

.stat-number {
    display: block;
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    color: white;
}

.stat-label {
    font-size: 0.9rem;
    opacity: 0.8;
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* Filter Section */
.tools-filter {
    padding: 40px 0;
    background: var(--background-white);
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: 70px;
    z-index: 100;
    backdrop-filter: blur(10px);
}

.filter-controls {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    align-items: center;
}

/* Search Container */
.search-container {
    position: relative;
    max-width: 500px;
    width: 100%;
}

.search-container i {
    position: absolute;
    left: 20px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-secondary);
    z-index: 2;
}

.search-container input {
    width: 100%;
    padding: 15px 20px 15px 50px;
    border: 2px solid var(--border-color);
    border-radius: 50px;
    font-size: 1rem;
    transition: var(--transition);
    background: var(--background-white);
}

.search-container input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(143, 79, 240, 0.1);
}

.clear-btn {
    position: absolute;
    right: 15px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 5px;
    border-radius: 50%;
    transition: var(--transition);
    opacity: 0;
    visibility: hidden;
}

.clear-btn.visible {
    opacity: 1;
    visibility: visible;
}

.clear-btn:hover {
    background: var(--background-light);
    color: var(--text-primary);
}

/* Category Filters */
.category-filters {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
    justify-content: center;
}

.filter-btn {
    padding: 10px 20px;
    border: 2px solid var(--border-color);
    background: var(--background-white);
    color: var(--text-secondary);
    border-radius: 50px;
    cursor: pointer;
    transition: var(--transition);
    font-weight: 500;
    font-size: 0.9rem;
}

.filter-btn:hover {
    border-color: var(--primary-color);
    color: var(--primary-color);
}

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

/* Tools Section */
.tools-section {
    padding: 60px 0;
    background: var(--background-light);
    min-height: 60vh;
}

/* Tools Grid */
.tools-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 2rem;
    margin-bottom: 3rem;
}

/* Tool Card */
.tool-card {
    background: var(--background-white);
    border-radius: var(--border-radius);
    padding: 2rem;
    box-shadow: var(--shadow-light);
    transition: var(--transition);
    border: 1px solid var(--border-color);
    position: relative;
    overflow: hidden;
}

.tool-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: var(--gradient-primary);
    transform: scaleX(0);
    transition: var(--transition);
}

.tool-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-medium);
}

.tool-card:hover::before {
    transform: scaleX(1);
}

/* Tool Icon */
.tool-icon {
    width: 60px;
    height: 60px;
    background: var(--gradient-primary);
    border-radius: var(--border-radius-small);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1.5rem;
    transition: var(--transition);
}

.tool-icon i {
    font-size: 1.5rem;
    color: white;
}

.tool-card:hover .tool-icon {
    transform: scale(1.1);
}

/* Tool Content */
.tool-header {
    margin-bottom: 1rem;
}

.tool-title {
    font-size: 1.3rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
    line-height: 1.3;
}

.tool-category {
    display: inline-block;
    padding: 4px 12px;
    background: var(--background-light);
    color: var(--text-secondary);
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.tool-description {
    color: var(--text-secondary);
    line-height: 1.6;
    margin-bottom: 1.5rem;
}

.tool-features {
    list-style: none;
    margin-bottom: 1.5rem;
}

.tool-features li {
    padding: 0.3rem 0;
    color: var(--text-secondary);
    font-size: 0.9rem;
    position: relative;
    padding-left: 1.5rem;
}

.tool-features li::before {
    content: '✓';
    position: absolute;
    left: 0;
    color: var(--primary-color);
    font-weight: bold;
}

.tool-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: auto;
}

.tool-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 12px 24px;
    background: var(--primary-color);
    color: white;
    text-decoration: none;
    border-radius: 50px;
    font-weight: 600;
    transition: var(--transition);
    border: none;
    cursor: pointer;
}

.tool-btn:hover {
    background: var(--primary-dark);
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(143, 79, 240, 0.3);
}

.tool-popularity {
    display: flex;
    align-items: center;
    gap: 0.3rem;
    color: var(--text-secondary);
    font-size: 0.8rem;
}

.popularity-stars {
    color: #fbbf24;
}

/* Loading State */
.loading-state {
    text-align: center;
    padding: 4rem 0;
    color: var(--text-secondary);
}

.loading-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid var(--border-color);
    border-top: 3px solid var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 1rem;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* No Results */
.no-results {
    text-align: center;
    padding: 4rem 0;
    color: var(--text-secondary);
}

.no-results i {
    font-size: 3rem;
    margin-bottom: 1rem;
    opacity: 0.5;
}

.no-results h3 {
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
    color: var(--text-primary);
}

/* CTA Section */
.tools-cta {
    padding: 80px 0;
    background: var(--background-black);
    text-align: center;
}

.cta-content h2 {
    font-size: 2.5rem;
    margin-bottom: 1rem;
    color: var(--text-primary);
}

.cta-content p {
    font-size: 1.1rem;
    color: var(--text-secondary);
    margin-bottom: 2rem;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

.cta-buttons {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
}

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

.tool-card {
    animation: fadeInUp 0.6s ease forwards;
}

.tool-card:nth-child(1) { animation-delay: 0.1s; }
.tool-card:nth-child(2) { animation-delay: 0.2s; }
.tool-card:nth-child(3) { animation-delay: 0.3s; }
.tool-card:nth-child(4) { animation-delay: 0.4s; }
.tool-card:nth-child(5) { animation-delay: 0.5s; }
.tool-card:nth-child(6) { animation-delay: 0.6s; }

/* Responsive Design */
@media (max-width: 768px) {
    .tools-hero {
        padding: 100px 0 60px;
    }
    
    .tools-hero h1 {
        font-size: 2.5rem;
    }
    
    .tools-hero p {
        font-size: 1.1rem;
    }
    
    .hero-stats {
        grid-template-columns: repeat(3, 1fr);
        gap: 1rem;
    }
    
    .stat-number {
        font-size: 2rem;
    }
    
    .filter-controls {
        gap: 1rem;
    }
    
    .category-filters {
        gap: 0.5rem;
    }
    
    .filter-btn {
        padding: 8px 16px;
        font-size: 0.8rem;
    }
    
    .tools-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
    
    .tool-card {
        padding: 1.5rem;
    }
    
    .cta-content h2 {
        font-size: 2rem;
    }
    
    .cta-buttons {
        flex-direction: column;
        align-items: center;
    }
}

@media (max-width: 480px) {
    .tools-hero h1 {
        font-size: 2rem;
    }
    
    .hero-stats {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
    
    .search-container input {
        padding: 12px 15px 12px 45px;
    }
    
    .tool-card {
        padding: 1.2rem;
    }
    
    .tool-footer {
        flex-direction: column;
        gap: 1rem;
        align-items: stretch;
    }
    
    .tool-btn {
        justify-content: center;
    }
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .tool-card {
        border: 2px solid var(--text-primary);
    }
    
    .filter-btn {
        border-width: 2px;
    }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
    .tool-card,
    .tool-icon,
    .tool-btn,
    .loading-spinner {
        animation: none;
        transition: none;
    }
    
    .tool-card:hover {
        transform: none;
    }
}

/* Tools Intro Section */
.tools-intro {
    padding: 80px 0;
    background: var(--background-light);
}

.intro-content {
    text-align: center;
    max-width: 1000px;
    margin: 0 auto;
}

.intro-content h2 {
    font-size: 2.5rem;
    margin-bottom: 1.5rem;
    color: var(--text-primary);
    font-weight: 700;
}

.intro-content > p {
    font-size: 1.2rem;
    color: var(--text-secondary);
    line-height: 1.7;
    margin-bottom: 3rem;
    max-width: 800px;
    margin-left: auto;
    margin-right: auto;
}

.intro-features {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
    margin-top: 3rem;
}

.intro-features .feature {
    background: var(--background-white);
    padding: 2rem;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-light);
    text-align: center;
    transition: var(--transition);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
}

.intro-features .feature:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-medium);
}

.intro-features .feature i {
    font-size: 2.5rem;
    color: var(--primary-color);
    margin-bottom: 1.5rem;
    display: block;
    width: 100%;
}

.intro-features .feature h3 {
    font-size: 1.3rem;
    margin-bottom: 1rem;
    color: var(--text-primary);
    font-weight: 600;
    display: block;
    width: 100%;
    text-align: center;
}

.intro-features .feature p {
    color: var(--text-secondary);
    line-height: 1.6;
    display: block;
    width: 100%;
    text-align: center;
    margin: 0;
}

/* Mobile Responsive for Intro Section */
@media (max-width: 768px) {
    .tools-intro {
        padding: 60px 0;
    }
    
    .intro-content h2 {
        font-size: 2rem;
    }
    
    .intro-content > p {
        font-size: 1.1rem;
        margin-bottom: 2rem;
    }
    
    .intro-features {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
    
    .intro-features .feature {
        padding: 1.5rem;
    }
}