/* ========================================
   PAGES SECONDAIRES
   categories, models, ressources-2d, model-packs,
   mentions-legales, generation-history, 404
   ======================================== */

/* -------------- HERO (shared for secondary pages) -------------- */
#hero {
    position: relative;
    width: 100%;
    height: 50vh;
    overflow: hidden;
    min-height: 300px;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
}

#hero .overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.4);
    z-index: 1;
}

.hero-content {
    position: relative;
    z-index: 2;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    color: #fff;
    padding: 0 1rem;
}

.hero-content h1 {
    font-size: 3rem;
    margin-bottom: 1rem;
}

.hero-content p {
    font-size: 1.2rem;
    max-width: 600px;
    line-height: 1.4;
}

#bg-video {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    z-index: 0;
}

/* -------------- HERO SEARCH BAR -------------- */
.hero-search {
    margin-top: 20px;
    width: 100%;
    max-width: 550px;
}

.hero-search-form {
    display: flex;
    gap: 0;
    background: #fff;
    border-radius: 50px;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
}

.hero-search-form input {
    flex: 1;
    padding: 14px 22px;
    border: none;
    outline: none;
    font-size: 0.95rem;
    font-family: inherit;
    color: #333;
    min-width: 0;
}

.hero-search-form input::placeholder {
    color: #999;
}

.hero-search-form button {
    padding: 14px 28px;
    background: #1a1a2e;
    color: #fff;
    border: none;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 600;
    font-family: inherit;
    transition: background 0.2s;
    white-space: nowrap;
}

.hero-search-form button:hover {
    background: #a049cc;
}

@media (max-width: 768px) {
    .hero-search-form input {
        padding: 12px 16px;
        font-size: 0.85rem;
    }

    .hero-search-form button {
        padding: 12px 18px;
        font-size: 0.82rem;
    }
}

/* -------------- LANDING PAGE SEO SECTIONS (blender, unity, impression-3d) -------------- */
.section-presentation {
    background-color: #fafbfc;
    padding: 50px 20px;
    text-align: center;
}

.section-presentation + .section-presentation {
    background-color: #fff;
}

.section-text {
    font-size: 1.02rem;
    color: #555;
    line-height: 1.8;
    margin-bottom: 18px;
}

.section-text strong {
    color: #1a1a2e;
    font-weight: 600;
}

.section-presentation .container {
    max-width: 860px;
    margin: 0 auto;
    text-align: center;
}

.section-presentation .container .section-title {
    display: inline-block;
    position: relative;
    padding-bottom: 10px;
}

.section-presentation .container .section-title::after {
    left: 50%;
    transform: translateX(-50%);
}

.section-presentation .container .section-text {
    text-align: left;
    max-width: 760px;
    margin: 0 auto 18px;
}

.section-presentation .container .section-text a {
    color: #a049cc;
    text-decoration: none;
    font-weight: 600;
}

.section-presentation .container .section-text a:hover {
    text-decoration: underline;
}

/* -------------- MODELS GRID (shared) -------------- */
.models-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
    justify-content: center;
    max-width: 80%;
    margin: 0 auto;
    padding: 3rem 0;
    padding-bottom: 0;
}

/* -------------- CATEGORIES -------------- */
.categories-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
    justify-content: center;
    max-width: 80%;
    margin: 2rem auto;
    height: 50vh;
}

.category-card {
    background-color: #fff;
    border-radius: 8px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    overflow: hidden;
    text-align: center;
    transition: transform 0.3s ease-in-out;
    display: flex;
    flex-direction: column;
    height: fit-content;
    width: fit-content;
    text-decoration: none;
}

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

.category-card img {
    width: 350px;
    height: 200px;
    object-fit: cover;
}

.category-card .card-content {
    padding: 1rem;
}

.category-card h3 {
    font-size: 1.2rem;
    font-weight: 700;
    color: black;
}

/* -------------- MENTIONS LEGALES -------------- */
.main-container {
    min-height: 100vh;
    padding: 20px;
    margin-top: 20px;
    display: flex;
    gap: 10px;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
}

/* -------------- GENERATION HISTORY -------------- */
.history-page {
    max-width: 1200px;
    margin: 0 auto;
    padding: 30px 20px 60px;
}

.history-header {
    text-align: center;
    margin-bottom: 30px;
}

.history-header h1 {
    font-size: 1.6rem;
    font-weight: 700;
    color: #1a1a2e;
    margin: 0 0 6px;
}

.history-header p {
    font-size: 0.88rem;
    color: #999;
    margin: 0;
}

#history-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 18px;
}

#history-container > p {
    grid-column: 1 / -1;
    text-align: center;
    color: #999;
    padding: 40px 0;
}

.history-item {
    background: #fff;
    border: 1px solid #e8ecf1;
    border-radius: 14px;
    padding: 0;
    overflow: hidden;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.05);
    transition: transform 0.2s, box-shadow 0.2s;
    display: flex;
    flex-direction: column;
}

.history-item:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.1);
}

.history-item img {
    width: 100%;
    height: 200px;
    object-fit: cover;
    display: block;
    background: #f0f0f0;
}

.history-item-body {
    padding: 14px 16px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    flex: 1;
}

.history-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 4px;
}

.history-tag {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 600;
}

.history-tag i {
    font-size: 0.82rem;
}

.history-tag-date {
    background: #f0f0f0;
    color: #555;
}

.history-tag-state {
    background: #e3f2fd;
    color: #1565c0;
}

.history-tag-publish {
    background: #e8f5e9;
    color: #2e7d32;
}

.history-tag-waiting {
    background: #fff3e0;
    color: #e65100;
}

.history-tag-refused {
    background: #ffebee;
    color: #c62828;
}

.history-no-image {
    width: 100%;
    height: 200px;
    background: #f5f3fa;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #bbb;
    font-size: 0.85rem;
}

.download-group {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    padding-top: 6px;
    border-top: 1px solid #f0f0f0;
    margin-top: auto;
}

.download-btn {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 7px 12px;
    background: #a049cc;
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: 0.78rem;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    transition: all 0.2s;
}

.download-btn:hover {
    background: #8a3aad;
    transform: translateY(-1px);
    box-shadow: 0 3px 10px rgba(160, 73, 204, 0.3);
}

.download-btn i {
    font-size: 0.85rem;
}

@media (max-width: 768px) {
    #history-container {
        grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
        gap: 12px;
    }

    .history-header h1 {
        font-size: 1.3rem;
    }
}

@media (max-width: 480px) {
    #history-container {
        grid-template-columns: 1fr;
    }
}

/* -------------- 404 PAGE -------------- */
.error-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: calc(100vh - 150px);
    text-align: center;
    padding: 40px 20px;
}

.error-code {
    font-size: 8rem;
    font-weight: 700;
    color: #000;
    line-height: 1;
    margin-bottom: 10px;
}

.error-subtitle {
    font-size: 1.4rem;
    color: #555;
    margin-bottom: 30px;
    max-width: 500px;
}

.error-actions {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
    justify-content: center;
}

.error-actions a {
    padding: 12px 28px;
    border-radius: 6px;
    text-decoration: none;
    font-weight: 500;
    font-size: 0.95rem;
    transition: all 0.2s ease;
}

.error-actions .btn-primary {
    background: #000;
    color: #fff;
}

.error-actions .btn-primary:hover {
    background: #333;
}

.error-actions .btn-secondary {
    background: #f0f0f0;
    color: #333;
    border: 1px solid #ddd;
}

.error-actions .btn-secondary:hover {
    background: #e0e0e0;
}

.error-hint {
    margin-top: 40px;
    font-size: 0.85rem;
    color: #999;
}

/* -------------- FOOTER -------------- */
footer {
    background-color: #1a1a2e;
    color: #ccc;
    padding: 20px 15px;
    text-align: center;
    width: 100%;
    margin-top: 40px;
}

footer p {
    font-size: 0.82rem;
    margin: 4px 0;
    line-height: 1.5;
}

footer a {
    color: #fff;
    text-decoration: none;
    transition: opacity 0.2s;
}

footer a:hover {
    opacity: 0.8;
    text-decoration: underline;
}

/* -------------- RESPONSIVE -------------- */
@media (max-width: 768px) {
    .hero-content h1 {
        font-size: 1.5rem;
    }

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

    #hero {
        height: 30vh;
    }

    .categories-container {
        max-width: 95%;
        gap: 1rem;
        grid-template-columns: repeat(auto-fit, minmax(45%, 1fr));
    }

    .category-card img {
        height: 130px;
    }

    .category-card h3 {
        font-size: 1rem;
    }

    .models-container {
        max-width: 95%;
        width: 100%;
        gap: 10px;
        grid-template-columns: repeat(auto-fit, minmax(45%, 1fr));
    }

    .section-presentation .container .section-text {
        font-size: 0.9rem;
        text-align: left;
        padding: 0 4px;
    }

    .error-code {
        font-size: 5rem;
    }

    .error-subtitle {
        font-size: 1.1rem;
    }
}
