/**
 * Estilos para Notícias do Mercado e Calendário Econômico em Tempo Real
 * MoedaReal - Sistema de conversão de moedas
 */

/* Estilos para Notícias do Mercado em Tempo Real */
.news-item.updated {
    animation: highlight-update 1.5s ease;
}

.news-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.news-category {
    font-size: 0.75rem;
    font-weight: 600;
    padding: 3px 8px;
    border-radius: 4px;
    text-transform: uppercase;
}

.category-stocks {
    background-color: #e3f2fd;
    color: #0d47a1;
}

.category-forex {
    background-color: #e8f5e9;
    color: #1b5e20;
}

.category-crypto {
    background-color: #fff8e1;
    color: #ff6f00;
}

.category-commodities {
    background-color: #ffebee;
    color: #b71c1c;
}

.category-economy {
    background-color: #e8eaf6;
    color: #303f9f;
}

.category-general {
    background-color: #f5f5f5;
    color: #424242;
}

.news-time {
    font-size: 0.75rem;
    color: #6c757d;
}

.news-title {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 8px;
    line-height: 1.4;
    color: #212529;
}

.news-summary {
    font-size: 0.875rem;
    color: #495057;
    margin-bottom: 10px;
    line-height: 1.5;
}

.news-link {
    display: inline-flex;
    align-items: center;
    font-size: 0.8125rem;
    font-weight: 600;
    color: #007bff;
    text-decoration: none;
}

.news-link i {
    margin-left: 5px;
    font-size: 0.75rem;
}

.news-link:hover {
    text-decoration: underline;
}

.news-placeholder, .news-error, .news-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px 20px;
    text-align: center;
    color: #6c757d;
}

.news-placeholder i, .news-error i, .news-empty i {
    font-size: 2.5rem;
    margin-bottom: 15px;
    color: #adb5bd;
}

.news-error i {
    color: #dc3545;
}

/* Estilos para Calendário Econômico em Tempo Real */
.calendar-header {
    display: grid;
    grid-template-columns: 0.6fr 0.6fr 2fr 0.8fr 0.8fr 0.8fr 0.8fr;
    background-color: #f8f9fa;
    padding: 10px 15px;
    font-weight: 600;
    font-size: 0.8125rem;
    color: #495057;
    border-bottom: 1px solid #e9ecef;
}

.calendar-event {
    display: grid;
    grid-template-columns: 0.6fr 0.6fr 2fr 0.8fr 0.8fr 0.8fr 0.8fr;
    padding: 12px 15px;
    font-size: 0.875rem;
    border-bottom: 1px solid #f0f0f0;
    transition: background-color 0.2s ease;
}

.calendar-event:last-child {
    border-bottom: none;
}

.calendar-event:hover {
    background-color: #f8f9fa;
}

.calendar-event.updated {
    animation: highlight-update 1.5s ease;
}

.event-time, .event-country, .event-name, .event-impact, .event-actual, .event-forecast, .event-previous {
    display: flex;
    align-items: center;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.event-country img {
    width: 20px;
    height: 15px;
    object-fit: cover;
    border-radius: 2px;
    margin-right: 5px;
}

.event-impact {
    display: flex;
    align-items: center;
}

.impact-indicator {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    margin-right: 5px;
}

.impact-high {
    background-color: #dc3545;
}

.impact-medium {
    background-color: #ffc107;
}

.impact-low {
    background-color: #28a745;
}

.impact-text {
    font-size: 0.75rem;
    text-transform: capitalize;
}

.value-better {
    color: #28a745;
    font-weight: 600;
}

.value-worse {
    color: #dc3545;
    font-weight: 600;
}

.value-neutral {
    color: #6c757d;
}

.calendar-placeholder, .calendar-error, .calendar-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px 20px;
    text-align: center;
    color: #6c757d;
}

.calendar-placeholder i, .calendar-error i, .calendar-empty i {
    font-size: 2.5rem;
    margin-bottom: 15px;
    color: #adb5bd;
}

.calendar-error i {
    color: #dc3545;
}

/* Animação de atualização */
@keyframes highlight-update {
    0% {
        background-color: rgba(52, 152, 219, 0.2);
    }
    100% {
        background-color: transparent;
    }
}

/* Responsividade para dispositivos móveis */
@media (max-width: 768px) {
    .calendar-header, .calendar-event {
        grid-template-columns: 0.7fr 0.7fr 2fr 0.8fr;
    }
    
    .event-forecast, .event-previous {
        display: none;
    }
    
    .calendar-filters {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .date-selector {
        margin-top: 10px;
    }
    
    .news-tabs {
        padding-bottom: 10px;
    }
    
    .news-tab {
        padding: 5px 10px;
        font-size: 0.8125rem;
    }
}

@media (max-width: 576px) {
    .calendar-header, .calendar-event {
        grid-template-columns: 0.8fr 0.8fr 2.4fr;
    }
    
    .event-impact, .event-actual {
        display: none;
    }
    
    .news-meta {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .news-time {
        margin-top: 5px;
    }
}

/* Tema escuro */
@media (prefers-color-scheme: dark) {
    .news-category {
        opacity: 0.9;
    }
    
    .news-title {
        color: #e9ecef;
    }
    
    .news-summary {
        color: #ced4da;
    }
    
    .calendar-header {
        background-color: #343a40;
        color: #e9ecef;
        border-bottom-color: #495057;
    }
    
    .calendar-event:hover {
        background-color: #343a40;
    }
    
    .impact-text {
        color: #ced4da;
    }
    
    .value-neutral {
        color: #adb5bd;
    }
    
    @keyframes highlight-update {
        0% {
            background-color: rgba(52, 152, 219, 0.3);
        }
        100% {
            background-color: transparent;
        }
    }
}