/* === RESET & BASE === */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary: #2563eb;
    --primary-dark: #1d4ed8;
    --primary-light: #dbeafe;
    --text: #1e293b;
    --text-light: #64748b;
    --bg: #f8fafc;
    --white: #ffffff;
    --border: #e2e8f0;
    --radius: 8px;
    --shadow: 0 1px 3px rgba(0,0,0,0.1);
    --shadow-md: 0 4px 6px rgba(0,0,0,0.07);
    --max-width: 1200px;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    line-height: 1.6;
    color: var(--text);
    background: var(--bg);
}

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

a:hover {
    text-decoration: underline;
}

/* === NAVBAR === */
.navbar {
    background: var(--white);
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: var(--shadow);
}

.navbar-inner {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 1rem;
    display: flex;
    align-items: center;
    height: 60px;
    gap: 0.5rem;
}

.navbar-logo {
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--primary);
    text-decoration: none;
    white-space: nowrap;
    flex-shrink: 0;
}

.navbar-logo:hover {
    text-decoration: none;
}

.navbar-toggle {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    flex-direction: column;
    gap: 4px;
    padding: 4px;
}

.navbar-toggle span {
    display: block;
    width: 24px;
    height: 3px;
    background: var(--text);
    border-radius: 2px;
    transition: 0.3s;
}

.navbar-menu {
    display: flex;
    list-style: none;
    gap: 0;
    align-items: center;
    flex-wrap: nowrap;
    flex-shrink: 0;
}

.navbar-item {
    position: relative;
}

.navbar-link {
    display: block;
    padding: 0.4rem 0.55rem;
    color: var(--text);
    font-size: 0.8rem;
    font-weight: 500;
    text-decoration: none;
    border-radius: var(--radius);
    transition: background 0.2s;
    white-space: nowrap;
}

.navbar-link:hover,
.navbar-item.active > .navbar-link {
    background: var(--primary-light);
    color: var(--primary);
    text-decoration: none;
}

.navbar-dropdown {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-md);
    list-style: none;
    min-width: 240px;
    padding: 0.5rem 0;
    z-index: 200;
}

.navbar-item:hover .navbar-dropdown {
    display: block;
}

.navbar-dropdown li a {
    display: block;
    padding: 0.5rem 1rem;
    color: var(--text);
    font-size: 0.85rem;
    text-decoration: none;
    transition: background 0.2s;
}

.navbar-dropdown li a:hover {
    background: var(--primary-light);
    color: var(--primary);
    text-decoration: none;
}

/* === SEARCH === */
.navbar-search {
    position: relative;
    flex: 1;
    min-width: 0;
    max-width: 200px;
}

.navbar-search input {
    padding: 0.35rem 0.6rem;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-size: 0.8rem;
    width: 100%;
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.navbar-search input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.search-results {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-md);
    z-index: 300;
    margin-top: 4px;
    max-height: 320px;
    overflow-y: auto;
}

.search-results a {
    display: block;
    padding: 0.5rem 0.75rem;
    color: var(--text);
    font-size: 0.85rem;
    text-decoration: none;
    border-bottom: 1px solid var(--border);
}

.search-results a:last-child {
    border-bottom: none;
}

.search-results a:hover {
    background: var(--primary-light);
    color: var(--primary);
    text-decoration: none;
}

.search-category {
    padding: 0.4rem 0.75rem;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    color: var(--text-light);
    background: var(--bg);
    letter-spacing: 0.5px;
}

/* === PAGE LAYOUT === */
.page-container {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 2rem 1rem;
}

.tool-container {
    display: grid;
    grid-template-columns: 1fr 300px;
    gap: 2rem;
    align-items: start;
}

.tool-main {
    min-width: 0;
}

.tool-main h1 {
    font-size: 1.8rem;
    margin-bottom: 1rem;
    color: var(--text);
    line-height: 1.3;
}

/* === TOOL CARD (contenu outil) === */
.tool-card {
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    box-shadow: var(--shadow);
}

.tool-card h2 {
    font-size: 1.2rem;
    margin-bottom: 1rem;
    color: var(--text);
}

/* === FORMULAIRES OUTILS === */
.tool-form {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.form-group label {
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--text);
}

.form-group input,
.form-group select,
.form-group textarea {
    padding: 0.65rem 0.85rem;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-size: 1rem;
    font-family: inherit;
    transition: border-color 0.2s;
    background: var(--white);
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-light);
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.65rem 1.5rem;
    font-size: 1rem;
    font-weight: 600;
    border: none;
    border-radius: var(--radius);
    cursor: pointer;
    transition: background 0.2s, transform 0.1s;
    font-family: inherit;
}

.btn:active {
    transform: scale(0.98);
}

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

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

.btn-secondary {
    background: var(--border);
    color: var(--text);
}

.btn-secondary:hover {
    background: #cbd5e1;
}

/* === RÉSULTAT === */
.result-box {
    background: var(--primary-light);
    border: 1px solid var(--primary);
    border-radius: var(--radius);
    padding: 1.25rem;
    margin-top: 1rem;
    text-align: center;
}

.result-box .result-label {
    font-size: 0.85rem;
    color: var(--text-light);
    margin-bottom: 0.25rem;
}

.result-box .result-value {
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--primary-dark);
}

/* === CONTENU EXPLICATIF (SEO) === */
.content-section {
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.5rem;
    margin-top: 1.5rem;
    box-shadow: var(--shadow);
}

.unique-content .unique-intro {
    font-size: 1.05rem;
    line-height: 1.7;
    color: var(--text);
    background: var(--primary-light, #f5f9ff);
    border-left: 3px solid var(--primary, #2563eb);
    padding: 1rem 1.25rem;
    border-radius: 4px;
    margin-bottom: 1.25rem;
}

.unique-content .tips-list {
    list-style: none;
    padding-left: 0;
    margin-left: 0;
}

.unique-content .tips-list li {
    position: relative;
    padding: 0.5rem 0 0.5rem 1.75rem;
    border-bottom: 1px dashed var(--border);
    color: var(--text-light);
    line-height: 1.6;
}

.unique-content .tips-list li:last-child {
    border-bottom: none;
}

.unique-content .tips-list li::before {
    content: "💡";
    position: absolute;
    left: 0;
    top: 0.4rem;
}

.content-section h2 {
    font-size: 1.3rem;
    margin-bottom: 0.75rem;
    color: var(--text);
}

.content-section h3 {
    font-size: 1.1rem;
    margin: 1rem 0 0.5rem;
    color: var(--text);
}

.content-section p {
    margin-bottom: 0.75rem;
    color: var(--text-light);
    line-height: 1.7;
}

.content-section ul,
.content-section ol {
    margin: 0.5rem 0 1rem 1.5rem;
    color: var(--text-light);
}

.content-section li {
    margin-bottom: 0.35rem;
}

/* === FAQ (Schema.org) === */
.faq-section {
    margin-top: 1.5rem;
}

.faq-item {
    border-bottom: 1px solid var(--border);
    padding: 1rem 0;
}

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

.faq-question {
    font-weight: 600;
    font-size: 1rem;
    color: var(--text);
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.faq-question::after {
    content: '+';
    font-size: 1.2rem;
    color: var(--text-light);
    transition: transform 0.2s;
}

.faq-item.open .faq-question::after {
    content: '−';
}

.faq-answer {
    display: none;
    padding-top: 0.5rem;
    color: var(--text-light);
    line-height: 1.7;
}

.faq-item.open .faq-answer {
    display: block;
}

/* === SIDEBAR === */
.tool-sidebar {
    position: sticky;
    top: 80px;
}

.sidebar-section {
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.25rem;
    margin-bottom: 1rem;
    box-shadow: var(--shadow);
}

.sidebar-section h3 {
    font-size: 1rem;
    margin-bottom: 0.75rem;
    color: var(--text);
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--border);
}

.sidebar-tools {
    list-style: none;
}

.sidebar-tools li {
    margin-bottom: 0.35rem;
}

.sidebar-tools a {
    display: block;
    padding: 0.35rem 0.5rem;
    font-size: 0.85rem;
    color: var(--text);
    border-radius: 4px;
    transition: background 0.2s;
    text-decoration: none;
}

.sidebar-tools a:hover {
    background: var(--primary-light);
    color: var(--primary);
}

/* === AD SLOTS ===
   min-height réserve l'espace avant le chargement AdSense (anti-CLS).
   Contain:size évite que le contenu de la pub impacte le layout parent. */
.ad-slot {
    margin: 1rem 0;
    min-height: 90px;
    contain: size layout;
    overflow: hidden;
}

.ad-slot-top {
    min-height: 90px;
}

.ad-slot-in-content {
    min-height: 250px;
}

.ad-slot-bottom {
    min-height: 250px;
}

.ad-slot-sidebar {
    min-height: 600px;
}

.ad-placeholder {
    background: #f1f5f9;
    border: 2px dashed var(--border);
    border-radius: var(--radius);
    padding: 2rem;
    text-align: center;
    color: var(--text-light);
    font-size: 0.85rem;
}

.ad-slot-sidebar .ad-placeholder {
    min-height: 250px;
    display: flex;
    align-items: center;
    justify-content: center;
}

@media (max-width: 768px) {
    .ad-slot-top { min-height: 100px; }
    .ad-slot-in-content { min-height: 280px; }
    .ad-slot-bottom { min-height: 280px; }
    .ad-slot-sidebar { min-height: 280px; }
}

/* === HOME PAGE === */
.home-intro {
    text-align: center;
    max-width: 700px;
    margin: 0 auto 2rem;
}

.home-intro p {
    color: var(--text-light);
    font-size: 1.1rem;
    margin-top: 0.5rem;
}

.category-section {
    margin-bottom: 2rem;
}

.category-title {
    font-size: 1.3rem;
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid var(--primary-light);
    color: var(--text);
}

.tools-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 1rem;
}

.tool-link {
    display: block;
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.25rem;
    text-decoration: none;
    color: var(--text);
    transition: box-shadow 0.2s, border-color 0.2s;
    box-shadow: var(--shadow);
}

.tool-link:hover {
    border-color: var(--primary);
    box-shadow: var(--shadow-md);
    text-decoration: none;
}

.tool-link h3 {
    font-size: 1rem;
    margin-bottom: 0.35rem;
    color: var(--primary);
}

.tool-link p {
    font-size: 0.85rem;
    color: var(--text-light);
    line-height: 1.5;
}

.visit-badge {
    display: inline-block;
    margin-top: 0.5rem;
    padding: 0.15rem 0.5rem;
    font-size: 0.75rem;
    background: var(--primary-light);
    color: var(--primary);
    border-radius: 12px;
    font-weight: 600;
}

/* === FOOTER === */
.site-footer {
    background: var(--white);
    border-top: 1px solid var(--border);
    margin-top: 3rem;
    padding: 2rem 0;
}

.footer-inner {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 1rem;
}

.footer-links {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 2rem;
    margin-bottom: 2rem;
}

.footer-col h4 {
    font-size: 0.95rem;
    margin-bottom: 0.75rem;
    color: var(--text);
}

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

.footer-col li {
    margin-bottom: 0.35rem;
}

.footer-col a {
    font-size: 0.85rem;
    color: var(--text-light);
    text-decoration: none;
}

.footer-col a:hover {
    color: var(--primary);
}

.footer-bottom {
    text-align: center;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border);
    color: var(--text-light);
    font-size: 0.85rem;
}

.footer-bottom a {
    color: var(--primary);
}

/* === RESULT ACTIONS (Copier / Partager) === */
.result-actions {
    display: inline-flex;
    gap: 0.5rem;
    margin-top: 0.5rem;
}

.btn-copy,
.btn-share {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    padding: 0.3rem 0.65rem;
    font-size: 0.8rem;
    font-weight: 500;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--white);
    color: var(--text-light);
    cursor: pointer;
    transition: background 0.2s, color 0.2s, border-color 0.2s;
    font-family: inherit;
    line-height: 1.4;
}

.btn-copy:hover,
.btn-share:hover {
    background: var(--primary-light);
    color: var(--primary);
    border-color: var(--primary);
}

.btn-copy.copied {
    background: #dcfce7;
    color: #16a34a;
    border-color: #16a34a;
}

/* Share button injected after h1 */
.share-page-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.35rem 0.75rem;
    font-size: 0.82rem;
    font-weight: 500;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--white);
    color: var(--text-light);
    cursor: pointer;
    transition: background 0.2s, color 0.2s, border-color 0.2s;
    font-family: inherit;
    margin-bottom: 1rem;
}

.share-page-btn:hover {
    background: var(--primary-light);
    color: var(--primary);
    border-color: var(--primary);
}

/* Toast notification */
.toast-notification {
    position: fixed;
    bottom: 2rem;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    background: #1e293b;
    color: #fff;
    padding: 0.65rem 1.25rem;
    border-radius: var(--radius);
    font-size: 0.9rem;
    font-weight: 500;
    z-index: 10000;
    opacity: 0;
    transition: transform 0.3s ease, opacity 0.3s ease;
    pointer-events: none;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.toast-notification.show {
    transform: translateX(-50%) translateY(0);
    opacity: 1;
}

/* === SIMILAR TOOLS === */
.similar-tools {
    margin-top: 2.5rem;
    padding-top: 2rem;
    border-top: 1px solid var(--border);
}

.similar-tools h2 {
    font-size: 1.25rem;
    margin-bottom: 1rem;
    color: var(--text);
}

.similar-tools-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1rem;
}

.similar-tool-card {
    display: block;
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1rem;
    text-decoration: none;
    color: var(--text);
    transition: box-shadow 0.2s, border-color 0.2s;
    box-shadow: var(--shadow);
}

.similar-tool-card:hover {
    border-color: var(--primary);
    box-shadow: var(--shadow-md);
    text-decoration: none;
}

.similar-tool-card h3 {
    font-size: 0.95rem;
    margin-bottom: 0.3rem;
    color: var(--primary);
}

.similar-tool-card p {
    font-size: 0.8rem;
    color: var(--text-light);
    line-height: 1.4;
    margin: 0;
}

/* === 404 PAGE === */
.error-404 {
    text-align: center;
}

.error-404-header {
    padding: 2rem 1rem 2.5rem;
}

.error-404-code {
    font-size: 5rem;
    color: var(--primary);
    margin-bottom: 0.25rem;
    line-height: 1;
}

.error-404-title {
    font-size: 1.3rem;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 0.5rem;
}

.error-404-subtitle {
    font-size: 1rem;
    color: var(--text-light);
    margin-bottom: 1.5rem;
    max-width: 500px;
    margin-left: auto;
    margin-right: auto;
}

.error-404-tools {
    text-align: left;
    margin-top: 2rem;
}

.error-404-tools h3 {
    font-size: 1.15rem;
    margin-bottom: 1rem;
    text-align: center;
    color: var(--text);
}

/* === RESPONSIVE === */
@media (max-width: 900px) {
    .tool-container {
        grid-template-columns: 1fr;
    }

    .tool-sidebar {
        position: static;
    }

    .footer-links {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 700px) {
    .navbar-toggle {
        display: flex;
    }

    .navbar-menu {
        display: none;
        position: absolute;
        top: 60px;
        left: 0;
        right: 0;
        background: var(--white);
        flex-direction: column;
        border-bottom: 1px solid var(--border);
        box-shadow: var(--shadow-md);
        padding: 0.5rem 0;
    }

    .navbar-menu.open {
        display: flex;
    }

    .navbar-search {
        max-width: none;
    }

    .navbar-dropdown {
        position: static;
        box-shadow: none;
        border: none;
        padding-left: 1rem;
    }

    .navbar-item.open .navbar-dropdown {
        display: block;
    }

    .tool-main h1 {
        font-size: 1.4rem;
    }

    .form-row {
        grid-template-columns: 1fr;
    }

    .result-box .result-value {
        font-size: 1.4rem;
    }

    .footer-links {
        grid-template-columns: 1fr 1fr;
        gap: 1.5rem;
    }

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

    .similar-tools-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* === BREADCRUMB === */
.breadcrumb {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.25rem;
    font-size: 0.85rem;
    color: var(--text-light);
    margin-bottom: 0.5rem;
}

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

.breadcrumb a:hover {
    text-decoration: underline;
}

.breadcrumb-sep {
    color: var(--text-light);
    margin: 0 0.15rem;
}

.breadcrumb [aria-current="page"] {
    color: var(--text);
    font-weight: 500;
}

/* === BLOG === */
.blog-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 1.5rem;
    margin: 1.5rem 0;
}

.blog-card {
    display: block;
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.5rem;
    text-decoration: none;
    color: var(--text);
    transition: box-shadow 0.2s, transform 0.2s;
}

.blog-card:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}

.blog-card time {
    font-size: 0.8rem;
    color: var(--text-light);
}

.blog-card h2 {
    font-size: 1.15rem;
    margin: 0.5rem 0;
    color: var(--text);
}

.blog-card p {
    font-size: 0.9rem;
    color: var(--text-light);
    margin: 0.5rem 0;
}

.blog-card-link {
    font-size: 0.9rem;
    color: var(--primary);
    font-weight: 600;
}

/* Article de blog */
.blog-article {
    max-width: 800px;
}

.blog-meta {
    display: flex;
    align-items: center;
    gap: 1rem;
    font-size: 0.85rem;
    color: var(--text-light);
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border);
}

.blog-author {
    font-weight: 500;
}

.blog-cta {
    background: var(--primary-light);
    border: 2px solid var(--primary);
    border-radius: var(--radius);
    padding: 2rem;
    text-align: center;
    margin: 2rem 0;
}

.blog-cta h2 {
    color: var(--primary-dark);
    margin-bottom: 0.5rem;
}

.blog-cta p {
    color: var(--text);
    margin-bottom: 1rem;
}

.cta-button {
    display: inline-block;
    background: var(--primary);
    color: var(--white) !important;
    padding: 0.75rem 2rem;
    border-radius: var(--radius);
    text-decoration: none;
    font-weight: 600;
    font-size: 1.1rem;
    transition: background 0.2s;
}

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

@media (max-width: 640px) {
    .blog-grid {
        grid-template-columns: 1fr;
    }
}
