:root {
    /* --- Paleta Cyberpunk Refinada --- */
    --neon-cyan: #00f3ff;
    --neon-cyan-dim: rgba(0, 243, 255, 0.1);
    --neon-purple: #bc13fe;
    --neon-purple-dim: rgba(188, 19, 254, 0.1);
    --bg-dark: #2f0744;
    --bg-panel: rgba(10, 12, 20, 0.65);
    
    /* Cores de Texto */
    --text-main: #ffffff;
    --text-dim: #8b8ea5;
    
    /* Bordas e Vidro */
    --glass-border: rgba(255, 255, 255, 0.08);
    --glass-highlight: rgba(255, 255, 255, 0.15);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* --- SCROLLBAR CUSTOMIZADA (Caso apareça) --- */
::-webkit-scrollbar {
    width: 8px;
}
::-webkit-scrollbar-track {
    background: var(--bg-dark); 
}
::-webkit-scrollbar-thumb {
    background: #333; 
    border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
    background: var(--neon-purple); 
}

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--bg-dark);
    color: var(--text-main);
    height: 100vh;
    width: 100vw;
    overflow: hidden;
    display: flex;
    justify-content: center;
    align-items: center;

    /* Grid de fundo mais sofisticado */
    background-image: 
        linear-gradient(rgba(188, 19, 254, 0.05) 1px, transparent 1px),
        linear-gradient(90deg, rgba(0, 243, 255, 0.05) 1px, transparent 1px);
    background-size: 40px 40px;
    background-position: center center;
}

/* Vignette (Escurecimento nas bordas) */
body::after {
    content: "";
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at center, transparent 30%, #05050b 100%);
    pointer-events: none;
    z-index: -1;
}

/* --- CONTAINER PRINCIPAL --- */
.dashboard-container {
    width: 90%;
    max-width: 1400px;
    height: 95vh;
    
    display: grid;
    /* Grid: Header fixo, Conteúdo flexível, Chart fixo (mas adaptável) */
    grid-template-rows: auto 1fr 32%; 
    gap: 20px;
    padding: 25px;

    /* Efeito de Vidro Fosco Cyberpunk */
    background: rgba(13, 13, 22, 0.6);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    
    border: 1px solid var(--glass-border);
    border-top: 1px solid var(--glass-highlight);
    border-radius: 24px;
    
    box-shadow: 
        0 20px 50px rgba(0, 0, 0, 0.8),
        inset 0 0 0 1px rgba(255, 255, 255, 0.05);

    position: relative;
    overflow: hidden;
}

/* Detalhe estético: Cantoneiras brilhantes (HUD Style) */
.dashboard-container::before,
.dashboard-container::after {
    content: "";
    position: absolute;
    width: 100px;
    height: 100px;
    pointer-events: none; /* Deixa clicar através delas */
    
    /* AQUI ESTÁ O SEGREDO: */
    /* 1. O raio deve ser igual ao do container (24px) */
    border-radius: 24px; 
    
    /* 2. Definimos o estilo como solid para evitar falhas de renderização */
    border-style: solid;
    
    /* Efeito suave de transição */
    transition: all 0.5s ease;
    box-shadow: 0 0 10px rgba(0,0,0,0);
}

/* Canto Superior Esquerdo (Ciano) */
.dashboard-container::before {
    top: 0; 
    left: 0;
    
    /* Define borda APENAS em cima e na esquerda (3px). 
       Direita e baixo ficam com 0px para não criar pontas diagonais. */
    border-width: 3px 0 0 3px; 
    border-color: var(--neon-cyan);
    
    /* Garante que o canto arredondado seja apenas o superior esquerdo */
    border-top-left-radius: 24px;
    border-top-right-radius: 0;
    border-bottom-left-radius: 0;
    
    /* Brilho */
    filter: drop-shadow(0 0 4px var(--neon-cyan));
}

/* Canto Inferior Direito (Roxo) */
.dashboard-container::after {
    bottom: 0; 
    right: 0;
    
    /* Define borda APENAS embaixo e na direita */
    border-width: 0 3px 3px 0;
    border-color: var(--neon-purple);
    
    /* Garante que o canto arredondado seja apenas o inferior direito */
    border-bottom-right-radius: 24px;
    border-top-right-radius: 0;
    border-bottom-left-radius: 0;
    
    /* Brilho */
    filter: drop-shadow(0 0 4px var(--neon-purple));
}

/* Efeito Hover: As bordas crescem um pouco */
.dashboard-container:hover::before {
    width: 120px; height: 120px;
    filter: drop-shadow(0 0 8px var(--neon-cyan));
}
.dashboard-container:hover::after {
    width: 120px; height: 120px;
    filter: drop-shadow(0 0 8px var(--neon-purple));
}

/* --- HEADER --- */
.main-header {
    display: grid;
    grid-template-columns: 80px 1fr 80px;
    align-items: center;
    background: linear-gradient(90deg, rgba(255,255,255,0.01), rgba(255,255,255,0.03), rgba(255,255,255,0.01));
    border-bottom: 1px solid var(--glass-border);
    border-radius: 16px;
    padding: 15px 30px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.2);
}

.logo-area img, .qr-area img {
    height: 60px;
    width: auto;
    object-fit: contain;
    filter: drop-shadow(0 0 8px rgba(0, 243, 255, 0.3));
    transition: transform 0.3s ease;
}

.logo-area img:hover, .qr-area img:hover {
    transform: scale(1.05);
}

.qr-area img {
    border-radius: 8px;
    border: 1px solid rgba(255,255,255,0.2);
}

.header-info {
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.header-info h1 {
    font-size: 2rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 4px;
    margin: 0;
    color: #fff;
    text-shadow: 0 0 20px rgba(0, 243, 255, 0.4);
}

.header-info h1 span {
    color: var(--neon-purple);
    text-shadow: 0 0 15px var(--neon-purple);
    font-style: italic;
}

.header-info p {
    font-family: 'Inter', monospace; /* Fallback para visual técnico */
    font-size: 0.85rem;
    letter-spacing: 1px;
    background: rgba(0, 0, 0, 0.3);
    padding: 4px 12px;
    border-radius: 20px;
    margin-top: 8px;
    border: 1px solid var(--glass-border);
}

/* --- ÁREA CENTRAL (VÍDEO E RELÓGIOS) --- */
.content-grid {
    display: grid;
    grid-template-columns: 1.6fr 1fr; /* Vídeo ganha mais destaque */
    gap: 20px;
    min-height: 0; /* Importante para o Grid não estourar */
}

/* Estilo Base dos Painéis de Vidro */
.glass-panel {
    background: rgba(20, 20, 25, 0.4);
    border: 1px solid var(--glass-border);
    border-radius: 16px;
    position: relative;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(0,0,0,0.3);
    transition: border-color 0.3s ease;
}

.glass-panel:hover {
    border-color: rgba(255,255,255,0.2);
}

/* Scanline Effect (Linhas de TV) */
.glass-panel::before {
    content: " ";
    display: block;
    position: absolute;
    top: 0; left: 0; bottom: 0; right: 0;
    background: linear-gradient(rgba(18, 16, 16, 0) 50%, rgba(0, 0, 0, 0.1) 50%), linear-gradient(90deg, rgba(255, 0, 0, 0.03), rgba(0, 255, 0, 0.01), rgba(0, 0, 255, 0.03));
    z-index: 2;
    background-size: 100% 4px, 6px 100%;
    pointer-events: none;
}

/* Vídeo */
.video-card {
    display: flex;
    align-items: center;
    justify-content: center;
    background: #000; /* Fundo preto pro vídeo */
}

.video-wrapper {
    width: 100%;
    height: 100%;
    position: relative;
}

.video-wrapper video {
    width: 100%;
    height: 100%;
    object-fit: cover; /* Preenche todo o card */
    opacity: 0.9;
}

/* --- RELÓGIOS --- */
.clock-section {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.clock-card {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    background: radial-gradient(circle at center, rgba(30, 30, 40, 0.5), rgba(0,0,0,0.6));
    border: 1px solid rgba(0, 243, 255, 0.15); /* Padrão azul */
}

/* Ajuste específico para o segundo relógio (Brasília) */
.clock-section .clock-card:nth-child(2) {
    border-color: rgba(188, 19, 254, 0.2);
}

.clock-title {
    font-size: 0.9rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 3px;
    margin-bottom: 10px;
    position: relative;
    z-index: 3;
    padding: 5px 15px;
    border-radius: 4px;
    background: rgba(0,0,0,0.4);
    border: 1px solid transparent;
}

/* Cores dos títulos */
.clock-card:nth-child(1) .clock-title {
    color: var(--neon-cyan);
    border-color: rgba(0, 243, 255, 0.3);
    box-shadow: 0 0 10px var(--neon-cyan-dim);
}

.clock-card:nth-child(2) .clock-title {
    color: var(--neon-purple);
    border-color: rgba(188, 19, 254, 0.3);
    box-shadow: 0 0 10px var(--neon-purple-dim);
}

.clock-canvas-container {
    width: 100%;
    flex-grow: 1;
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
    z-index: 1;
    padding: 0 20px;
}

.clock-canvas-container canvas {
    max-width: 100%;
    height: auto !important;
    /* O truque mágico: Drop Shadow no Canvas para simular Neon Glow */
    filter: drop-shadow(0 0 8px rgba(0, 243, 255, 0.6));
}

/* Ajuste do glow para o segundo relógio via CSS selector */
.clock-section .clock-card:nth-child(2) canvas {
    /* Como o JS define a cor interna, aqui adicionamos um glow roxo secundário sutil */
    filter: drop-shadow(0 0 8px rgba(188, 19, 254, 0.5)); 
}

/* --- GRÁFICO (FOOTER) --- */
.chart-card {
    display: flex;
    flex-direction: column;
    padding: 20px;
    background: linear-gradient(180deg, rgba(20, 20, 35, 0.4) 0%, rgba(5, 5, 10, 0.8) 100%);
}

.chart-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
    padding-bottom: 10px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.chart-header h2 {
    font-size: 1rem;
    color: #e0e7ff;
    text-transform: uppercase;
    letter-spacing: 2px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.chart-header h2::before {
    content: '';
    display: block;
    width: 4px;
    height: 16px;
    background: var(--neon-purple);
    box-shadow: 0 0 8px var(--neon-purple);
}

/* Indicador "Ao Vivo" */
.live-dot {
    width: 8px;
    height: 8px;
    background-color: var(--neon-cyan);
    border-radius: 50%;
    box-shadow: 0 0 10px var(--neon-cyan);
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(0, 243, 255, 0.7); }
    70% { transform: scale(1); box-shadow: 0 0 0 6px rgba(0, 243, 255, 0); }
    100% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(0, 243, 255, 0); }
}

.canvas-wrapper {
    flex-grow: 1;
    position: relative;
    width: 100%;
    min-height: 0;
}

/* --- RESPONSIVIDADE --- */
@media (max-width: 1024px) {
    .dashboard-container {
        height: auto;
        min-height: 100vh;
        grid-template-rows: auto auto 400px;
        overflow-y: auto;
    }

    .content-grid {
        grid-template-columns: 1fr;
        grid-template-rows: 300px auto;
    }
    
    .clock-section {
        flex-direction: row;
        height: 180px;
    }
}

/* --- RESPONSIVIDADE EXCLUSIVA PARA CELULAR --- */
/* --- RESPONSIVIDADE EXCLUSIVA PARA CELULAR --- */
@media (max-width: 768px) {
    body {
        overflow-y: auto; /* Permite rolar a página verticalmente */
        height: auto;
        padding: 10px 0;
    }

    .dashboard-container {
        width: 95%;
        height: auto; 
        display: flex;
        flex-direction: column; 
        gap: 15px;
        padding: 15px;
        margin: 10px auto;
        grid-template-rows: none; 

        /* Removemos as cantoneiras flutuantes para não cobrir a logo */
        border: 2px solid var(--glass-border);
        /* Criamos um efeito de borda colorida simples e limpo */
        border-top-color: var(--neon-cyan);
        border-bottom-color: var(--neon-purple);
        
    }

    /* HEADER: Organiza Logo, Título e QR Code */
    .main-header {
        display: flex;
        flex-direction: row; /* Mantém os itens na mesma linha */
        justify-content: space-between;
        align-items: center;
        padding: 10px;
        gap: 10px;
    }

    .logo-area img, .qr-area img {
        height: 40px; /* Reduz tamanho para caber no celular */
        display: block !important; /* Garante que apareçam */
    }

    .header-info h1 {
        font-size: 1rem; /* Diminui o texto para não empurrar os ícones */
        letter-spacing: 1px;
    }

    .header-info p {
        font-size: 0.65rem;
        padding: 2px 8px;
    }

    /* Área de Conteúdo (Vídeo e Relógios) */
    .content-grid {
        display: flex;
        flex-direction: column;
        gap: 15px;
    }

    .video-card {
        height: 200px; /* Altura ajustada para telas verticais */
    }

    .clock-section {
        flex-direction: column;
        height: auto;
        gap: 10px;
    }

    .clock-card {
        padding: 10px 0;
        min-height: 100px;
    }

    .clock-title {
        font-size: 0.7rem;
        letter-spacing: 1px;
        margin-bottom: 5px;
    }

    /* Ajuste do Gráfico */
    .chart-card {
        height: 280px; 
        padding: 10px;
    }

    .chart-header h2 {
        font-size: 0.8rem;
    }

    /* Reduz as cantoneiras para não poluir o visual pequeno */
    .dashboard-container::before, 
    .dashboard-container::after {
        display: none !important;
    }
}

/* --- RESPONSIVIDADE PARA NOTEBOOKS (Foco em resolver sobreposição) --- */
@media (min-width: 1025px) and (max-height: 850px) {
    .dashboard-container {
        height: 96vh;
        /* Fixamos a altura do gráfico para garantir que ele não suba */
        grid-template-rows: auto 1fr 180px; 
        padding: 15px;
        gap: 12px;
    }

    /* Reduz o Header para sobrar espaço */
    .main-header {
        padding: 6px 20px;
    }
    .header-info h1 { font-size: 1.4rem; }
    .logo-area img, .qr-area img { height: 40px; }

    /* Força o grid central a respeitar o espaço restante */
    .content-grid {
        min-height: 0; 
        gap: 12px;
    }

    /* Ajusta os relógios para serem mais "achatados" */
    .clock-section { gap: 10px; }
    .clock-card { 
        padding: 5px; 
        min-height: 0;
    }
    .clock-title { 
        font-size: 0.75rem; 
        margin-bottom: 2px;
        padding: 2px 8px;
    }
    .clock-canvas-container { padding: 0 10px; }

    /* Ajuste do Gráfico (Footer) */
    .chart-card {
        padding: 10px 15px;
        height: 180px; /* Altura fixa para evitar sobreposição */
    }
    .chart-header { margin-bottom: 5px; padding-bottom: 5px; }

    /* Ajuste do tamanho do texto dentro do card principal */
    .video-card h2, .video-card p {
        font-size: 1.2rem !important; /* Ajuste conforme a classe que você usa no texto */
    }
}