/*
Theme Name: Code Défaut
Theme URI: https://code-defaut.fr
Author: AKIRA
Author URI: https://code-defaut.fr
Description: Thème professionnel pour la base de données de codes défauts automobiles
Version: 1.0
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: code-defaut
Tags: automotive, database, custom-post-type
*/

:root {
    --primary-color: #FF3B30;
    --secondary-color: #1C1C1E;
    --accent-color: #FFD60A;
    --background: #FAFAFA;
    --surface: #FFFFFF;
    --text-primary: #1C1C1E;
    --text-secondary: #6C6C70;
    --border: #E5E5EA;
    --success: #34C759;
    --warning: #FF9500;
    --error: #FF3B30;
}

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

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

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

/* Header & Navigation */
.site-header {
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 1000;
    backdrop-filter: blur(10px);
    background: rgba(255, 255, 255, 0.95);
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem 2rem;
    max-width: 1400px;
    margin: 0 auto;
}

.site-logo {
    display: flex;
    align-items: center;
    gap: 1rem;
    text-decoration: none;
}

.logo-icon {
    width: 48px;
    height: 48px;
    background: linear-gradient(135deg, var(--primary-color), #FF6B6B);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 900;
    font-size: 24px;
    color: white;
}

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

.main-nav ul {
    display: flex;
    list-style: none;
    gap: 2rem;
}

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

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

/* Hero Section */
.hero-section {
    background: linear-gradient(135deg, var(--secondary-color) 0%, #2C2C2E 100%);
    color: white;
    padding: 5rem 2rem;
    position: relative;
    overflow: hidden;
}

.hero-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml,<svg width="100" height="100" xmlns="http://www.w3.org/2000/svg"><rect width="1" height="1" fill="white" opacity="0.03"/></svg>');
    background-size: 50px 50px;
}

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

.hero-content h1 {
    font-size: 3.5rem;
    font-weight: 900;
    margin-bottom: 1.5rem;
    line-height: 1.1;
}

.hero-content p {
    font-size: 1.25rem;
    color: rgba(255, 255, 255, 0.8);
    margin-bottom: 2rem;
}

/* Search Box */
.search-box {
    max-width: 600px;
    margin: 3rem auto 0;
    position: relative;
}

.search-form {
    display: flex;
    gap: 1rem;
    background: white;
    padding: 0.5rem;
    border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

.search-input {
    flex: 1;
    padding: 1rem 1.5rem;
    border: none;
    font-size: 1.1rem;
    border-radius: 12px;
    outline: none;
    font-family: 'Space Grotesk', sans-serif;
}

.search-button {
    padding: 1rem 2rem;
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: 12px;
    font-weight: 600;
    font-size: 1.1rem;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
}

.search-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 30px rgba(255, 59, 48, 0.3);
}

/* Filters */
.filters-section {
    padding: 3rem 2rem;
    background: var(--surface);
}

.filters-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
    max-width: 1400px;
    margin: 0 auto;
}

.filter-group label {
    display: block;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: var(--text-primary);
}

.filter-select {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 2px solid var(--border);
    border-radius: 12px;
    font-size: 1rem;
    font-family: 'Space Grotesk', sans-serif;
    transition: border-color 0.2s;
    background: white;
}

.filter-select:focus {
    outline: none;
    border-color: var(--primary-color);
}

/* Results Grid */
.results-section {
    padding: 3rem 2rem;
}

.results-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 2rem;
    max-width: 1400px;
    margin: 0 auto;
}

.code-card {
    background: var(--surface);
    border-radius: 16px;
    padding: 2rem;
    border: 2px solid var(--border);
    transition: transform 0.2s, box-shadow 0.2s, border-color 0.2s;
    cursor: pointer;
}

.code-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
    border-color: var(--primary-color);
}

.code-header {
    display: flex;
    justify-content: space-between;
    align-items: start;
    margin-bottom: 1rem;
}

.code-number {
    font-size: 2rem;
    font-weight: 900;
    color: var(--primary-color);
    font-family: 'Courier New', monospace;
}

.severity-badge {
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
}

.severity-critical { background: #FFE5E5; color: var(--error); }
.severity-warning { background: #FFF4E5; color: var(--warning); }
.severity-info { background: #E5F4FF; color: #007AFF; }

.code-description {
    color: var(--text-primary);
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 1rem;
}

.code-meta {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

.meta-tag {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    background: var(--background);
    border-radius: 8px;
    font-size: 0.9rem;
    color: var(--text-secondary);
}

/* Single Code Page */
.single-code {
    max-width: 900px;
    margin: 3rem auto;
    padding: 0 2rem;
}

.code-detail-header {
    background: var(--surface);
    padding: 3rem;
    border-radius: 20px;
    margin-bottom: 2rem;
    border: 2px solid var(--border);
}

.detail-code {
    font-size: 3rem;
    font-weight: 900;
    color: var(--primary-color);
    font-family: 'Courier New', monospace;
    margin-bottom: 1rem;
}

.detail-title {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 1.5rem;
}

.detail-meta {
    display: flex;
    gap: 2rem;
    flex-wrap: wrap;
    padding-top: 1.5rem;
    border-top: 2px solid var(--border);
}

.content-section {
    background: var(--surface);
    padding: 2rem;
    border-radius: 16px;
    margin-bottom: 2rem;
    border: 2px solid var(--border);
}

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

.content-section ul {
    list-style: none;
    padding: 0;
}

.content-section li {
    padding: 0.75rem 0;
    border-bottom: 1px solid var(--border);
    position: relative;
    padding-left: 2rem;
}

.content-section li:last-child {
    border-bottom: none;
}

.content-section li::before {
    content: '→';
    position: absolute;
    left: 0;
    color: var(--primary-color);
    font-weight: 700;
}

/* Footer */
.site-footer {
    background: var(--secondary-color);
    color: white;
    padding: 3rem 2rem;
    margin-top: 5rem;
}

.footer-content {
    max-width: 1400px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 3rem;
}

.footer-section h3 {
    margin-bottom: 1rem;
    font-size: 1.2rem;
}

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

.footer-section a {
    color: rgba(255, 255, 255, 0.7);
    text-decoration: none;
    line-height: 2;
    transition: color 0.2s;
}

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

/* Responsive */
@media (max-width: 768px) {
    .hero-content h1 {
        font-size: 2.5rem;
    }
    
    .results-grid {
        grid-template-columns: 1fr;
    }
    
    .header-content {
        flex-direction: column;
        gap: 1rem;
    }
    
    .main-nav ul {
        gap: 1rem;
    }
}
