@import url('https://fonts.googleapis.com/css2?family=Carlito&family=Montserrat:wght@300;600&family=Poppins:wght@700&family=Roboto:wght@300;400;500;600&display=swap');

:root {
    --primary-color: #2c3e50;
    --secondary-color: #3498db;
    --accent-color: #e74c3c;
    --background-color: #f8f9fa;
    --text-color: #2c3e50;
    --border-color: #e0e0e0;
}

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

body {
    font-family: 'Arial', sans-serif;
    background-color: var(--background-color);
    color: var(--text-color);
    line-height: 1.6;
}

body.space-page {
    margin: 0;
    min-height: 100vh;
    font-family: 'Montserrat', 'Arial', sans-serif;
    color: #f2f4f8;
    background: radial-gradient(circle at top, #172c4d 0%, #0f1b2a 45%, #060d17 100%);
    overflow: hidden;
}

.space-scene {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    border: none;
    outline: none;
    overflow: hidden;
}

.space-overlay {
    position: fixed;
    top: 2.5rem;
    left: 2.5rem;
    width: min(360px, 85vw);
    max-height: calc(100vh - 5rem);
    padding: 1.5rem;
    background: rgba(10, 18, 32, 0.82);
    border: 1px solid rgba(79, 124, 173, 0.5);
    border-radius: 18px;
    backdrop-filter: blur(18px);
    box-shadow: 0 24px 64px rgba(3, 6, 12, 0.65);
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 1.4rem;
    z-index: 10;
}

.space-overlay__header {
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
}

.space-overlay__title h1 {
    font-size: clamp(1.4rem, 4vw, 1.95rem);
    margin-bottom: 0.15rem;
    color: #ffffff;
}

.space-overlay__title p {
    margin: 0;
    color: rgba(235, 244, 255, 0.78);
    line-height: 1.45;
}

.space-back {
    display: inline-flex;
    align-items: center;
    gap: 0.55rem;
    color: #9fb6d4;
    text-decoration: none;
    font-weight: 600;
    transition: color 0.2s ease;
}

.space-back:hover {
    color: #ffffff;
}

.space-toggle-list {
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
}

.space-slider {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    background: rgba(14, 26, 44, 0.6);
    padding: 0.6rem 0.75rem;
    border-radius: 0.65rem;
    border: 1px solid rgba(73, 121, 167, 0.25);
    transition: border-color 0.2s ease, transform 0.2s ease;
}

.space-slider span {
    font-size: 0.9rem;
    color: rgba(233, 242, 255, 0.85);
    font-weight: 500;
}

.space-slider input[type="range"] {
    width: 100%;
    accent-color: #4bc0c0;
    background: transparent;
}

.space-overlay__group {
    display: flex;
    flex-direction: column;
    gap: 0.65rem;
}

.space-overlay__group h2 {
    font-size: 1.05rem;
    margin-bottom: 0.25rem;
    color: #ffffff;
}

.space-toggle {
    display: flex;
    gap: 0.7rem;
    align-items: center;
    background: rgba(16, 28, 46, 0.7);
    border: 1px solid rgba(79, 124, 173, 0.3);
    border-radius: 12px;
    padding: 0.6rem 0.9rem;
    font-size: 0.92rem;
    cursor: pointer;
    transition: border-color 0.2s ease, transform 0.2s ease;
}

.space-toggle:hover {
    border-color: rgba(79, 124, 173, 0.6);
    transform: translateY(-1px);
}

.space-toggle input {
    width: 1.1rem;
    height: 1.1rem;
    accent-color: #4bc0c0;
}

.space-visible {
    font-size: 0.9rem;
    color: rgba(235, 244, 255, 0.78);
}

.space-button {
    margin-top: 0.5rem;
    padding: 0.65rem 1rem;
    border-radius: 10px;
    border: none;
    background: linear-gradient(135deg, #3498db, #5dd5ff);
    color: #04111f;
    font-weight: 600;
    cursor: pointer;
    transition: filter 0.2s ease;
}

.space-button:hover {
    filter: brightness(1.08);
}

.space-metrics {
    display: grid;
    gap: 0.7rem;
}

.space-legend-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.92rem;
    padding: 0.55rem 0.75rem;
    background: rgba(18, 34, 54, 0.86);
    border-radius: 10px;
    border: 1px solid rgba(79, 124, 173, 0.38);
}

.space-legend-item strong {
    color: #4bc0c0;
}

.space-tooltip {
    position: fixed;
    pointer-events: none;
    background: rgba(8, 16, 28, 0.9);
    border: 1px solid rgba(75, 192, 192, 0.45);
    padding: 0.75rem 1rem;
    border-radius: 10px;
    color: #f4f7fb;
    font-size: 0.9rem;
    line-height: 1.4;
    transform: translate(-9999px, -9999px);
    transition: opacity 0.12s ease;
    opacity: 0;
    z-index: 9;
    min-width: 180px;
    backdrop-filter: blur(6px);
}

.space-empty {
    position: fixed;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    color: rgba(255, 255, 255, 0.75);
    background: rgba(6, 13, 23, 0.4);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
    z-index: 6;
}

.space-empty.is-visible {
    opacity: 1;
    pointer-events: all;
}

.space-label-renderer {
    position: fixed;
    top: 0;
    left: 0;
    pointer-events: none;
    z-index: 4;
}

.space-axis-label {
    color: #a7c4e8;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    font-size: 0.75rem;
    text-shadow: 0 0 8px rgba(12, 20, 33, 0.95);
}

.space-footer {
    position: fixed;
    bottom: 1.5rem;
    right: 2rem;
    background: rgba(7, 14, 25, 0.7);
    padding: 0.75rem 1.1rem;
    border-radius: 12px;
    border: 1px solid rgba(79, 124, 173, 0.35);
    font-size: 0.88rem;
    color: rgba(235, 244, 255, 0.75);
    backdrop-filter: blur(10px);
    z-index: 10;
}

.space-footer p {
    margin: 0;
}

.space-metrics.is-hidden,
.space-tooltip.is-hidden {
    display: none;
}

@media (max-width: 720px) {
    .space-overlay {
        left: 50%;
        transform: translateX(-50%);
        top: 1.5rem;
        width: min(420px, 94vw);
        max-height: calc(100vh - 3rem);
    }

    .space-footer {
        left: 50%;
        right: auto;
        transform: translateX(-50%);
        bottom: 1rem;
    }
}

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

.search-header {
    text-align: center;
    margin-bottom: 3rem;
}

.search-header h1 {
    font-size: 2.5rem;
    color: var(--primary-color);
    margin-bottom: 0.5rem;
}

.subtitle {
    color: var(--secondary-color);
    font-size: 1.1rem;
    opacity: 0.8;
}

.search-form {
    background: white;
    padding: 2rem;
    border-radius: 12px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.search-bar {
    display: flex;
    gap: 1rem;
    margin-bottom: 2rem;
    align-items: center;
}

.search-input {
    position: relative;
    flex: 1;
}

.search-input i {
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: #666;
}

.search-input input {
    width: 100%;
    padding: 0.8rem 1rem 0.8rem 2.5rem;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    font-size: 1rem;
    transition: border-color 0.3s ease;
}

.search-input input:focus {
    outline: none;
    border-color: var(--secondary-color);
}

.search-button {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.8rem 1.5rem;
    background-color: var(--secondary-color);
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 1rem;
    transition: background-color 0.3s ease;
}

.search-button:hover {
    background-color: #2980b9;
}

.search-button i {
    font-size: 1.2rem;
}

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

.filter-section {
    background: #f8f9fa;
    border-radius: 8px;
    padding: 1.5rem;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.filter-section h3 {
    color: var(--primary-color);
    margin-bottom: 1rem;
    font-size: 1.1rem;
}

.filter-group {
    margin-bottom: 1rem;
}

.filter-group .filter-loading {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    font-size: 0.85rem;
    color: #59636f;
    margin-left: 0.5rem;
}

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

.period-filters {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.period-filters input {
    width: 100px;
    padding: 0.5rem;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    text-align: inherit;
}

.select-filter {
    width: 100%;
    padding: 0.8rem;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    font-size: 0.9rem;
    background-color: white;
    cursor: pointer;
}

.checkbox-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
}

.checkbox-label input {
    width: 1.2rem;
    height: 1.2rem;
}

.action-buttons {
    display: flex;
    gap: 1rem;
    justify-content: flex-end;
    margin-top: 2rem;
}

.reset-button {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.8rem 1.5rem;
    background-color: var(--accent-color);
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 1rem;
    transition: background-color 0.3s ease;
}

#results{
    margin: 30px 0px;
}

.reset-button:hover {
    background-color: #c0392b;
}

/* Responsive design */
@media (max-width: 768px) {
    .search-bar {
        flex-direction: column;
        align-items: stretch;
    }

    .search-input input {
        width: 100%;
    }

    .advanced-filters {
        grid-template-columns: 1fr;
    }

    .search-button {
        width: 100%;
        justify-content: center;
    }

    .action-buttons {
        flex-direction: column;
    }
}

.container_search {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 100%;
}

.container_search form {
    width: 100%;
    display: block;
}

.container_search form input {
    width: 40%;
    padding: 12px 16px;
    border-radius: 20px;
    border: solid 1px;
    margin: 0px auto;
    display: flex;
}

.container_search form input:focus {
    outline: none;
}

.container_search button {
    border: solid 1px #000;
    border-radius: 7px;
    background-color: #ea5f5f;
    color: #fff;
    padding: 10px;
    display: flex;
    width: 140px;
    justify-content: center;
    margin: auto;
}

.container_search h1 {
    text-align: center;
}

.select-filter {
    width: 250px;
}

.container-select {
    margin: 11px 7px;
}

.container-type-img {
    display: flex;
}

.container-type-img span {
    background-color: #fff;
    border: 1px solid #3c4043;
    border-radius: 50%;
    display: inline-flex;
    justify-content: center;
    align-items: center;
    height: 26px;
    width: 26px;
    flex-shrink: 0;
    margin: auto 12px auto 0px;
}

.container-filter {
    width: 70%;
    margin: auto;
    padding: 30px;
    flex-wrap: wrap;
    justify-content: center;
    display: flex;
}

.container-img-search {
    display: inline-block;
}

.img_search {
    height: 18px;
    width: 18px;
    display: block;
}

.type-search {
    margin: 9px 0px;
    color: #202124;
}

.description-search {
    color: #4d5156;
    margin: 0;
}

.img-profil {
    width: 10%;
    border-radius: 100%;
    border: solid;
    margin: auto;
    display: flex;
}

.results-container {
    padding: 20px 147px;
}

.form-search {
    display: flex;
    width: 100%;
    margin: auto 35px;
}

.form-search input {
    width: 30%;
    padding: 7px;
    border-radius: 20px;
    border: solid 1px;
    margin: 0px 10px 0px 0px;
}

.form-search input:focus {
    outline: none;
}


/*-- RÉSULTATS --*/

.img-icon-type {
    height: 68px;
    width: 68px;
    display: flex;
    margin: auto;
}

.badge-type {
    display: inline-flex;
    align-items: center;
    gap: 0.4em;
    padding: 0.2em 0.7em;
    border-radius: 1em;
    font-size: 0.95em;
    font-weight: 600;
    margin-bottom: 0.5em;
    background: #eaf1fb;
    color: #2c3e50;
}
.badge-film { background: #d6eaff; color: #1a4a7a; }
.badge-acteur, .badge-personnage { background: #ffe6f0; color: #a12c6e; }
.badge-réalisateur { background: #e6ffe6; color: #2c7a3f; }
.badge-arme { background: #fff3e6; color: #a15c2c; }
.badge-violence { background: #ffe6e6; color: #a12c2c; }

.result-year {
    display: block;
    font-size: 0.95em;
    color: #888;
    margin-bottom: 0.3em;
}

.suggestions {
    position: absolute;
    z-index: 1000;
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    width: 100%;
    max-height: 320px;
    overflow-y: auto;
    margin-top: 0.2em;
}
.suggestion-item {
    display: flex;
    align-items: center;
    gap: 0.7em;
    padding: 0.7em 1em;
    cursor: pointer;
    transition: background 0.2s;
}
.suggestion-item.active, .suggestion-item:hover {
    background: #f0f6ff;
}
.suggestion-label {
    font-weight: 500;
    flex: 1;
}
.suggestion-type {
    font-size: 0.9em;
    color: #888;
    margin-left: 0.5em;
}
.suggestion-year {
    font-size: 0.9em;
    color: #aaa;
    margin-left: 0.5em;
}
#instant-results {
    margin-top: 2em;
    padding: 30px;
}

.loading-spinner {
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2em;
    color: #3498db;
    min-height: 80px;
    font-weight: 600;
    letter-spacing: 0.05em;
}

/* Highlighted links for interlinked navigation */
.link-highlight {
    color: #1a4a7a;
    font-weight: 600;
    text-decoration: underline;
}