/* ==========================================================================
   1. Variables & Design Tokens (Dark Mode Premium "Forge Brut")
   ========================================================================== */
:root {
    --bg-base: #0a0a0f;           /* Noir mat très profond */
    --bg-surface: linear-gradient(135deg, rgba(255, 255, 255, 0.12) 0%, rgba(255, 42, 166, 0.02) 100%); /* Dégradé de verre avec reflet rose */
    --bg-surface-hover: linear-gradient(135deg, rgba(255, 255, 255, 0.16) 0%, rgba(255, 42, 166, 0.05) 100%);
    
    --text-primary: #ffffff;      /* Blanc éclatant pour la lisibilité */
    --text-secondary: #9ca3af;    /* Gris clair/bleuté pour les textes secondaires */
    
    --accent-primary: #ff4757;    /* Rouge/Orange vibrant "Forge Brut" */
    --accent-primary-hover: #ff6b81; 
    --accent-glow: rgba(255, 71, 87, 0.2); /* Lueur d'accentuation */
    
    --radius-lg: 12px;            /* Bords arrondis modernes */
    --border-subtle: 1px solid rgba(255, 255, 255, 0.08);
    --border-subtle-hover: 1px solid rgba(255, 71, 87, 0.4);
}

/* ==========================================================================
   2. Reset & Base Styles
   ========================================================================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    background-color: var(--bg-base);
    background-image: 
        radial-gradient(circle at 15% 50%, rgba(255, 71, 87, 0.08), transparent 40%),
        radial-gradient(circle at 85% 30%, rgba(255, 107, 129, 0.08), transparent 40%),
        radial-gradient(circle at 50% 10%, rgba(255, 42, 166, 0.05), transparent 30%);
    background-attachment: fixed;
    color: var(--text-secondary);
    font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    line-height: 1.6;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

::-webkit-scrollbar {
    width: 12px;
}
::-webkit-scrollbar-track {
    background: var(--bg-base);
}
::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 6px;
    border: 3px solid var(--bg-base);
}
::-webkit-scrollbar-thumb:hover {
    background: var(--accent-primary);
}

main {
    flex-grow: 1;
}

h1, h2, h3 {
    color: var(--text-primary);
    font-weight: 800;
}

.hero h1, .header .hero-content h1 {
    background: linear-gradient(135deg, #ffffff 0%, #ffb1b8 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

a {
    text-decoration: none;
    color: inherit;
}

.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
}

/* ==========================================================================
   3. Header, Hero & Recherche
   ========================================================================== */
.header {
    padding: 1.5rem 0;
    border-bottom: var(--border-subtle);
    background: transparent;
}

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

.logo {
    font-size: 1.8rem;
    font-weight: 800;
    color: var(--text-primary);
}

body .header .top-bar {
    padding-left: 2rem !important;
    padding-right: 2rem !important;
    flex-wrap: wrap !important;
}

.slogan {
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.hero {
    padding: 4rem 0 2rem 0;
    text-align: center;
}

.hero h2 {
    font-size: 3.5rem;
    margin-bottom: 1rem;
    font-weight: 800;
    letter-spacing: -0.03em;
    background: linear-gradient(135deg, #ffffff 0%, var(--accent-primary) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.hero p {
    font-size: 1.1rem;
    max-width: 650px;
    margin: 0 auto 2rem auto;
    color: var(--text-secondary);
}

.search-container {
    max-width: 500px;
    margin: 0 auto 3rem auto;
}

.search-input {
    width: 100%;
    padding: 14px 20px;
    background: rgba(255, 255, 255, 0.05);
    border: var(--border-subtle);
    color: var(--text-primary);
    border-radius: 8px;
    font-size: 1rem;
    transition: all 0.3s ease;
}

.search-input::placeholder {
    color: #666;
}

.search-input:focus {
    outline: none;
    border-color: var(--accent-primary);
    background: rgba(255, 255, 255, 0.08);
    box-shadow: 0 0 15px var(--accent-glow);
}

/* ==========================================================================
   4. Layout de la Grille & Cartes d'outils
   ========================================================================== */
.category-title {
    font-size: 1.6rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-top: 2.5rem;
    margin-bottom: 1.5rem;
    letter-spacing: -0.01em;
}

.tools-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem;
    margin-bottom: 3.5rem;
}

.tool-card {
    background: var(--bg-surface);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-radius: var(--radius-lg);
    padding: 2rem;
    border: var(--border-subtle);
    border-top: 1px solid rgba(255, 255, 255, 0.3);
    border-left: 1px solid rgba(255, 255, 255, 0.2);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275), background 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    position: relative;
    overflow: hidden;
}

.tool-card::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0; height: 2px;
    background: linear-gradient(90deg, transparent, var(--accent-primary), transparent);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.tool-card:hover {
    background: var(--bg-surface-hover);
    border: var(--border-subtle-hover);
    transform: translateY(-5px);
    box-shadow: 0 15px 30px rgba(0,0,0,0.5), 0 0 20px var(--accent-glow);
}

.tool-card:hover::before {
    opacity: 1;
}

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

.tool-description {
    font-size: 0.95rem;
    color: var(--text-secondary);
    margin-bottom: 1.5rem;
    flex-grow: 1;
}

/* ==========================================================================
   5. Badges & Boutons Action
   ========================================================================== */
.badges-container {
    display: flex;
    gap: 6px;
    margin-bottom: 12px;
}

.badge {
    font-size: 0.7rem;
    font-weight: 700 !important;
    padding: 3px 8px;
    border-radius: 4px;
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-primary) !important;
    border: 1px solid rgba(255, 255, 255, 0.1);
    letter-spacing: 0.5px;
}

.badge-blue { background: rgba(255, 71, 87, 0.1) !important; color: #ff4757 !important; border-color: rgba(255, 71, 87, 0.3) !important; }
.badge-purple { background: rgba(255, 107, 129, 0.1) !important; color: #ff6b81 !important; border-color: rgba(255, 107, 129, 0.3) !important; }
.badge-green { background: rgba(255, 165, 2, 0.1) !important; color: #ffa502 !important; border-color: rgba(255, 165, 2, 0.3) !important; }

.btn-compact {
    display: inline-block;
    background: linear-gradient(135deg, #1a0505 0%, #991b1b 40%, #ef4444 80%, #f59e0b 100%);
    color: #ffffff;
    padding: 8px 20px;
    border-radius: 8px;
    font-weight: 600;
    font-size: 0.9rem;
    border: none;
    transition: all 0.3s ease;
    cursor: pointer;
    text-align: center;
    box-shadow: 0 2px 10px rgba(239, 68, 68, 0.2);
}

.btn-compact:hover {
    background: linear-gradient(135deg, #3f0a0a 0%, #b91c1c 40%, #f87171 80%, #fbbf24 100%);
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(245, 158, 11, 0.4);
}

/* ==========================================================================
   6. Ligne de Séparation & Footer
   ========================================================================== */
.tools-section + .tools-section {
    border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.footer {
    padding: 2rem 0;
    text-align: center;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    opacity: 0.6;
    font-size: 0.9rem;
}

/* ==========================================================================
   7. Filter Menu
   ========================================================================== */
.filter-menu-container {
    background: rgba(10, 10, 15, 0.85); /* Fond légèrement transparent */
    backdrop-filter: blur(10px); /* Effet Glassmorphism */
    border-bottom: var(--border-subtle);
    position: sticky;
    top: 0;
    z-index: 100;
    padding: 1rem 0;
}

.filter-menu {
    display: flex;
    gap: 12px;
    overflow-x: auto;
    padding-bottom: 4px;
    scrollbar-width: none;
    max-width: 900px;
    margin: 0 auto;
}

.filter-menu::-webkit-scrollbar {
    display: none;
}

.filter-btn {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-secondary);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 20px;
    padding: 8px 18px;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
    transition: all 0.2s ease;
}

.filter-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-primary);
}

.filter-btn.active {
    background: var(--accent-primary);
    color: #ffffff;
    border-color: var(--accent-primary);
    box-shadow: 0 0 15px var(--accent-glow);
}

.hidden {
    display: none !important;
}

/* ==========================================================================
   8. Responsive Mobile (Forge Brut Premium)
   ========================================================================== */
@media (max-width: 768px) {
    /* Padding global */
    .container {
        padding: 0 1rem !important;
    }
    
    /* Typographie */
    .hero h2 {
        font-size: 2.2rem !important;
    }
    
    /* Header & Navigation */
    body .header .top-bar {
        flex-direction: column !important;
        gap: 15px !important;
        align-items: center !important;
        padding-left: 1rem !important;
        padding-right: 1rem !important;
        padding-top: 15px !important;
    }
    body .nav-links {
        justify-content: center !important;
        flex-wrap: wrap !important;
        width: 100% !important;
        gap: 15px !important;
    }
    body .nav-links a {
        font-size: 0.95rem !important;
    }
    
    /* Cartes */
    .tool-card {
        padding: 1.5rem !important;
    }
}
