/* hq.css */

:root {
    --background-color: #0a0a0f;
    --text-color: #e0e0e0;
    --primary-neon-color: #ffffff;
    --secondary-neon-color: #ff0055;
    --sidebar-width: 300px;
    --sidebar-width-collapsed: 50px;
    --header-height: 64px;
    --footer-height: 96px;
    --overlay-opacity: 0.85;

    /* Analog Equipment Variables */
    --bg-panel: #1e1e1e;
    --border-analog: #333;
    --accent-gold: #d4af37;
    --led-green: #2ecc71;
    --led-red: #e74c3c;
    --font-title: 'Oswald', sans-serif;
    --font-script: 'Courier Prime', monospace;
}

/* EQUIPMENT PANEL BASE */
.equipment-panel {
    background: var(--bg-panel);
    border: 2px solid var(--border-analog);
    border-radius: 4px;
    box-shadow: 
        inset 0 1px 0 rgba(255,255,255,0.1),
        0 10px 30px rgba(0,0,0,0.8),
        0 0 0 1px #000;
    position: relative;
}

.status-led {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: #333;
    box-shadow: inset 0 2px 4px rgba(0,0,0,0.5);
}

.status-led.online {
    background: var(--led-green);
    box-shadow: 0 0 8px var(--led-green), inset 0 2px 4px rgba(255,255,255,0.5);
}

.status-led.warning {
    background: var(--accent-gold);
    box-shadow: 0 0 8px var(--accent-gold), inset 0 2px 4px rgba(255,255,255,0.5);
}

.vu-meter {
    display: flex;
    gap: 4px;
    margin-left: auto;
}

.vu-meter span {
    width: 6px;
    height: 18px;
    background: #333;
    border-radius: 1px;
    box-shadow: inset 0 1px 2px rgba(0,0,0,0.5);
}
.vu-meter span:nth-child(1), .vu-meter span:nth-child(2) { background: var(--led-green); }
.vu-meter span:nth-child(3) { background: #f1c40f; }
.vu-meter span:nth-child(4), .vu-meter span:nth-child(5) { background: #333; }

.modal-header-analog {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 20px;
}

.modal-title {
    font-family: var(--font-title) !important;
    color: #fff !important;
    font-size: 1.8rem !important;
    margin: 0 !important;
    letter-spacing: 2px !important;
    text-transform: uppercase;
}

.modal-divider {
    height: 2px;
    background: #333;
    margin-bottom: 20px;
    box-shadow: 0 1px 0 rgba(255,255,255,0.05);
}

.analog-btn {
    font-family: var(--font-title);
    font-size: 1.1rem;
    letter-spacing: 1px;
    padding: 12px 24px;
    background: linear-gradient(to bottom, #4a4a4a, #2a2a2a);
    border: 1px solid #111;
    border-top-color: #666;
    border-radius: 4px;
    color: #fff;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.5), inset 0 1px 0 rgba(255,255,255,0.2);
    text-shadow: 0 1px 2px rgba(0,0,0,0.8);
    transition: all 0.1s ease;
}

.analog-btn:hover {
    background: linear-gradient(to bottom, #555, #333);
}

.analog-btn:active {
    transform: translateY(2px);
    box-shadow: 0 1px 2px rgba(0,0,0,0.6), inset 0 2px 5px rgba(0,0,0,0.5);
    border-top-color: #222;
}

.execute-btn {
    color: var(--accent-gold);
    border-color: #555;
    background: linear-gradient(to bottom, #2a2a2a, #1a1a1a);
}

.execute-btn:hover { color: #fff; background: linear-gradient(to bottom, #333, #222); }

body {
    background-color: var(--background-color);
    color: var(--text-color);
    font-family: 'Courier New', Courier, monospace;
    margin: 0;
    overflow: hidden;
}

/* --- Header --- */
#site-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: var(--header-height);
    background-color: rgba(211, 47, 47, var(--overlay-opacity)); /* Restaurado Vermelho Original */
    background-image: url('/assets/images/header-vermelho.png');
    background-size: cover;
    background-position: center;
    background-blend-mode: multiply; /* Restaurado Modo Multiply */
    border-bottom: 2px solid #fff;
    z-index: 1200;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
}

/* --- Override para a Home (Estética Cinza/Studio Director) --- */
body.studio-director #site-header {
    background-color: rgba(20, 20, 20, 0.95);
    background-blend-mode: luminosity;
    border-bottom: 1px solid #333;
    backdrop-filter: blur(8px);
}

.header-title {
    margin: 0;
    font-size: 1.6rem;
    font-family: 'Oswald', sans-serif;
    letter-spacing: 5px;
    text-transform: uppercase;
    text-shadow: 0 2px 4px rgba(0,0,0,0.5);
    text-align: center;
    padding: 0 10px;
}

@media (max-width: 768px) {
    .header-title {
        font-size: 1.2rem;
        letter-spacing: 2px;
        line-height: 1.2;
    }
}

/* --- Sidebars --- */
#sidebar, #right-sidebar {
    position: fixed;
    top: var(--header-height);
    width: var(--sidebar-width);
    height: calc(100vh - var(--header-height));
    transition: transform 0.5s ease-in-out;
    z-index: 1000;
    color: #fff;
}

#sidebar {
    left: 0;
    background-color: rgba(25, 118, 210, var(--overlay-opacity));
    background-image: url('/assets/images/sidebar-esquerdo-azul.png');
    background-size: cover;
    background-blend-mode: multiply;
    border-right: 2px solid #fff;
    max-width: 100vw;
}

#right-sidebar {
    right: 0;
    background-color: rgba(239, 108, 0, var(--overlay-opacity));
    background-image: url('/assets/images/sidebar-direito-laranja.png');
    background-size: cover;
    background-blend-mode: multiply;
    border-left: 2px solid #fff;
}

#sidebar.collapsed {
    transform: translateX(calc(-1 * var(--sidebar-width) + var(--sidebar-width-collapsed)));
}

#right-sidebar.collapsed {
    transform: translateX(calc(var(--sidebar-width) - var(--sidebar-width-collapsed)));
}

#sidebar-toggle, #right-sidebar-toggle {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 25px;
    height: 50px;
    background-color: var(--primary-neon-color);
    color: #000;
    border: none;
    cursor: pointer;
    font-size: 1.2em;
}

#sidebar-toggle {
    right: -25px;
    clip-path: polygon(0 0, 100% 25%, 100% 75%, 0 100%);
    box-shadow: 2px 0 5px rgba(0,0,0,0.5);
}

#right-sidebar-toggle {
    left: -25px;
    clip-path: polygon(100% 0, 0 25%, 0 75%, 100% 100%);
    box-shadow: -2px 0 5px rgba(0,0,0,0.5);
}

#sidebar-content, #right-sidebar-content {
    padding: 20px;
}

#sidebar-content {
    overflow-y: auto;
    height: 100%;
    box-sizing: border-box;
    scrollbar-width: thin;
    scrollbar-color: var(--primary-neon-color) rgba(0,0,0,0.2);
}

#sidebar-content::-webkit-scrollbar { width: 4px; }
#sidebar-content::-webkit-scrollbar-track { background: rgba(0,0,0,0.1); border-radius: 8px; }
#sidebar-content::-webkit-scrollbar-thumb { background-color: rgba(0, 255, 204, 0.5); border-radius: 8px; }

#sidebar-content h2, #right-sidebar-content h2 {
    color: #fff;
    text-align: center;
    border-bottom: 1px solid rgba(255,255,255,0.3);
    padding-bottom: 10px;
}

.active-panel-info {
    border-left: 4px solid var(--primary-neon-color);
    padding-left: 10px;
    background: rgba(0, 255, 204, 0.1);
    border-radius: 4px;
    margin-bottom: 15px;
}

.sidebar-dialogue {
    color: #ffd700;
    font-style: italic;
    margin: 10px 0;
    font-size: 0.95rem;
}

/* --- SIDEBAR DE PRODUÇÃO (ESQUERDO) --- */
.tech-details-box {
    margin-top: 20px;
    padding: 15px;
    background: rgba(0, 0, 0, 0.4);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 8px;
    border-top: 3px solid var(--primary-neon-color);
}

.tech-details-box h3 {
    font-size: 0.85rem;
    color: var(--primary-neon-color);
    margin-top: 0;
    margin-bottom: 12px;
    border-bottom: 1px solid rgba(0, 255, 204, 0.3);
    padding-bottom: 5px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.tech-details-box p { font-size: 0.85rem; margin: 8px 0; line-height: 1.2; }
.tech-details-box strong { color: var(--primary-neon-color); }

/* --- SIDEBAR DE LITERATURA (DIREITO) --- */
.literary-paragraph {
    font-family: 'Georgia', serif;
    font-size: 1.1rem;
    line-height: 1.8;
    color: #f0f0f0;
    text-align: justify;
    padding: 15px;
    margin-bottom: 20px;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 8px;
    border-left: 3px solid rgba(0, 255, 204, 0.5);
    transition: all 0.4s ease;
}

.literary-paragraph:hover {
    background: rgba(0, 255, 204, 0.1);
    border-left: 3px solid var(--primary-neon-color);
}

#right-sidebar-content { display: flex; flex-direction: column; height: 100%; box-sizing: border-box; overflow: hidden; }

.tts-sentence { transition: background-color 0.3s ease, color 0.3s ease; border-radius: 4px; padding: 2px 0; }
.tts-sentence.highlight-word { background-color: rgba(255, 215, 0, 0.2); color: #fff; text-shadow: 0 0 10px #ffd700; }

#literary-text-container {
    flex: 1;
    overflow-y: auto;
    padding-right: 10px;
    scrollbar-width: thin;
    scrollbar-color: var(--primary-neon-color) rgba(0,0,0,0.2);
}

/* --- LENTE DE DIRETOR (GUIAS DE COMPOSIÇÃO SVG) --- */
.grid-composition-overlay {
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    pointer-events: none;
    z-index: 20;
    opacity: 0;
    transition: opacity 0.3s ease;
    display: block; /* Mudado de grid para block para conter o SVG */
}

.grid-composition-overlay svg {
    width: 100%;
    height: 100%;
    display: block;
}

/* Estilo padrão das linhas das guias */
.grid-composition-overlay .guide-line {
    stroke: rgba(0, 242, 255, 0.5); /* Azul Neon Vibrante */
    stroke-width: 2;
    vector-effect: non-scaling-stroke;
}

/* Destaque para pontos de interesse ou Safe Areas */
.grid-composition-overlay .guide-accent {
    stroke: rgba(0, 162, 255, 0.4); /* Azul Elétrico Suave */
    stroke-width: 1.5;
    stroke-dasharray: 5,5;
}

#grid-container.show-director-lens .grid-composition-overlay { opacity: 1; }

/* --- CONTEÚDO CENTRAL (CORREÇÃO DE SEGURANÇA) --- */
#main-content {
    position: relative;
    padding: 20px;
    transition: margin-left 0.5s ease-in-out, margin-right 0.5s ease-in-out;
    margin-left: var(--sidebar-width-collapsed);
    margin-right: var(--sidebar-width-collapsed);
    margin-top: var(--header-height);
    margin-bottom: var(--footer-height);
    background-color: var(--background-color);
    height: calc(100vh - var(--header-height) - var(--footer-height));
}

#sidebar:not(.collapsed) ~ #main-content { margin-left: var(--sidebar-width); }
#right-sidebar:not(.collapsed) ~ #main-content { margin-right: var(--sidebar-width); }

#grid-container {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
    width: 100%;
    overflow: hidden;
}

.grid-panel {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.95);
    
    /* EXPANSÃO MÁXIMA PROPORCIONAL 16:9 (1.77:1) */
    --h-limit: calc(100vh - var(--header-height) - var(--footer-height) - 40px);
    width: min(95%, 1200px, calc(var(--h-limit) * 1.777));
    aspect-ratio: 16 / 9;
    
    background-color: #000;
    border: 2px solid #000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.5s ease, transform 0.5s ease, visibility 0.5s ease;
    box-shadow: 0 20px 50px rgba(0,0,0,0.9);
    box-sizing: border-box;
    overflow: hidden;
}

.grid-panel.active-panel {
    opacity: 1;
    visibility: visible;
    transform: translate(-50%, -50%) scale(1);
    z-index: 10;
}

.grid-panel img {
    width: 100%;
    height: 100%;
    object-fit: contain; /* SEGURANÇA: Mostra tudo sem cortar */
}

/* --- Navegação --- */
#prev-page-btn, #next-page-btn {
    position: absolute;
    bottom: 20px;
    z-index: 1100;
    padding: 8px 16px;
    background-color: rgba(25, 25, 30, 0.7);
    color: white;
    border: 1px solid #555;
    border-radius: 20px;
    cursor: pointer;
    backdrop-filter: blur(5px);
    transition: all 0.3s ease;
}

#prev-page-btn:hover, #next-page-btn:hover { background-color: var(--primary-neon-color); color: #000; }
#prev-page-btn { left: 20px; }
#next-page-btn { right: 20px; }
.hidden { display: none !important; }

/* --- Footer & Dock --- */
#site-footer { 
    position: fixed; 
    bottom: 0; 
    left: 0;
    width: 100%; 
    height: var(--footer-height); 
    z-index: 1200; 
    pointer-events: none; /* Deixa o resto da área do rodapé transparente para cliques */
}

.dock {
    pointer-events: auto; /* Reativa cliques apenas na barra de ferramentas */
    position: absolute;
    left: 50%; bottom: 6px; transform: translateX(-50%);
    display: flex; gap: 12px; padding: 10px 14px;
    background: rgba(17, 17, 17, 0.6);
    border: 1px solid #333; border-radius: 16px;
    backdrop-filter: blur(8px);
}

.dock-item {
    width: 56px; height: 56px; border-radius: 12px;
    background-color: #111; color: #fff; border: 1px solid #444;
    display: flex; align-items: center; justify-content: center;
    font-size: 24px; cursor: pointer; transition: transform 0.15s ease;
}

.dock-item:hover { transform: scale(1.25); border-color: var(--primary-neon-color); }
.dock-item.active { background-color: var(--primary-neon-color) !important; color: #000 !important; box-shadow: 0 0 20px var(--primary-neon-color); }
.dock-item.disabled { opacity: 0.2; cursor: not-allowed; pointer-events: none; }

/* --- Novo Overlay Isolado do Animatic --- */
#animatic-player-overlay {
    position: fixed;
    top: 0; left: 0; width: 100vw; height: 100vh;
    background: #000;
    z-index: 2500;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.animatic-frame-container {
    width: 90%;
    max-width: 1200px;
    aspect-ratio: 16 / 9;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    box-shadow: 0 0 100px rgba(255, 215, 0, 0.1);
}

.animatic-frame-container img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    transition: opacity 0.5s ease-in-out;
}

/* Reutilizando as classes de controle mas ajustando o z-index */
.animatic-controls {
    z-index: 2600 !important;
}

/* Animatic Control Bar */
.animatic-controls {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    align-items: center;
    gap: 20px;
    background: rgba(10, 10, 10, 0.9);
    padding: 10px 25px;
    border: 1px solid var(--accent-gold);
    border-radius: 30px;
    z-index: 2000;
    box-shadow: 0 0 20px rgba(212, 175, 55, 0.3);
    color: #fff;
    font-family: var(--font-title);
    font-size: 0.8rem;
}

.speed-selector {
    display: flex;
    gap: 10px;
}

.speed-btn {
    background: transparent;
    border: 1px solid #444;
    color: #888;
    padding: 4px 10px;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.3s;
}

.speed-btn.active {
    border-color: var(--accent-gold);
    color: var(--accent-gold);
    background: rgba(212, 175, 55, 0.1);
}

.animatic-status {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--accent-gold);
}

.animatic-status .dot {
    width: 8px;
    height: 8px;
    background: var(--led-green);
    border-radius: 50%;
    animation: blink 1s infinite;
}

@keyframes blink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.3; }
}


/* --- Modais --- */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1500;
    backdrop-filter: blur(5px);
}

.modal-content {
    background: rgba(26, 26, 26, 0.95);
    padding: 30px;
    border-radius: 12px;
    width: 90%;
    max-width: 600px;
    max-height: 80vh;
    overflow-y: auto;
    position: relative;
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: #fff;
    box-shadow: 0 20px 60px rgba(255, 0, 85, 0.2), inset 0 1px 0 rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
}

.modal-close {
    position: absolute;
    top: 15px;
    right: 15px;
    background: none;
    border: none;
    color: #fff;
    font-size: 24px;
    cursor: pointer;
    transition: all 0.3s ease;
    line-height: 1;
    z-index: 10;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
}

.modal-close:hover {
    color: var(--secondary-neon-color);
    background: rgba(255, 0, 85, 0.1);
    box-shadow: 0 0 10px rgba(255, 0, 85, 0.3);
}

.chapter-end-marker { position: absolute; display: flex; justify-content: center; align-items: center; width: 100%; height: 100%; opacity: 0; visibility: hidden; transition: opacity 0.5s ease; background: rgba(0,0,0,0.8); z-index: 15; }
.chapter-end-marker.active-panel { opacity: 1; visibility: visible; }
.chapter-end-marker span { font-size: 2em; font-weight: bold; color: var(--primary-neon-color); text-shadow: 0 0 15px var(--primary-neon-color); letter-spacing: 5px; text-transform: uppercase; animation: glow 2s ease-in-out infinite alternate; }
@keyframes glow { from { opacity: 0.6; } to { opacity: 1; } }

/* --- RESPONSIVIDADE --- */
@media (max-width: 1024px) {
    #sidebar, #right-sidebar { z-index: 2000; height: 100vh; top: 0; width: 85vw; }
    #main-content { margin-left: 0 !important; margin-right: 0 !important; padding: 5px; }
    #sidebar.collapsed { transform: translateX(-100%); }
    #right-sidebar.collapsed { transform: translateX(100%); }
    #sidebar-toggle, #right-sidebar-toggle { width: 35px; height: 70px; z-index: 2001; }
    #sidebar-toggle { right: -35px; }
    #right-sidebar-toggle { left: -35px; }
    .grid-panel { width: 95%; height: auto; aspect-ratio: 16 / 9; }
}

.large-modal { width: 90%; max-width: 1200px; height: 85vh; display: flex; flex-direction: column; background: rgba(10, 10, 15, 0.95); border: 1px solid rgba(255, 255, 255, 0.1); backdrop-filter: blur(20px); }
.obras-galeria, .capitulos-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 25px; padding: 20px; overflow-y: auto; flex-grow: 1; }
.obra-card { background: rgba(25, 25, 30, 0.6); border-radius: 12px; border: 1px solid rgba(255, 255, 255, 0.05); overflow: hidden; cursor: pointer; transition: all 0.4s; }
.obra-card:hover { transform: translateY(-8px); border-color: rgba(255, 255, 255, 0.3); }
.obra-cover { width: 100%; aspect-ratio: 16/9; object-fit: cover; }
.obra-info { padding: 15px; text-align: center; }
.obra-title { margin: 0 0 10px 0; font-size: 1.2rem; color: var(--primary-neon-color); }
.obra-desc { font-size: 0.85rem; color: #999; margin-bottom: 15px; }
.obra-volumes-badge { display: inline-block; background: rgba(255, 255, 255, 0.1); padding: 5px 10px; border-radius: 20px; font-size: 0.75rem; color: #ffd700; }
.capitulo-card { background: rgba(0, 0, 0, 0.5); border-left: 4px solid var(--primary-neon-color); padding: 15px; cursor: pointer; transition: background 0.3s; }
.capitulo-card:hover { background: rgba(255, 255, 255, 0.1); }
.director-btn {
    background: transparent;
    border: 1px solid #666;
    color: #aaa;
    padding: 5px 10px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.75rem;
    width: 100%;
    display: flex;
    justify-content: center;
    gap: 8px;
    transition: all 0.3s ease;
}

.director-btn.active {
    border-color: var(--secondary-neon-color);
    color: #fff;
    background: rgba(255, 0, 85, 0.15);
    box-shadow: 0 0 15px rgba(255, 0, 85, 0.3);
    text-shadow: 0 0 5px #fff;
}

/* --- STAMPS E STATUS DE REVISÃO --- */
.stamp-btn:hover {
    background: rgba(255, 255, 255, 0.1) !important;
    transform: scale(1.1);
    box-shadow: 0 0 15px rgba(255, 255, 255, 0.1);
}

.stamp-btn:active {
    transform: scale(0.95);
}

/* Indicador de Status no Painel (LED de Revisão) */
.review-status-led {
    position: absolute;
    top: 15px;
    right: 15px;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: #333; /* Default: Não revisado */
    z-index: 25;
    box-shadow: 0 0 5px rgba(0,0,0,0.5);
    transition: all 0.3s ease;
}

.status-retoma { background: #ff0055; box-shadow: 0 0 10px #ff0055; }
.status-ajuste { background: #ffcc00; box-shadow: 0 0 10px #ffcc00; }
.status-aprova { background: #00ff66; box-shadow: 0 0 10px #00ff66; }
.status-ideia { background: #0099ff; box-shadow: 0 0 10px #0099ff; }
.status-luz { background: #ff9900; box-shadow: 0 0 10px #ff9900; }

.has-note-badge {
    background: var(--secondary-neon-color);
    color: white;
    font-size: 0.65rem;
    padding: 2px 6px;
    border-radius: 12px;
    box-shadow: 0 0 10px var(--secondary-neon-color);
}
.notes-textarea { width: 100%; height: 150px; background: rgba(0,0,0,0.6); border: 1px solid var(--secondary-neon-color); color: #fff; padding: 10px; border-radius: 4px; resize: none; }
