/* ==================== ESTILOS DE TODAS AS FUNCIONALIDADES NOVAS ==================== */

/* Notificações de Favoritos e Compartilhamento */
.favorite-notification,
.share-notification {
    position: fixed;
    bottom: 2rem;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    background: var(--primary-color);
    color: white;
    padding: 1rem 2rem;
    border-radius: 50px;
    box-shadow: var(--shadow-lg);
    z-index: 10001;
    opacity: 0;
    transition: all 0.3s ease;
    font-weight: 600;
}

.favorite-notification.show,
.share-notification.show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

.favorite-notification.remove {
    background: var(--error-color);
}

.favorite-notification.add,
.share-notification.success {
    background: var(--success-color);
}

/* Botão de Favorito */
.favorite-btn {
    background: transparent;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    transition: transform 0.2s;
    padding: 0.5rem;
}

.favorite-btn:hover {
    transform: scale(1.2);
}

.favorite-btn.active {
    animation: heartBeat 0.3s;
}

@keyframes heartBeat {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.3); }
}

/* Contador de Favoritos */
.favorites-count {
    background: var(--error-color);
    color: white;
    border-radius: 50%;
    padding: 0.2rem 0.5rem;
    font-size: 0.75rem;
    font-weight: 700;
    min-width: 20px;
    text-align: center;
}

/* Botões de Compartilhamento */
.share-buttons {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    margin: 1rem 0;
}

.share-btn {
    padding: 0.6rem 1.2rem;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: white;
}

.share-btn.whatsapp { background: #25D366; }
.share-btn.facebook { background: #1877F2; }
.share-btn.twitter { background: #1DA1F2; }
.share-btn.telegram { background: #0088cc; }
.share-btn.copy { background: var(--text-color); }

.share-btn:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow);
}

/* Comentários */
.comments-section {
    margin-top: 2rem;
    padding-top: 2rem;
    border-top: 2px solid var(--border-color);
}

.comment-form {
    margin-bottom: 2rem;
}

.comment-form input,
.comment-form textarea {
    width: 100%;
    padding: 0.8rem;
    margin-bottom: 0.5rem;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    font-family: inherit;
}

.comment-form textarea {
    min-height: 100px;
    resize: vertical;
}

.comment {
    background: var(--bg-color);
    padding: 1rem;
    border-radius: 8px;
    margin-bottom: 1rem;
}

.comment-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 0.5rem;
}

.comment-author {
    color: var(--primary-color);
}

.comment-date {
    color: var(--text-light);
    font-size: 0.85rem;
}

.comment-text {
    line-height: 1.6;
    margin-bottom: 0.5rem;
}

.comment-actions {
    display: flex;
    gap: 0.5rem;
}

.comment-like {
    background: transparent;
    border: 1px solid var(--border-color);
    padding: 0.3rem 0.8rem;
    border-radius: 20px;
    cursor: pointer;
    transition: all 0.3s;
}

.comment-like:hover {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

/* Modo de Leitura */
body.reading-mode {
    background: #f5f5dc;
}

body.reading-mode .navbar,
body.reading-mode .filter-section,
body.reading-mode footer,
body.reading-mode .chatbot-container {
    display: none !important;
}

body.reading-mode .news-modal-body {
    font-size: var(--reading-font-size, 1.2rem);
    line-height: var(--reading-line-height, 1.8);
    max-width: var(--reading-max-width, 800px);
    margin: 0 auto;
}

.reading-mode-controls {
    position: fixed;
    top: 1rem;
    right: 1rem;
    background: var(--white);
    padding: 1rem;
    border-radius: 12px;
    box-shadow: var(--shadow-lg);
    z-index: 10000;
    display: none;
    flex-direction: column;
    gap: 1rem;
}

.reading-controls-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--border-color);
    font-weight: 600;
}

.reading-close {
    background: transparent;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    padding: 0;
}

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

.reading-control-group label {
    font-size: 0.9rem;
    font-weight: 600;
}

.reading-buttons {
    display: flex;
    gap: 0.5rem;
}

.reading-buttons button,
.reading-reset {
    padding: 0.5rem 1rem;
    border: 1px solid var(--border-color);
    background: white;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s;
}

.reading-buttons button:hover,
.reading-reset:hover {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

/* Lightbox */
.lightbox {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.95);
    z-index: 10002;
    justify-content: center;
    align-items: center;
}

.lightbox.active {
    display: flex;
}

.lightbox-image {
    max-width: 90%;
    max-height: 90%;
    object-fit: contain;
}

.lightbox-close,
.lightbox-prev,
.lightbox-next {
    position: absolute;
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    font-size: 2rem;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.3s;
}

.lightbox-close {
    top: 1rem;
    right: 1rem;
}

.lightbox-close:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: rotate(90deg);
}

.lightbox-prev {
    left: 1rem;
}

.lightbox-next {
    right: 1rem;
}

.lightbox-prev:hover,
.lightbox-next:hover {
    background: rgba(255, 255, 255, 0.3);
}

.lightbox-counter {
    position: absolute;
    bottom: 2rem;
    left: 50%;
    transform: translateX(-50%);
    color: white;
    background: rgba(0, 0, 0, 0.7);
    padding: 0.5rem 1rem;
    border-radius: 20px;
}

/* Modo de Alto Contraste */
[data-contrast="high"] {
    --text-color: #000000;
    --bg-color: #ffffff;
    --border-color: #000000;
}

[data-contrast="high"] .news-card {
    border: 2px solid #000000;
}

/* Tamanhos de Fonte de Acessibilidade */
[data-font-size="small"] { font-size: 14px; }
[data-font-size="normal"] { font-size: 16px; }
[data-font-size="large"] { font-size: 18px; }
[data-font-size="xlarge"] { font-size: 20px; }

/* Botões de TTS */
.tts-button {
    padding: 0.6rem 1.2rem;
    border: 1px solid var(--border-color);
    background: white;
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: all 0.3s;
}

.tts-button[data-state="playing"] {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

.tts-button:hover {
    transform: translateY(-2px);
}

/* Timeline */
.timeline-view {
    padding: 2rem 0;
}

.timeline-group {
    margin-bottom: 3rem;
}

.timeline-date {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary-color);
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 3px solid var(--primary-color);
}

.timeline-items {
    display: grid;
    gap: 1rem;
    padding-left: 2rem;
    border-left: 3px solid var(--border-color);
}

/* Notícias Relacionadas */
.related-news {
    margin-top: 2rem;
    padding-top: 2rem;
    border-top: 2px solid var(--border-color);
}

.related-news h3 {
    font-size: 1.5rem;
    margin-bottom: 1rem;
    color: var(--text-color);
}

.related-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1rem;
}

.related-card {
    background: var(--white);
    border-radius: 8px;
    overflow: hidden;
    box-shadow: var(--shadow);
    cursor: pointer;
    transition: all 0.3s;
}

.related-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg);
}

/* Badge de Instalação PWA */
.install-prompt {
    position: fixed;
    bottom: 1rem;
    left: 50%;
    transform: translateX(-50%);
    background: var(--primary-color);
    color: white;
    padding: 1rem 2rem;
    border-radius: 50px;
    box-shadow: var(--shadow-lg);
    z-index: 1000;
    display: none;
    align-items: center;
    gap: 1rem;
}

.install-prompt.show {
    display: flex;
}

.install-prompt button {
    background: white;
    color: var(--primary-color);
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 20px;
    font-weight: 600;
    cursor: pointer;
}

/* ==================== BANNER DE COOKIES ==================== */
.cookie-banner {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: var(--white);
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.1);
    z-index: 10000;
    transform: translateY(100%);
    transition: transform 0.3s ease;
    border-top: 3px solid var(--primary-color);
}

.cookie-banner.show {
    transform: translateY(0);
}

.cookie-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 1.5rem 2rem;
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.cookie-icon {
    font-size: 3rem;
    flex-shrink: 0;
}

.cookie-text {
    flex: 1;
}

.cookie-text h4 {
    margin: 0 0 0.5rem 0;
    font-size: 1.1rem;
    color: var(--text-color);
}

.cookie-text p {
    margin: 0;
    font-size: 0.9rem;
    color: var(--text-light);
    line-height: 1.5;
}

.cookie-text a {
    color: var(--primary-color);
    text-decoration: underline;
    font-weight: 600;
}

.cookie-text a:hover {
    color: var(--secondary-color);
}

.cookie-actions {
    display: flex;
    gap: 0.75rem;
    flex-shrink: 0;
}

.cookie-btn {
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    font-size: 0.95rem;
    cursor: pointer;
    transition: all 0.3s;
    white-space: nowrap;
}

.cookie-btn-primary {
    background: var(--primary-color);
    color: white;
}

.cookie-btn-primary:hover {
    background: var(--secondary-color);
    transform: translateY(-2px);
    box-shadow: var(--shadow);
}

.cookie-btn-secondary {
    background: transparent;
    color: var(--text-color);
    border: 2px solid var(--border-color);
}

.cookie-btn-secondary:hover {
    background: var(--bg-color);
    border-color: var(--text-color);
}

/* ==================== MODAL DE PRIVACIDADE ==================== */
.privacy-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 10001;
}

.privacy-modal.active {
    display: block;
}

.privacy-modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(4px);
}

.privacy-modal-content {
    position: relative;
    background: var(--white);
    max-width: 800px;
    margin: 2rem auto;
    border-radius: 12px;
    max-height: calc(100vh - 4rem);
    overflow-y: auto;
    box-shadow: var(--shadow-lg);
    padding: 2rem;
}

.privacy-modal-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: transparent;
    border: none;
    font-size: 2rem;
    cursor: pointer;
    color: var(--text-light);
    transition: all 0.3s;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
}

.privacy-modal-close:hover {
    background: var(--bg-color);
    color: var(--text-color);
    transform: rotate(90deg);
}

.privacy-modal-content h2 {
    color: var(--text-color);
    margin: 0 0 1.5rem 0;
    padding-bottom: 1rem;
    border-bottom: 2px solid var(--border-color);
}

.privacy-section {
    margin-bottom: 2rem;
}

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

.privacy-section p {
    color: var(--text-color);
    line-height: 1.6;
    margin: 0 0 0.75rem 0;
}

.privacy-section ul {
    margin: 0.5rem 0;
    padding-left: 1.5rem;
}

.privacy-section li {
    margin-bottom: 0.5rem;
    line-height: 1.6;
    color: var(--text-color);
}

.privacy-footer {
    margin-top: 2rem;
    padding-top: 1.5rem;
    border-top: 2px solid var(--border-color);
    text-align: center;
}

.privacy-footer p {
    color: var(--text-light);
    margin-bottom: 1rem;
}

/* Responsivo */
@media (max-width: 768px) {
    .reading-mode-controls {
        left: 1rem;
        right: 1rem;
        width: auto;
    }

    .share-buttons {
        justify-content: center;
    }

    .lightbox-prev,
    .lightbox-next {
        width: 40px;
        height: 40px;
        font-size: 1.5rem;
    }

    .timeline-items {
        padding-left: 1rem;
    }

    .related-grid {
        grid-template-columns: 1fr;
    }

    /* Cookie Banner Responsivo */
    .cookie-content {
        flex-direction: column;
        text-align: center;
        padding: 1rem;
    }

    .cookie-icon {
        font-size: 2rem;
    }

    .cookie-actions {
        width: 100%;
        flex-direction: column;
    }

    .cookie-btn {
        width: 100%;
    }

    /* Privacy Modal Responsivo */
    .privacy-modal-content {
        margin: 1rem;
        padding: 1.5rem;
        max-height: calc(100vh - 2rem);
    }

    .privacy-section ul {
        padding-left: 1rem;
    }
}
