html, body {
    height: 100%;
}
body {
    margin: 0;
    font-family: Arial, Helvetica, sans-serif;
    background: #f4f4f4;
    min-height: 100vh;
    display: flex; 
    flex-direction: column;
    align-items: center; 
}

/* ================= CONTAINER PRINCIPAL (60%/100%) ================= */

#pageContainer {
    width: 100%; 
    max-width: 100%;
    margin: 0 auto; 
    background: #ffffff; 
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}

/* HEADER */
#mainHeader {
    display: flex;
    flex-direction: column; 
    background: #ffffff;
    padding: 10px;
    border-bottom: 2px solid #ddd;
}

/* LOGOTIPO E SLOGAN */
.logoBox {
    text-align: center; 
    padding-bottom: 5px; 
}
.logoBox img {
    width: 140px;
    display: block;
    margin: auto;
}
.logoBox small {
    font-size: 0.75em; 
    color: #666;      
    display: block;   
    margin-top: 5px; 
}

/* CONTROLES (Select, SearchBox, EditionInfo) */
.headerControls {
    display: flex;
    flex-direction: column; 
    gap: 10px;
    margin-top: 10px;
}

.searchBox {
    display: flex; 
    gap: 5px;
}

#countrySelect,
#searchInput {
    padding: 8px;
    font-size: 16px;
    border: 1px solid #ccc; 
    border-radius: 4px; 
}
#searchInput {
    flex-grow: 1; 
}

/* Melhoria de Foco */
#countrySelect:focus,
#searchInput:focus {
    outline: none;
    border-color: #007bff;
    box-shadow: 0 0 0 2px rgba(0, 123, 255, 0.25);
}

#searchButton {
    padding: 8px 14px;
    font-size: 18px;
    background-color: #007bff;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
}
#searchButton:hover {
    background-color: #0056b3;
}

#editionInfo {
    font-size: 14px;
    color: #444;
    text-align: center;
    margin-top: 6px;
}

/* MAIN CONTENT */

#mainContent {
    padding: 12px;
    flex-grow: 1; 
}

.mainTitle {
    text-align: left;
    font-size: 22px;
    margin-bottom: 15px;
}

/* Continent blocks */
.continentBlock {
    background: #e5e5e5;
    padding: 8px;
    margin: 10px 0;
    font-weight: bold;
    border-left: 5px solid #333;
    cursor: pointer; 
}

/* ESTILOS PARA ACORDEÃO DE CONTINENTES */
.countryContainer.continent-closed {
    display: none; /* ESSENCIAL: Esconde o conteúdo por padrão */
}
.countryContainer.continent-open {
    display: block; 
}
/* FIM ESTILOS ACORDEÃO */


.countryLine {
    padding: 8px;
    margin-left: 10px;
    background: #fff;
    border-bottom: 1px solid #ddd;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
}

.portalList {
    display: none; /* Lista de Portais é sempre escondida até o clique no país */
    margin-left: 25px;
    background: #fafafa;
    border-left: 3px solid #888;
}

/* Portals */
.portalItem {
    padding: 6px 8px;
    border-bottom: 1px solid #eee;
    cursor: pointer;
}
.portalItem:hover {
    background: #e7e7e7;
}

/* News Panel */
#newsPanel h2 {
    margin-top: 20px;
}

/* ATUALIZAÇÃO: Estilo para links de notícias dentro do MODAL */
.newsItem {
    margin-bottom: 8px; /* Adiciona distância maior entre as linhas */
}
.newsItem a { 
    text-decoration: none;
    color: #333;
    display: block; /* Garante que o espaçamento do margin-bottom funcione */
    padding: 4px 0; /* Pequeno padding para aumentar a área de clique */
}
.newsItem a:hover {
    color: #007bff;
}

/* Footer Ticker */
#mainFooter {
    background: #222;
    padding: 10px;
    overflow: hidden; 
}
#newsMarquee {
    color: #fff;
    font-size: 15px;
    white-space: nowrap; 
    display: inline-block; 
    padding-right: 100%; 
}

/* newstyle.css (Adições e ajustes para o Read More) */

/* Estilo para cada item individual no modal */
.newsItem {
    margin-bottom: 15px; /* Mais espaço entre notícias */
    padding-bottom: 5px;
    border-bottom: 1px dashed #eee;
}

/* 1. Fonte da Manchete (Link, Negrito, Azul Grifado) */
.newsItem a.headline-link {
    text-decoration: underline; /* Grifado */
    color: #007bff; /* Azul */
    font-weight: bold; /* Negrito */
    display: block; 
    padding: 0;
    margin-bottom: 5px; /* Espaço antes do botão */
}
.newsItem a.headline-link:hover {
    color: #0056b3; 
}

/* 2. Botão READ MORE */
.read-more-btn {
    background: none;
    border: none;
    color: #6c757d; /* Cinza sutil */
    font-size: 0.85em;
    cursor: pointer;
    padding: 2px 0;
    margin-left: 0;
    font-weight: bold;
    text-decoration: none; /* Garante que não é grifado como o link */
    display: inline-block;
}
.read-more-btn:hover {
    color: #495057;
    text-decoration: underline;
}

/* 3. Detalhes da Manchete (Descrição) */
.news-detail {
    display: none; /* Escondido por padrão */
    margin-top: 5px;
    padding: 5px;
    background: #f8f9fa; /* Fundo levemente cinza para destaque */
    border-left: 3px solid #ced4da;
    font-size: 0.9em; /* Ligeiramente menor que o padrão */
    line-height: 1.5;
    color: #343a40; /* Fonte normal */
}
/* Estilo para quando o detalhe está visível */
.news-detail.open {
    display: block;
}

/* ================= MODAL/POPUP (ESTILOS ADICIONADOS) ================= */

/* Overlay - Ocupa a tela inteira, fundo semi-transparente */
.modal-overlay {
    display: none; /* Escondido por padrão */
    position: fixed;
    z-index: 1000; 
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0,0,0,0.5); /* Fundo preto semi-transparente */
    justify-content: center;
    align-items: center;
}
.modal-overlay.active {
    display: flex; /* Exibe o modal quando a classe 'active' é adicionada pelo JS */
}

/* Conteúdo Principal do Modal (A div flutuante) */
.modal-content {
    background-color: #fefefe;
    margin: 15px;
    padding: 0;
    border: 1px solid #888;
    width: 90%; 
    max-width: 600px; /* Limite de largura para desktop */
    border-radius: 8px; /* Cantos arredondados */
    box-shadow: 0 5px 15px rgba(0,0,0,0.3);
    display: flex;
    flex-direction: column;
    max-height: 90vh; /* Limita a altura do modal na tela */
}

/* Cabeçalho do Modal */
.modal-header {
    padding: 15px;
    background-color: #007bff;
    color: white;
    border-top-left-radius: 8px;
    border-top-right-radius: 8px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}
#modalTitle {
    margin: 0;
    font-size: 1.2em;
}

/* Botão Fechar */
.modal-close-btn {
    color: #fff;
    font-size: 28px;
    font-weight: bold;
    background: none;
    border: none;
    cursor: pointer;
    line-height: 1;
    padding: 0 5px;
}
.modal-close-btn:hover,
.modal-close-btn:focus {
    color: #ccc;
    text-decoration: none;
}

/* Corpo do Modal (com Scroll Vertical) */
.modal-body {
    padding: 15px;
    overflow-y: auto; /* Adiciona barra de scroll vertical se necessário */
    flex-grow: 1; 
}


/* newstyle.css (Adições dentro da seção MODAL) */

/* Contêiner para os botões Listen/Stop e Close */
.modal-header .modal-controls {
    display: flex;
    gap: 10px;
    align-items: center;
}

/* Estilo para os botões LISTEN/STOP */
.tts-btn {
    padding: 5px 10px;
    background-color: #ffc107; /* Amarelo/Laranja para destaque */
    color: #343a40;
    border: none;
    border-radius: 4px;
    font-size: 0.9em;
    font-weight: bold;
    cursor: pointer;
    transition: background-color 0.2s;
}

.tts-btn:hover:not(:disabled) {
    background-color: #e0a800;
}

.tts-btn:disabled {
    background-color: #6c757d; /* Cinza quando desabilitado */
    cursor: not-allowed;
    opacity: 0.6;
}

/* Garante que o botão de fechar não fique muito pequeno */
.modal-close-btn {
    /* ... (manter estilos existentes) ... */
}

/* newstyle.css (Adições dentro da seção MODAL) */

/* ... (Estilos Modal e TTS existentes) ... */

/* Estilos do Spinner (Ampulheta Moderna) */
.spinner-container {
    display: none; /* Escondido por padrão */
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 200px; /* Altura para centralizar na área de visualização */
    text-align: center;
    color: #555;
    font-size: 1.1em;
}

/* O spinner em si (um círculo animado) */
.spinner {
    border: 4px solid #f3f3f3; /* Cinza claro */
    border-top: 4px solid #007bff; /* Azul primário */
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
    margin-bottom: 10px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Classe para mostrar o spinner */
.spinner-container.show {
    display: flex;
}

/* ================= RESPONSIVIDADE (DESKTOP/TABLET) ================= */
@media(min-width: 601px) {
    
    /* 1. LIMITAÇÃO DA PÁGINA (60%) */
    #pageContainer {
        width: 60%;
        box-shadow: 0 0 15px rgba(0, 0, 0, 0.1); 
    }

    /* 2. LAYOUT DO CABEÇALHO PARA DESKTOP */
    #mainHeader {
        flex-direction: row; 
        justify-content: space-between; 
        align-items: center; 
    }

    .logoBox {
        text-align: left; 
    }
    .logoBox img {
        margin: 0; 
    }

    .headerControls {
        flex-direction: row; 
        margin-top: 0;
        gap: 15px;
        align-items: center;
    }
    
    .searchBox { 
        gap: 5px;
    }
}