:root {
    --bleu-ciel: #87CEEB;
    --bleu-roi: #1E40AF;
    --bleu-medium: #3498DB;
    --bleu-fonce: #2980B9;
    --blanc: #FFFFFF;
    --text-dark: #2C3E50;
}

/* Style pour la barre de recherche */
.search-section {
    width: 100%;
    margin: 0;
    padding: 0;
}

    .detail-image {
    max-width: 150%;
    
}

    .search-input {
        width: 100%;
        padding: 1rem;
        border: 2px solid var(--bleu-medium);
        border-radius: 50px;
        font-size: 1.1rem;
        text-align: center;
        transition: all 0.3s ease;
        box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
    }

    .search-input:focus {
        outline: none;
        border-color: var(--bleu-roi);
        box-shadow: 0 4px 20px rgba(30, 64, 175, 0.2);
    }

    .no-results {
        text-align: center;
        color: #777;
        font-style: italic;
        margin-top: 2rem;
        font-size: 1.2rem;
    }

body {
    margin: 0;
    padding: 0;
    background: linear-gradient(135deg, var(--bleu-ciel), #B3E5FC);
    font-family: 'Segoe UI', sans-serif;
    color: var(--text-dark);
    line-height: 1.6;
    min-height: 100vh;
}

.header {
    background: linear-gradient(180deg, #0b2f6f 0%, #3f8fdf 100%);
    color: white;
    padding: 2rem;
    height: 220px;
    box-sizing: border-box;
    text-align: center;
    position: relative;
    border-radius: 0 0 30px 30px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.2);
}

.header-nav {
    display: flex;
    justify-content: flex-start;
    align-items: center;
    gap: 1rem;
    max-width: 1200px;
    margin: 0 auto;
}

.header-left-links {
    display: inline-flex;
    flex-direction: column;
    align-items: stretch;
    gap: 0.55rem;
    width: max-content;
    margin-left: calc(150px - (50vw - 50%));
}

.header-left-top,
.header-left-bottom {
    display: flex;
    align-items: center;
    gap: 0.8rem;
}

.header-left-bottom {
    width: 100%;
}

.header-left-bottom .home-btn {
    flex: 1 1 0;
}

.header-main {
    max-width: 1200px;
    margin: 0 auto;
}

.header-title-stack {
    position: absolute;
    top: 50%;
    right: 200px;
    transform: translateY(-50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.35rem;
    text-align: center;
}

.nav-links {
    display: flex;
    gap: 0.8rem;
}

.header-title-stack .nav-links {
    justify-content: center;
    margin-bottom: 0.35rem;
}

.home-btn, .nav-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: white;
    text-decoration: none;
    height: 38px;
    min-height: 38px;
    padding: 0 1.2rem;
    border-radius: 30px;
    transition: all 0.3s ease;
    background: rgba(255, 255, 255, 0.2);
    font-size: 1rem;
    line-height: 1.1;
    font-weight: 500;
    box-sizing: border-box;
}

.home-btn:hover, .nav-link:hover {
    background: var(--bleu-roi);
    border-color: var(--bleu-roi);
    color: #ffffff;
    transform: translateY(-1px);
}

.header-title-stack .nav-link {
    font-weight: 600;
}

.header-left-links .home-btn {
    font-weight: 500;
}

.header-nav .header-left-links > .a11y-toggle-btn {
    width: 100%;
    box-sizing: border-box;
    margin: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: white;
    background: rgba(255, 255, 255, 0.2);
    border: 2px solid transparent;
    border-radius: 30px;
    height: 38px;
    min-height: 38px;
    padding: 0 1.2rem;
    font-size: 1rem;
    line-height: 1.1;
    font-weight: 700;
    transition: all 0.3s ease;
}

.header-nav .header-left-links > .a11y-toggle-btn:hover,
.header-nav .header-left-links > .a11y-toggle-btn:focus-visible {
    background: var(--bleu-roi);
    border-color: var(--bleu-roi);
    color: #ffffff;
    transform: translateY(-1px);
    outline: none;
}

.header h1 {
    margin: 0 0 0.35rem;
    text-align: center;
    font-size: clamp(1.9rem, 4vw, 2.7rem);
    line-height: 1.15;
    text-shadow: none;
}

.header .subtitle {
    margin: 0;
    text-align: center;
    font-size: 1rem;
    opacity: 0.95;
}

.container {
    max-width: 1400px;
    margin: 2rem auto;
    padding: 0 2rem;
    display: grid;
    grid-template-columns: 400px 1fr;
    gap: 3rem;
    align-items: start;
}

.add-tool-section {
    background: rgba(255, 255, 255, 0.95);
    padding: 2.5rem;
    border-radius: 20px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    border-left: 5px solid var(--bleu-roi);
}

.tools-feed-column {
    display: grid;
    gap: 1rem;
}

.add-tool-section h2 {
    color: var(--bleu-roi);
    margin-bottom: 1.5rem;
    text-align: center;
}

.tool-form {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

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

.form-group input,
.form-group textarea {
    padding: 1rem;
    border: 2px solid var(--bleu-medium);
    border-radius: 8px;
    font-size: 1rem;
    transition: border-color 0.3s ease;
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--bleu-roi);
}

.form-group textarea {
    min-height: 100px;
    resize: vertical;
}

.file-label {
    font-weight: bold;
    color: var(--text-dark);
    margin-bottom: 0.5rem;
}

input[type="file"] {
    border: 2px dashed var(--bleu-medium);
    padding: 1rem;
    background: #f8f9fa;
    cursor: pointer;
}

input[type="file"]:hover {
    background: #e3f2fd;
}

.image-preview-container {
    display: none;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 1rem;
}

.image-preview-thumb {
    width: 100px;
    height: 100px;
    object-fit: cover;
    border-radius: 8px;
    border: 2px solid var(--bleu-medium);
}

.submit-btn {
    background: linear-gradient(135deg, var(--bleu-roi), #2C5282);
    color: white;
    padding: 1rem 2rem;
    border: none;
    border-radius: 8px;
    font-size: 1.1rem;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: bold;
}

.submit-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}

.tools-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 2rem;
    padding: 2rem;
    background: rgba(255, 255, 255, 0.95);
    border-radius: 20px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
}

.tool-card {
    background: var(--blanc);
    padding: 1.5rem;
    border-radius: 15px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease;
    position: relative;
    border: 1px solid #e0e0e0;
}

.tool-card:hover {
    transform: translateY(-5px);
}

.tool-link {
    text-decoration: none;
    color: inherit;
    display: block;
}

.tool-image {
    width: 100%;
    height: 200px;
    object-fit: cover;
    border-radius: 10px;
    margin-bottom: 1rem;
}

.tool-card h3 {
    font-size: 1.4rem;
    color: var(--bleu-fonce);
    margin-bottom: 0.5rem;
}

.tool-card p {
    font-size: 1rem;
    color: #666;
    margin-bottom: 1rem;
}

.age {
    background-color: var(--bleu-ciel);
    color: var(--bleu-fonce);
    padding: 0.3rem 0.8rem;
    border-radius: 20px;
    font-size: 0.9rem;
    font-weight: bold;
}

.tool-actions {
    margin-top: 0.7rem;
    display: flex;
    gap: 0.45rem;
    flex-wrap: wrap;
}

.tool-action-btn {
    border: 1px solid #9ec2eb;
    border-radius: 8px;
    background: #eff7ff;
    color: #0b3f7a;
    padding: 0.36rem 0.62rem;
    font-size: 0.82rem;
    font-weight: 700;
    cursor: pointer;
}

.tool-action-btn:hover {
    background: #dfeeff;
}

.tool-favorite-btn.is-active {
    border-color: #caa95f;
    background: #fff7df;
    color: #7c5b14;
}

.detail-tool-actions {
    display: flex;
    gap: 0.55rem;
    flex-wrap: wrap;
    margin-bottom: 1rem;
}

.delete-btn {
    position: absolute;
    top: 10px;
    right: 10px;
    background: transparent;
    border: none;
    color: var(--bleu-roi);
    font-size: 1.2rem;
    cursor: pointer;
    opacity: 0.7;
    transition: opacity 0.3s ease;
}

.delete-btn:hover {
    opacity: 1;
    color: #c0392b;
}

.footer {
    background: linear-gradient(135deg, #0b2f6f, #1f5ea8);
    color: white;
    text-align: center;
    padding: 0.7rem 1rem;
    margin-top: 1.2rem;
    border-top: 1px solid rgba(255, 255, 255, 0.35);
}

.footer p {
    margin: 0;
    font-size: 0.9rem;
    font-weight: 600;
}

@media (max-width: 768px) {
    *,
    *::before,
    *::after {
        box-sizing: border-box;
    }

    body {
        overflow-x: hidden;
    }

    .header {
        height: auto;
        min-height: 220px;
    }

    .header-nav {
        flex-direction: column;
        gap: 0.6rem;
    }

    .header-left-links {
        margin-left: 0;
        width: 100%;
        align-items: center;
        justify-content: center;
    }

    .header-left-top,
    .header-left-bottom {
        justify-content: center;
        flex-wrap: wrap;
    }

    .header-nav .header-left-links > .a11y-toggle-btn {
        width: auto;
    }

    .header-title-stack {
        position: static;
        transform: none;
        gap: 0.3rem;
    }

    .header-title-stack .nav-links {
        justify-content: center;
        flex-wrap: wrap;
        margin-bottom: 0.15rem;
    }

    .container {
        width: 100%;
        max-width: 100%;
        margin: 1rem auto;
        padding: 0 0.75rem;
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    .search-section {
        width: 100%;
        max-width: 100%;
        margin: 0;
        padding: 0;
    }

    .add-tool-section,
    .tools-grid {
        width: 100%;
        max-width: 100%;
        padding: 1rem;
    }

    .add-tool-section,
    .tools-grid,
    .tool-card {
        overflow: hidden;
    }

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

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

    .detail-image {
        max-width: 100%;
    }

    .tool-image,
    .image-preview-thumb {
        display: block;
        max-width: 100%;
        height: auto;
    }
}
