/*
Theme Name: IndexGPT Theme
Theme URI: https://indexgpt.fr
Author: IndexGPT
Author URI: https://indexgpt.fr
Description: Thème personnalisé pour IndexGPT - Le Guide des Outils IA en France
Version: 1.0.0
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: indexgpt
Tags: ai, tools, directory, french, modern, responsive
*/

/* ==========================================================================
   Variables CSS
   ========================================================================== */
:root {
    /* Couleurs principales */
    --primary-color: #6366f1;
    --primary-dark: #4f46e5;
    --primary-light: #818cf8;
    --secondary-color: #0ea5e9;
    --accent-color: #f59e0b;

    /* Couleurs neutres */
    --dark: #1e293b;
    --dark-light: #334155;
    --gray: #64748b;
    --gray-light: #94a3b8;
    --light: #f1f5f9;
    --white: #ffffff;

    /* Couleurs de catégories */
    --cat-text: #10b981;
    --cat-image: #f59e0b;
    --cat-video: #ef4444;
    --cat-audio: #8b5cf6;
    --cat-code: #06b6d4;
    --cat-data: #ec4899;
    --cat-productivity: #14b8a6;
    --cat-marketing: #f97316;

    /* Typographie */
    --font-primary: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    --font-heading: 'Poppins', var(--font-primary);

    /* Espacements */
    --spacing-xs: 0.25rem;
    --spacing-sm: 0.5rem;
    --spacing-md: 1rem;
    --spacing-lg: 1.5rem;
    --spacing-xl: 2rem;
    --spacing-2xl: 3rem;
    --spacing-3xl: 4rem;

    /* Bordures */
    --radius-sm: 0.375rem;
    --radius-md: 0.5rem;
    --radius-lg: 0.75rem;
    --radius-xl: 1rem;
    --radius-full: 9999px;

    /* Ombres */
    --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);

    /* Transitions */
    --transition-fast: 150ms ease;
    --transition-normal: 300ms ease;
    --transition-slow: 500ms ease;
}

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

html {
    scroll-behavior: smooth;
    font-size: 16px;
}

body {
    font-family: var(--font-primary);
    font-size: 1rem;
    line-height: 1.6;
    color: var(--dark);
    background-color: var(--white);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* ==========================================================================
   Typographie
   ========================================================================== */
h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-heading);
    font-weight: 700;
    line-height: 1.2;
    color: var(--dark);
}

h1 { font-size: 2.5rem; }
h2 { font-size: 2rem; }
h3 { font-size: 1.5rem; }
h4 { font-size: 1.25rem; }
h5 { font-size: 1.125rem; }
h6 { font-size: 1rem; }

p {
    margin-bottom: var(--spacing-md);
}

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

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

/* ==========================================================================
   Layout
   ========================================================================== */
.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 var(--spacing-lg);
}

.section {
    padding: var(--spacing-3xl) 0;
}

/* ==========================================================================
   Header
   ========================================================================== */
.site-header {
    background: var(--white);
    border-bottom: 1px solid var(--light);
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: var(--shadow-sm);
}

.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--spacing-md) 0;
}

.site-logo {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    font-family: var(--font-heading);
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--dark);
}

.site-logo .logo-icon {
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    border-radius: var(--radius-lg);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--white);
    font-weight: 800;
}

.site-logo span {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Navigation */
.main-nav ul {
    display: flex;
    list-style: none;
    gap: var(--spacing-xl);
}

.main-nav a {
    color: var(--dark-light);
    font-weight: 500;
    padding: var(--spacing-sm) 0;
    position: relative;
}

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

.main-nav a::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--primary-color);
    transition: width var(--transition-normal);
}

.main-nav a:hover::after,
.main-nav a.active::after {
    width: 100%;
}

/* Search Bar */
.header-search {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
}

.search-input {
    padding: var(--spacing-sm) var(--spacing-md);
    border: 2px solid var(--light);
    border-radius: var(--radius-full);
    font-size: 0.875rem;
    width: 250px;
    transition: border-color var(--transition-fast);
}

.search-input:focus {
    outline: none;
    border-color: var(--primary-color);
}

/* ==========================================================================
   Hero Section
   ========================================================================== */
.hero {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    color: var(--white);
    padding: var(--spacing-3xl) 0;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.05'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
    opacity: 0.5;
}

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

.hero h1 {
    color: var(--white);
    font-size: 3rem;
    margin-bottom: var(--spacing-lg);
}

.hero p {
    font-size: 1.25rem;
    opacity: 0.9;
    margin-bottom: var(--spacing-xl);
}

.hero-search {
    max-width: 600px;
    margin: 0 auto;
    background: var(--white);
    border-radius: var(--radius-full);
    padding: var(--spacing-xs);
    box-shadow: var(--shadow-xl);
}

.hero-search form {
    display: flex;
    align-items: center;
    width: 100%;
}

.hero-search input[type="text"] {
    flex: 1;
    border: none;
    padding: var(--spacing-md) var(--spacing-lg);
    font-size: 1rem;
    border-radius: var(--radius-full);
    background: transparent;
    min-width: 0;
}

.hero-search input[type="text"]:focus {
    outline: none;
}

.hero-search button {
    background: var(--primary-color);
    color: var(--white);
    border: none;
    padding: var(--spacing-md) var(--spacing-xl);
    border-radius: var(--radius-full);
    font-weight: 600;
    cursor: pointer;
    transition: background var(--transition-fast);
    white-space: nowrap;
    flex-shrink: 0;
}

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

/* Stats */
.hero-stats {
    display: flex;
    justify-content: center;
    gap: var(--spacing-3xl);
    margin-top: var(--spacing-2xl);
}

.stat-item {
    text-align: center;
}

.stat-number {
    font-size: 2.5rem;
    font-weight: 700;
}

.stat-label {
    font-size: 0.875rem;
    opacity: 0.8;
}

/* ==========================================================================
   Categories Section
   ========================================================================== */
.categories-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: var(--spacing-lg);
}

.category-card {
    background: var(--white);
    border: 2px solid var(--light);
    border-radius: var(--radius-xl);
    padding: var(--spacing-xl);
    text-align: center;
    transition: all var(--transition-normal);
    cursor: pointer;
}

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

.category-icon {
    width: 60px;
    height: 60px;
    border-radius: var(--radius-lg);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto var(--spacing-md);
    font-size: 1.5rem;
}

.category-card.text .category-icon { background: rgba(16, 185, 129, 0.1); color: var(--cat-text); }
.category-card.image .category-icon { background: rgba(245, 158, 11, 0.1); color: var(--cat-image); }
.category-card.video .category-icon { background: rgba(239, 68, 68, 0.1); color: var(--cat-video); }
.category-card.audio .category-icon { background: rgba(139, 92, 246, 0.1); color: var(--cat-audio); }
.category-card.code .category-icon { background: rgba(6, 182, 212, 0.1); color: var(--cat-code); }
.category-card.data .category-icon { background: rgba(236, 72, 153, 0.1); color: var(--cat-data); }

.category-card h3 {
    font-size: 1.125rem;
    margin-bottom: var(--spacing-xs);
}

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

/* ==========================================================================
   Tools Grid
   ========================================================================== */
.tools-section {
    background: var(--light);
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--spacing-xl);
}

.section-header h2 {
    font-size: 1.75rem;
}

.view-all {
    color: var(--primary-color);
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: var(--spacing-xs);
}

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

/* Tool Card */
.tool-card {
    background: var(--white);
    border-radius: var(--radius-xl);
    overflow: hidden;
    transition: all var(--transition-normal);
    box-shadow: var(--shadow-sm);
}

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

.tool-card-header {
    padding: var(--spacing-lg);
    display: flex;
    gap: var(--spacing-md);
}

.tool-logo {
    width: 60px;
    height: 60px;
    border-radius: var(--radius-lg);
    object-fit: cover;
    flex-shrink: 0;
}

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

.tool-name {
    font-size: 1.125rem;
    font-weight: 600;
    margin-bottom: var(--spacing-xs);
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
}

.tool-name .verified {
    color: var(--secondary-color);
    font-size: 1rem;
}

.tool-category {
    display: inline-block;
    padding: var(--spacing-xs) var(--spacing-sm);
    background: var(--light);
    border-radius: var(--radius-full);
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--gray);
}

.tool-description {
    padding: 0 var(--spacing-lg);
    color: var(--gray);
    font-size: 0.875rem;
    line-height: 1.5;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

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

.tool-rating {
    display: flex;
    align-items: center;
    gap: var(--spacing-xs);
    color: var(--accent-color);
    font-weight: 600;
}

.tool-pricing {
    font-size: 0.875rem;
    font-weight: 500;
}

.tool-pricing.free {
    color: var(--cat-text);
}

.tool-pricing.freemium {
    color: var(--secondary-color);
}

.tool-pricing.paid {
    color: var(--gray);
}

/* ==========================================================================
   Buttons
   ========================================================================== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--spacing-sm);
    padding: var(--spacing-sm) var(--spacing-lg);
    border-radius: var(--radius-lg);
    font-weight: 600;
    font-size: 0.875rem;
    cursor: pointer;
    transition: all var(--transition-fast);
    border: none;
}

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

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

.btn-secondary {
    background: var(--light);
    color: var(--dark);
}

.btn-secondary:hover {
    background: var(--gray-light);
}

.btn-outline {
    background: transparent;
    border: 2px solid var(--primary-color);
    color: var(--primary-color);
}

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

/* ==========================================================================
   Footer
   ========================================================================== */
.site-footer {
    background: var(--dark);
    color: var(--white);
    padding: var(--spacing-3xl) 0 var(--spacing-xl);
}

.footer-grid {
    display: grid;
    grid-template-columns: 2fr repeat(3, 1fr);
    gap: var(--spacing-2xl);
    margin-bottom: var(--spacing-2xl);
}

.footer-brand {
    max-width: 300px;
}

.footer-brand .site-logo {
    margin-bottom: var(--spacing-md);
}

.footer-brand p {
    color: var(--gray-light);
    font-size: 0.875rem;
}

.footer-column h4 {
    color: var(--white);
    margin-bottom: var(--spacing-lg);
    font-size: 1rem;
}

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

.footer-column li {
    margin-bottom: var(--spacing-sm);
}

.footer-column a {
    color: var(--gray-light);
    font-size: 0.875rem;
    transition: color var(--transition-fast);
}

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

.footer-bottom {
    padding-top: var(--spacing-xl);
    border-top: 1px solid var(--dark-light);
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.875rem;
    color: var(--gray-light);
}

.footer-social {
    display: flex;
    gap: var(--spacing-md);
}

.footer-social a {
    color: var(--gray-light);
    font-size: 1.25rem;
}

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

/* ==========================================================================
   Responsive
   ========================================================================== */
@media (max-width: 1024px) {
    .footer-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    h1 { font-size: 2rem; }
    h2 { font-size: 1.5rem; }

    .hero h1 {
        font-size: 2rem;
    }

    .hero p {
        font-size: 1rem;
    }

    .hero-search {
        border-radius: var(--radius-xl);
    }

    .hero-search form {
        flex-direction: column;
        gap: var(--spacing-sm);
    }

    .hero-search input[type="text"],
    .hero-search button {
        width: 100%;
    }

    .hero-stats {
        flex-direction: column;
        gap: var(--spacing-lg);
    }

    .header-inner {
        flex-wrap: wrap;
    }

    .main-nav {
        order: 3;
        width: 100%;
        margin-top: var(--spacing-md);
    }

    .main-nav ul {
        justify-content: center;
        flex-wrap: wrap;
        gap: var(--spacing-md);
    }

    .header-search {
        display: none;
    }

    .tools-grid {
        grid-template-columns: 1fr;
    }

    .footer-grid {
        grid-template-columns: 1fr;
        text-align: center;
    }

    .footer-brand {
        max-width: 100%;
    }

    .footer-bottom {
        flex-direction: column;
        gap: var(--spacing-md);
    }
}

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

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

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

/* ==========================================================================
   Newsletter Forms
   ========================================================================== */
.newsletter-form {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-sm);
}

.newsletter-form input[type="email"] {
    padding: var(--spacing-sm) var(--spacing-md);
    border: 1px solid var(--gray-light);
    border-radius: var(--radius-md);
    font-size: 0.9rem;
    width: 100%;
}

.newsletter-form input[type="email"]:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 2px rgba(99, 102, 241, 0.2);
}

.newsletter-form button[type="submit"] {
    background: var(--primary-color);
    color: var(--white);
    border: none;
    padding: var(--spacing-sm) var(--spacing-md);
    border-radius: var(--radius-md);
    cursor: pointer;
    font-weight: 500;
    transition: background var(--transition-fast);
}

.newsletter-form button[type="submit"]:hover {
    background: var(--primary-dark);
}

.newsletter-form button[type="submit"]:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* Small consent checkbox for sidebar */
.newsletter-consent-small {
    display: flex;
    align-items: flex-start;
    gap: var(--spacing-xs);
    margin-top: var(--spacing-xs);
    font-size: 0.75rem;
    color: var(--gray);
    cursor: pointer;
    line-height: 1.4;
}

.newsletter-consent-small input[type="checkbox"] {
    width: 14px;
    height: 14px;
    margin-top: 2px;
    flex-shrink: 0;
    cursor: pointer;
}

.newsletter-consent-small a {
    color: var(--primary-color);
    text-decoration: underline;
}

.newsletter-consent-small a:hover {
    color: var(--primary-dark);
}

/* Sidebar cards */
.sidebar-card {
    background: var(--white);
    border-radius: var(--radius-lg);
    padding: var(--spacing-lg);
    box-shadow: var(--shadow-md);
    margin-bottom: var(--spacing-lg);
}

.sidebar-card h3 {
    font-size: 1.1rem;
    margin-bottom: var(--spacing-sm);
    color: var(--dark);
}

.sidebar-card p {
    font-size: 0.9rem;
    color: var(--gray);
    margin-bottom: var(--spacing-md);
}

.sidebar-card.newsletter-card {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color)) !important;
    color: var(--white);
}

.sidebar-card.newsletter-card h3,
.sidebar-card.newsletter-card p {
    color: var(--white) !important;
}

.sidebar-card.newsletter-card p {
    opacity: 0.9;
}

.sidebar-card.newsletter-card .newsletter-form input[type="email"] {
    border: none;
    background: var(--white);
    color: var(--dark);
}

.sidebar-card.newsletter-card .newsletter-form input[type="email"]::placeholder {
    color: var(--gray);
}

.sidebar-card.newsletter-card .newsletter-consent-small {
    color: rgba(255, 255, 255, 0.9);
    font-size: 0.75rem;
}

.sidebar-card.newsletter-card .newsletter-consent-small a {
    color: var(--white);
    text-decoration: underline;
}

/* Newsletter form home page */
.newsletter-form-home {
    max-width: 600px;
    margin: 0 auto;
}

.newsletter-consent-home {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin-top: 16px;
    font-size: 0.875rem;
    cursor: pointer;
    color: white;
}

.newsletter-consent-home input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
    flex-shrink: 0;
}

.newsletter-consent-home span {
    text-align: left;
}

.newsletter-consent-home a {
    color: white;
    text-decoration: underline;
}

.newsletter-consent-home a:hover {
    opacity: 0.8;
}
