@import url('https://fonts.googleapis.com/css2?family=Exo+2:wght@400;700;900&display=swap');

:root {
    --primary-color: #00f2ff;
    --secondary-color: #ff00c1;
    --background-color: #0d0221;
    --line-color: rgba(0, 242, 255, 0.5);
    --card-width: 250px;
    --card-horizontal-margin: 30px;
    --connector-height: 60px;
}

* { box-sizing: border-box; }

body { font-family: 'Exo-2', sans-serif; background-color: var(--background-color); color: #fff; margin: 0; padding: 0; overflow-x: hidden; overflow-y: auto; min-height: 100vh; }

/* --- PLACEHOLDERS DE ANÚNCIOS (ADS) --- */
.ad-placeholder {
    position: fixed;
    background-color: rgba(0, 0, 0, 0.5);
    border: 1px dashed var(--primary-color);
    color: var(--primary-color);
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    font-size: 0.8em;
    text-transform: uppercase;
    letter-spacing: 1px;
    z-index: 90;
    pointer-events: none;
    backdrop-filter: blur(2px);
    transition: all 0.3s ease;
}

.ad-placeholder:hover {
    background-color: rgba(0, 242, 255, 0.1);
    box-shadow: 0 0 15px var(--primary-color);
}

/* --- POSICIONAMENTO PC (Telas Grandes) --- */

/* Anúncio Superior Esquerdo (Ao lado do Menu) - RETÂNGULO */
.ad-left {
    top: 20px;
    left: 20px;
    width: 300px;
    height: 100px;
}

/* Anúncio Superior Direito (Ao lado do Menu) - RETÂNGULO */
.ad-right {
    top: 20px;
    right: 20px;
    width: 300px;
    height: 100px;
}

/* Anúncio Inferior (Central) */
.ad-bottom {
    bottom: 10px;
    left: 50%;
    transform: translateX(-50%);
    width: 728px;
    height: 90px;
}

/* --- RESPONSIVIDADE (Mobile e Tablets) --- */
@media (max-width: 1200px) {
    /* Esconde os laterais/superiores em telas médias */
    .ad-side {
        display: none !important;
    }
}

@media (max-width: 768px) {
    .ad-bottom {
        width: 100%;
        max-width: 320px;
        height: 50px;
        bottom: 0;
        border: none;
        border-top: 2px solid var(--secondary-color);
        background-color: #0d0221;
        z-index: 100;
    }
}

/* --- Fundo animado --- */
.animated-background {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    background: transparent; 
}

#dynamic-bg-image {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-size: cover;
    background-position: center center;
    animation: slow-pan 60s linear infinite alternate; 
    transition: background-image 0.8s ease-in-out; 
    z-index: -2; 
}

.marvel-background { background-image: url('assets/marvel-bg.jpg'); }
.starwars-background { background-image: url('assets/starwars-bg.jpg'); }
.lotr-background { background-image: url('assets/lotr-bg.jpg'); }
.alien-background { background-image: url('assets/alien-bg.jpg'); }

@keyframes move-twink-back {
    from { transform: translate(0, 0); }
    to { transform: translate(-1000px, -1000px); }
}

.animated-background::before {
    content: ''; position: absolute; top: 0; left: 0; width: 200%; height: 200%;
    background-image: radial-gradient(1px 1px at 20px 30px, #eee, transparent), radial-gradient(1px 1px at 40px 70px, #fff, transparent), radial-gradient(1px 1px at 50px 160px, #ddd, transparent), radial-gradient(2px 2px at 90px 40px, #fff, transparent), radial-gradient(2px 2px at 130px 80px, #fff, transparent), radial-gradient(2px 2px at 160px 120px, #ddd, transparent);
    background-size: 250px 250px; animation: move-twink-back 150s linear infinite; z-index: -1;
}

.animated-background::after {
    content: ''; position: absolute; top: 0; left: 0; width: 200%; height: 200%;
    background-image: radial-gradient(2px 2px at 50px 50px, #fff, transparent), radial-gradient(2px 2px at 100px 100px, #ddd, transparent), radial-gradient(3px 3px at 40px 150px, #fff, transparent), radial-gradient(3px 3px at 140px 200px, #fff, transparent);
    background-size: 200px 200px; animation: move-twink-back 100s linear infinite; z-index: -1;
}

@keyframes slow-pan { from { background-position: 0% 50%; } to { background-position: 100% 50%; } }

.main-header { text-align: center; padding: 15px; background: linear-gradient(to bottom, rgba(13, 2, 33, 0.7) 0%, rgba(13, 2, 33, 0) 100%); backdrop-filter: blur(5px); z-index: 10; }
.main-header h1 { color: var(--primary-color); text-shadow: 0 0 10px var(--primary-color); text-transform: uppercase; margin: 0 0 10px; font-size: 1.8em; }
.controls-container { display: flex; flex-direction: column; align-items: center; gap: 15px; }
#search-input { background-color: rgba(10, 10, 25, 0.6); border: 1px solid var(--primary-color); border-radius: 50px; color: #fff; padding: 10px 20px; width: 90%; max-width: 400px; font-family: 'Exo 2', sans-serif; transition: box-shadow 0.3s ease; }
#search-input:focus { outline: none; box-shadow: 0 0 15px var(--primary-color); }
.timeline-select-wrapper { position: relative; width: 90%; max-width: 400px; }
#timeline-select { appearance: none; -webkit-appearance: none; background-color: transparent; border: 2px solid var(--secondary-color); color: var(--secondary-color); padding: 10px 20px; border-radius: 50px; cursor: pointer; font-weight: 700; width: 100%; text-align: center; font-size: 1em; transition: all 0.3s ease; }
#timeline-select:hover { background: var(--secondary-color); color: #fff; box-shadow: 0 0 15px var(--secondary-color); }
.timeline-select-wrapper::after { content: '▼'; position: absolute; top: 50%; right: 20px; transform: translateY(-50%); color: var(--secondary-color); pointer-events: none; }
#timeline-wrapper { flex-grow: 1; display: flex; flex-direction: column; overflow: hidden; }
#timeline-title { text-align: center; font-size: 1.5em; margin: 0; padding: 20px; }
#timeline-container { display: flex; align-items: center; padding: 0 25px; overflow-x: auto; overflow-y: hidden; flex-grow: 1; position: relative; -ms-overflow-style: none; scrollbar-width: none; cursor: grab; min-height: 450px; }
#timeline-container.active { cursor: grabbing; user-select: none; }
#timeline-container::-webkit-scrollbar { display: none; }

@keyframes animated-gradient { 0% { background-position: 0% 50%; } 50% { background-position: 100% 50%; } 100% { background-position: 0% 50%; } }
@keyframes pulse-glow { 0% { box-shadow: 0 0 8px var(--primary-color), 0 0 12px var(--secondary-color); } 50% { box-shadow: 0 0 16px var(--primary-color), 0 0 24px var(--secondary-color); } 100% { box-shadow: 0 0 8px var(--primary-color), 0 0 12px var(--secondary-color); } }

.timeline-central-line { position: absolute; top: 50%; left: 0; height: 6px; background: linear-gradient(90deg, var(--primary-color), var(--secondary-color), var(--primary-color)); transform: translateY(-50%); border-radius: 3px; z-index: 1; background-size: 400% 400%; animation: animated-gradient 6s linear infinite, pulse-glow 3s ease-in-out infinite; }

.era-group, .era-separator { display: flex; align-items: center; position: relative; height: 100%; }
.event-node { position: relative; width: var(--card-width); margin: 0 var(--card-horizontal-margin); height: 100%; z-index: 2; opacity: 0; transform: translateY(30px); transition: opacity 0.6s ease-out, transform 0.6s ease-out; }
.event-node.visible { opacity: 1; transform: translateY(0); }

.coming-soon-message { display: flex; justify-content: center; align-items: center; width: 100%; height: 100%; font-size: 3.5em; font-weight: 900; text-transform: uppercase; text-align: center; color: var(--primary-color); animation: pulse-glow-coming-soon 2s ease-in-out infinite; }
@keyframes pulse-glow-coming-soon { 0% { text-shadow: 0 0 10px var(--primary-color), 0 0 15px var(--secondary-color); transform: scale(1); } 50% { text-shadow: 0 0 20px var(--primary-color), 0 0 30px var(--secondary-color); transform: scale(1.05); } 100% { text-shadow: 0 0 10px var(--primary-color), 0 0 15px var(--secondary-color); transform: scale(1); } }
@media (max-width: 768px) { .coming-soon-message { font-size: 2em; } }

.year-dot { position: absolute; top: 50%; left: 50%; width: 18px; height: 18px; background: var(--background-color); border: 3px solid var(--primary-color); border-radius: 50%; transform: translate(-50%, -50%); z-index: 5; transition: transform 0.2s ease; }
.event-node:hover .year-dot { transform: translate(-50%, -50%) scale(1.3); }
.year-tooltip { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -35px); background: var(--secondary-color); color: white; padding: 5px 10px; border-radius: 5px; font-size: 0.9em; font-weight: bold; white-space: nowrap; opacity: 0; visibility: hidden; transition: opacity 0.2s ease, transform 0.2s ease; z-index: 10; }
.event-node:hover .year-tooltip { opacity: 1; visibility: visible; }
.connector { position: absolute; left: 50%; transform: translateX(-50%); width: 3px; height: var(--connector-height); background: var(--line-color); }
.event-node.filme .connector { bottom: 50%; }
.event-node.serie .connector, .event-node.series .connector { top: 50%; }
.event-logo { position: absolute; left: 50%; transform: translateX(-50%); max-width: 80%; max-height: 100px; object-fit: contain; transition: transform 0.3s ease, filter 0.3s ease; cursor: pointer; }
.event-node.filme .event-logo { bottom: calc(50% + var(--connector-height)); }
.event-node.serie .event-logo, .event-node.series .event-logo { top: calc(50% + var(--connector-height)); }
.event-logo:hover { filter: drop-shadow(0 0 15px var(--primary-color)); transform: translateX(-50%) scale(1.05); }
.era-separator { display: flex; align-items: center; justify-content: center; padding: 0 30px; height: 100%; position: relative; z-index: 3; cursor: default; }
.era-separator h3 { background: linear-gradient(45deg, var(--primary-color), var(--secondary-color)); color: var(--background-color); padding: 10px 20px; border-radius: 50px; font-size: 1.5em; text-transform: uppercase; font-weight: 900; white-space: nowrap; box-shadow: 0 0 20px var(--secondary-color); transition: all 0.3s ease-in-out; text-align: center; }
.era-separator:hover h3 { box-shadow: 0 0 35px var(--secondary-color); transform: scale(1.05); color: #fff; }

.hidden { display: none !important; }

/* Media Queries para Responsividade */
@media (max-width: 768px) {
    :root { --card-width: 200px; --card-horizontal-margin: 15px; --connector-height: 50px; }
    .main-header h1 { font-size: 1.5em; }
    #timeline-title { font-size: 1.3em; }
    .era-separator h3 { font-size: 1.2em; padding: 8px 15px; }
}

/* --- ESTILOS DO MODAL DE INFORMAÇÕES --- */
.modal-overlay { position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0, 0, 0, 0.7); backdrop-filter: blur(5px); display: flex; align-items: center; justify-content: center; z-index: 1000; opacity: 0; transition: opacity 0.3s ease; pointer-events: none; }
.modal-overlay:not(.hidden) { opacity: 1; pointer-events: all; }
.modal-content { background: var(--background-color); border: 2px solid var(--primary-color); padding: 25px; border-radius: 15px; width: 90%; max-width: 800px; max-height: 90vh; position: relative; box-shadow: 0 0 30px var(--primary-color); transform: scale(0.9); transition: transform 0.3s ease; overflow: auto; }
.modal-overlay:not(.hidden) .modal-content { transform: scale(1); }
.close-button { position: absolute; top: 10px; right: 15px; background: none; border: none; color: #fff; font-size: 2.5em; cursor: pointer; z-index: 1; }

#modal-body-container { display: flex; gap: 25px; }
.modal-poster { flex-basis: 35%; flex-shrink: 0; }
.modal-poster img { width: 100%; height: auto; border-radius: 10px; }
.modal-info { flex-grow: 1; display: flex; flex-direction: column; gap: 15px; }
.modal-header { margin-bottom: 10px; }
.modal-header h2 { margin: 0; color: var(--primary-color); text-shadow: 0 0 8px var(--primary-color); font-size: 2em; line-height: 1.2; }
.modal-header span { background-color: var(--secondary-color); color: #fff; padding: 3px 10px; border-radius: 20px; font-size: 0.8em; font-weight: bold; display: inline-block; margin-top: 10px; }

.info-box { background-color: rgba(10, 10, 25, 0.6); border: 1px solid var(--line-color); padding: 15px; border-radius: 8px; }
.info-box h4 { margin: 0 0 8px; color: var(--primary-color); font-size: 0.9em; text-transform: uppercase; letter-spacing: 1px; }
.info-box p { margin: 0; color: #eee; line-height: 1.6; }

/* Responsividade para o novo modal */
@media (max-width: 768px) {
    .modal-content { padding: 15px; }
    #modal-body-container { flex-direction: column; }
    .modal-header h2 { font-size: 1.5em; }
}