/* ============================================
   Widget de Clasificación de Noticias por Fecha
   VERSIÓN LISTA SIMPLE - Similar al ejemplo proporcionado
   ============================================ */

/* === Date Widget Container === */
.date-archive-widget {
    background: #d4e6f1;
    padding: 0;
    border-radius: 8px;
    box-shadow: var(--shadow);
    margin-bottom: 2rem;
    overflow: hidden;
}

.date-archive-widget h3 {
    font-size: 1rem;
    margin: 0;
    margin-bottom: 0 !important;  /* Sin margen inferior */
    padding: 1rem 1.2rem;  /* Aumentado de 0.75rem 1rem a 1rem 1.2rem */
    color: white;
    background: linear-gradient(135deg, #4a90a4 0%, #3a7d91 100%);
    border: none;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 600;
    text-align: left;
}

/* ============================================
   CONTENEDOR PRINCIPAL - CON PADDING PROFESIONAL
   ============================================ */

#date-archive-container {
    padding: 1.2rem !important;  /* Padding aumentado en todos los lados */
    margin: 0 !important;
    background: white !important;  /* Fondo blanco */
}

#date-archive-container > * {
    margin-top: 0 !important;
}

/* Primera div sin margin superior */
#date-archive-container > div:first-child {
    margin-top: 0 !important;
}

/* Primer botón sin margin superior */
#date-archive-container > div:first-child > button:first-child {
    margin-top: 0 !important;
}

#date-archive-container > div:last-child {
    margin-bottom: 0;
}

/* Cuando está cargando, permitir el fondo blanco */
#date-archive-container.archive-loading {
    background: white !important;
    padding: 2rem 1rem !important;
}

/* === Archive List === */
.archive-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

/* === Year Items === */
.archive-year {
    margin: 0;
    border-bottom: 1px solid #b8d4e3;
}

.archive-year:last-child {
    border-bottom: none;
}

.year-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.625rem 1rem;
    background: #e8f4f8;
    cursor: pointer;
    transition: background 0.2s ease;
    font-size: 0.9rem;
    font-weight: 600;
    color: #2c5f6f;
    text-align: left;
}

.year-header:hover {
    background: #d0e7f2;
}

.year-header.active {
    background: #c0dff0;
}

.year-toggle {
    font-size: 0.7rem;
    width: 12px;
    text-align: left;
    transition: transform 0.3s ease;
    color: #4a90a4;
}

.year-label {
    flex: 1;
    font-weight: 700;
    text-align: left;
}

.year-count {
    font-size: 0.75rem;
    color: #5a7d8a;
    font-weight: 400;
    text-align: left;
}

/* === Month Container === */
.month-container {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease-out;
    background: white;
}

.month-container.active {
    max-height: 5000px;
    transition: max-height 0.5s ease-in;
}

.month-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

/* === Month Items === */
.archive-month {
    margin: 0;
    border-top: 1px solid #e8f0f4;
}

.month-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.2rem !important;
    cursor: pointer;
    transition: background 0.2s ease;
    font-size: 0.85rem;
    font-weight: 600;
    color: #34495e;
    background: #f8fbfc;
    text-align: left;
}

.month-header:hover {
    background: #e8f4f8;
}

.month-header.active {
    background: #dceef6;
}

.month-toggle {
    font-size: 0.65rem;
    width: 10px;
    text-align: left;
    transition: transform 0.3s ease;
    color: #4a90a4;
}

.month-label {
    flex: 1;
    font-weight: 600;
    text-align: left;
}

.month-count {
    font-size: 0.7rem;
    color: #7f8c8d;
    font-weight: 400;
    text-align: left;
}

/* === Article List === */
.article-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: none; /* Oculto por defecto */
    background: white;
}

.month-header.active + .article-list {
    display: block; /* Mostrar cuando el mes está activo */
}

.article-item {
    margin: 0;
    padding: 0;
}

.article-item a {
    display: block;
    padding: 0.4rem 1rem 0.4rem 3rem;
    color: #2980b9;
    text-decoration: none;
    font-size: 0.8rem;
    line-height: 1.4;
    transition: all 0.2s ease;
    border-left: 2px solid transparent;
    text-align: left;
}

.article-item a:hover {
    background: #e8f4f8;
    color: #1a5f7a;
    padding-left: 3.25rem;
    border-left-color: #3498db;
}

.article-item a:visited {
    color: #8e44ad;
}

/* === Total Stats === */
.archive-stats {
    margin: 0;
    padding: 0.75rem 1rem;
    border-top: 1px solid #b8d4e3;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.75rem;
    color: #5a7d8a;
    background: #e8f4f8;
    text-align: left;
}

.stat-total {
    font-weight: 600;
}

.stat-number {
    color: #2c5f6f;
    font-weight: 700;
}

/* === Empty State === */
.archive-empty {
    text-align: left;
    padding: 2rem 1rem;
    color: #7f8c8d;
    font-size: 0.875rem;
    background: white;
}

.archive-empty .icon {
    font-size: 2rem;
    margin-bottom: 0.5rem;
    opacity: 0.5;
}

/* === Loading State === */
.archive-loading {
    text-align: left;
    padding: 2rem 1rem;
    color: #7f8c8d;
    background: white;
}

.archive-loading .spinner {
    width: 30px;
    height: 30px;
    border: 3px solid #e8f4f8;
    border-top: 3px solid #4a90a4;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 0 1rem 0;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* === Responsive === */
@media (max-width: 768px) {
    .date-archive-widget h3 {
        font-size: 0.9rem;
        padding: 0.625rem 0.75rem;
    }
    
    .year-header {
        padding: 0.5rem 0.75rem;
        font-size: 0.85rem;
    }
    
    .month-header {
        padding: 0.4rem 0.75rem 0.4rem 1.5rem;
        font-size: 0.8rem;
    }
    
    .article-item a {
        padding: 0.35rem 0.75rem 0.35rem 2.5rem;
        font-size: 0.75rem;
    }
    
    .article-item a:hover {
        padding-left: 2.75rem;
    }
}

/* === Dark Mode === */
@media (prefers-color-scheme: dark) {
    .date-archive-widget {
        background: #2c3e50;
    }
    
    .date-archive-widget h3 {
        background: linear-gradient(135deg, #34495e 0%, #2c3e50 100%);
    }
    
    .year-header {
        background: #34495e;
        color: #ecf0f1;
    }
    
    .year-header:hover,
    .year-header.active {
        background: #3a5169;
    }
    
    .month-container {
        background: #2c3e50;
    }
    
    .month-header {
        background: #2c3e50;
        color: #ecf0f1;
        border-top-color: #34495e;
    }
    
    .month-header:hover,
    .month-header.active {
        background: #34495e;
    }
    
    .article-list {
        background: #2c3e50;
    }
    
    .article-item a {
        color: #5dade2;
    }
    
    .article-item a:hover {
        background: #34495e;
        color: #85c1e9;
    }
    
    .article-item a:visited {
        color: #bb8fce;
    }
    
    .archive-stats {
        background: #34495e;
        border-top-color: #2c3e50;
        color: #bdc3c7;
    }
    
    .stat-number {
        color: #ecf0f1;
    }
    
    .archive-empty,
    .archive-loading {
        background: #2c3e50;
        color: #bdc3c7;
    }
}

/* === Smooth Transitions === */
.year-header,
.month-header,
.article-item a {
    transition: all 0.2s ease;
}

/* === Accessibility === */
.year-header:focus,
.month-header:focus,
.article-item a:focus {
    outline: 2px solid #3498db;
    outline-offset: -2px;
}

/* === Print Styles === */
@media print {
    .date-archive-widget {
        box-shadow: none;
    }
    
    .year-header,
    .month-header {
        cursor: default;
    }
    
    .month-container,
    .article-list {
        max-height: none !important;
    }
    
    .year-header.active,
    .month-header.active {
        background: transparent;
    }
}

/* ============================================
   ARTÍCULO DESTACADO EN ÁREA PRINCIPAL
   ============================================ */

.featured-article-summary {
    background: linear-gradient(135deg, #ffffff 0%, #f8f9fa 100%);
    border: 3px solid #3498db;
    border-radius: 12px;
    overflow: hidden;
    margin-bottom: 2rem;
    box-shadow: 0 8px 24px rgba(52, 152, 219, 0.25);
    animation: slideDown 0.4s ease-out;
    grid-column: 1 / -1;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeOut {
    from {
        opacity: 1;
        transform: scale(1);
    }
    to {
        opacity: 0;
        transform: scale(0.95);
    }
}

.featured-header {
    background: linear-gradient(135deg, #3498db 0%, #2980b9 100%);
    padding: 1.25rem 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
}

.featured-title-section {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.featured-icon {
    font-size: 1.5rem;
    animation: pulse 2s ease-in-out infinite;
}

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

.featured-header h2 {
    font-size: 1.25rem;
    color: white;
    margin: 0;
    font-weight: 700;
    text-align: left;
}

.featured-close {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    padding: 0.625rem 1.25rem;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.95rem;
    font-weight: 600;
    transition: all 0.3s ease;
    white-space: nowrap;
}

.featured-close:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: translateX(3px);
}

.featured-content {
    padding: 2rem;
}

.featured-main-title {
    font-size: 1.75rem;
    font-weight: 700;
    color: #2c3e50;
    margin-bottom: 1rem;
    line-height: 1.4;
    text-align: left;
    border-left: 5px solid #3498db;
    padding-left: 1.5rem;
}

/* Badge de Traducción */
.translation-badge {
    display: inline-block;
    background: linear-gradient(135deg, #27ae60 0%, #229954 100%);
    color: white;
    padding: 0.5rem 1rem;
    border-radius: 6px;
    font-size: 0.85rem;
    font-weight: 600;
    margin-bottom: 1.5rem;
}

/* Imagen de la Noticia */
.featured-image {
    margin: 1.5rem 0;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
    background: #f8f9fa;
}

.featured-image img {
    width: 100%;
    height: auto;
    max-height: 500px;
    object-fit: cover;
    display: block;
    transition: transform 0.3s ease;
}

.featured-image img:hover {
    transform: scale(1.02);
}

/* Meta Grid */
.featured-meta-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.meta-box {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    padding: 1rem;
    background: #f8f9fa;
    border-radius: 8px;
    border-left: 3px solid #3498db;
}

.meta-icon {
    font-size: 1.25rem;
    flex-shrink: 0;
}

.meta-info {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.meta-label {
    font-size: 0.8rem;
    font-weight: 600;
    color: #7f8c8d;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.meta-value {
    font-size: 0.95rem;
    color: #34495e;
    font-weight: 600;
}

.meta-link {
    color: #3498db;
    text-decoration: none;
    transition: all 0.3s ease;
}

.meta-link:hover {
    color: #2980b9;
    text-decoration: underline;
}

/* Sección de Tags */
.tags-section {
    background: white;
    border: 2px solid #e8f0f4;
    border-radius: 8px;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
}

.tag-group {
    margin-bottom: 1.25rem;
}

.tag-group:last-child {
    margin-bottom: 0;
}

.tag-group h4 {
    font-size: 1rem;
    color: #2c3e50;
    margin-bottom: 0.75rem;
    text-align: left;
    font-weight: 700;
}

.tags-container {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

/* Tags de Impacto */
.impact-tag {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0.5rem 1rem;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
    color: white;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
    transition: all 0.3s ease;
}

.impact-tag:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

/* Tags de Categoría */
.category-tag {
    display: inline-block;
    padding: 0.5rem 1rem;
    background: linear-gradient(135deg, #3498db 0%, #2980b9 100%);
    color: white;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
    box-shadow: 0 2px 6px rgba(52, 152, 219, 0.3);
    transition: all 0.3s ease;
}

.category-tag:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(52, 152, 219, 0.4);
}

/* Tag de Tipo de Fuente */
.source-type-tag {
    display: inline-block;
    padding: 0.5rem 1rem;
    background: linear-gradient(135deg, #9b59b6 0%, #8e44ad 100%);
    color: white;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
    box-shadow: 0 2px 6px rgba(155, 89, 182, 0.3);
    transition: all 0.3s ease;
}

.source-type-tag:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(155, 89, 182, 0.4);
}

/* Descripción Completa */
.featured-description-full {
    margin-bottom: 2rem;
}

.featured-description-full h4 {
    font-size: 1.1rem;
    color: #2c3e50;
    margin-bottom: 1rem;
    text-align: left;
    font-weight: 700;
}

.description-text {
    font-size: 1rem;
    line-height: 1.8;
    color: #34495e;
    text-align: left;
    background: white;
    padding: 1.5rem;
    border-radius: 8px;
    border-left: 4px solid #3498db;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    max-height: 500px;
    overflow-y: auto;
}

.description-text::-webkit-scrollbar {
    width: 8px;
}

.description-text::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

.description-text::-webkit-scrollbar-thumb {
    background: #3498db;
    border-radius: 4px;
}

.description-text::-webkit-scrollbar-thumb:hover {
    background: #2980b9;
}

/* Spinner de Carga */
.loading-content {
    text-align: center;
    padding: 3rem 2rem;
}

.spinner-large {
    width: 60px;
    height: 60px;
    border: 5px solid #e8f0f4;
    border-top: 5px solid #3498db;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 1.5rem;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.loading-content p {
    font-size: 1rem;
    color: #7f8c8d;
    font-weight: 500;
}

/* Acciones */
.featured-actions {
    text-align: center;
    padding-top: 1.5rem;
    border-top: 2px solid #e8f0f4;
}

.featured-btn {
    display: inline-block;
    background: linear-gradient(135deg, #3498db 0%, #2980b9 100%);
    color: white;
    padding: 1rem 2.5rem;
    border-radius: 10px;
    text-decoration: none;
    font-size: 1.05rem;
    font-weight: 700;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(52, 152, 219, 0.3);
}

.featured-btn:hover {
    background: linear-gradient(135deg, #2980b9 0%, #21618c 100%);
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(52, 152, 219, 0.4);
}

/* === Dark Mode === */
@media (prefers-color-scheme: dark) {
    .featured-article-summary {
        background: linear-gradient(135deg, #2c3e50 0%, #34495e 100%);
        border-color: #3498db;
    }
    
    .featured-main-title {
        color: #ecf0f1;
    }
    
    .meta-box {
        background: #34495e;
        border-left-color: #3498db;
    }
    
    .meta-value {
        color: #ecf0f1;
    }
    
    .tags-section {
        background: #2c3e50;
        border-color: #34495e;
    }
    
    .tag-group h4 {
        color: #ecf0f1;
    }
    
    .featured-description-full h4 {
        color: #ecf0f1;
    }
    
    .description-text {
        background: #34495e;
        color: #bdc3c7;
    }
    
    .loading-content p {
        color: #bdc3c7;
    }
}

/* === Responsive === */
@media (max-width: 968px) {
    .featured-header {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .featured-close {
        width: 100%;
        text-align: center;
    }
    
    .featured-content {
        padding: 1.5rem;
    }
    
    .featured-main-title {
        font-size: 1.4rem;
        padding-left: 1rem;
    }
    
    .featured-meta-grid {
        grid-template-columns: 1fr;
    }
    
    .description-text {
        font-size: 0.95rem;
        padding: 1rem;
    }
    
    .featured-btn {
        width: 100%;
        padding: 0.875rem 1.5rem;
    }
}

@media (max-width: 768px) {
    .featured-header h2 {
        font-size: 1.1rem;
    }
    
    .featured-main-title {
        font-size: 1.25rem;
    }
    
    .tags-section {
        padding: 1rem;
    }
    
    .description-text {
        font-size: 0.9rem;
        max-height: 400px;
    }
    
    .featured-btn {
        font-size: 0.95rem;
    }
}