/* Reset y configuración base */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    line-height: 1.6;
    color: #333;
    min-height: 100vh;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Header */
.header {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    padding: 2rem 0;
    text-align: center;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
}

.logo {
    font-size: 2.5rem;
    font-weight: 700;
    color: #667eea;
    margin-bottom: 0.5rem;
}

.logo i {
    margin-right: 0.5rem;
}

.subtitle {
    font-size: 1.1rem;
    color: #666;
    font-weight: 400;
}

/* Main content */

.controls {
    display: flex;
    justify-content: center;
    align-items: center;
    margin-bottom: 3rem;
    gap: 1rem;
}

/* Estilos de botón y loading eliminados - las noticias se actualizan automáticamente */

.update-info {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    color: rgba(255, 255, 255, 0.9);
    font-size: 0.9rem;
    text-align: center;
    background: rgba(255, 255, 255, 0.1);
    padding: 1rem 2rem;
    border-radius: 12px;
    backdrop-filter: blur(10px);
}

.update-info i {
    font-size: 1.2rem;
    margin-bottom: 0.25rem;
    color: rgba(255, 255, 255, 0.8);
}

.update-info span {
    display: block;
    font-size: 0.85rem;
    font-weight: 500;
}

/* Grid de noticias */
.news-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 2rem;
    margin-bottom: 3rem;
    align-items: start;
}

/* Tarjetas de noticias */
.news-card {
    background: white;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
    position: relative;
    display: flex;
    flex-direction: column;
    height: auto;
    min-height: 400px;
    cursor: pointer;
}

.news-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 16px 48px rgba(0, 0, 0, 0.15);
}

.news-card:hover::after {
    content: "Clic para leer más";
    position: absolute;
    top: 10px;
    right: 10px;
    background: rgba(102, 126, 234, 0.9);
    color: white;
    padding: 0.25rem 0.5rem;
    border-radius: 12px;
    font-size: 0.7rem;
    font-weight: 500;
    opacity: 0;
    animation: fadeInTooltip 0.3s ease forwards;
}

.news-card:active {
    transform: translateY(-4px);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.2);
}

@keyframes fadeInTooltip {
    from {
        opacity: 0;
        transform: translateY(-5px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.news-image {
    width: 100%;
    height: 200px;
    object-fit: cover;
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    transition: transform 0.3s ease, opacity 0.3s ease;
    border-radius: 0;
    position: relative;
}

.news-image:not([src]) {
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    display: flex;
    align-items: center;
    justify-content: center;
}

.news-image:not([src])::after {
    content: "📰";
    font-size: 3rem;
    opacity: 0.5;
}

.news-card:hover .news-image {
    transform: scale(1.05);
}

.news-content {
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}

.news-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    gap: 0.5rem;
}

.news-category {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 500;
    flex-shrink: 0;
}

.news-source {
    display: inline-block;
    background: rgba(102, 126, 234, 0.1);
    color: #667eea;
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 500;
    border: 1px solid rgba(102, 126, 234, 0.2);
}

.news-title {
    font-size: 1.25rem;
    font-weight: 600;
    color: #333;
    margin-bottom: 0.75rem;
    line-height: 1.4;
    word-wrap: break-word;
    overflow-wrap: break-word;
    hyphens: auto;
}

.news-description {
    color: #666;
    font-size: 0.95rem;
    line-height: 1.5;
    margin-bottom: 1rem;
    flex-grow: 1;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

.news-meta {
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 0.85rem;
    color: #888;
    margin-top: auto;
    padding-top: 1rem;
}

.news-date {
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

/* Estilos del enlace "Leer más" eliminados - ahora toda la tarjeta es clickeable */

/* Mensaje de error */
.error-message {
    display: none !important; /* Oculto por defecto con !important */
    text-align: center;
    background: rgba(255, 255, 255, 0.95);
    padding: 2rem;
    border-radius: 16px;
    color: #e74c3c;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
}

.error-message.show {
    display: block !important;
}

.error-message i {
    font-size: 2rem;
    margin-bottom: 1rem;
}

.error-message p {
    font-size: 1.1rem;
    font-weight: 500;
}

/* Footer */
.footer {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    padding: 2rem 0;
    text-align: center;
    color: #666;
    margin-top: auto;
}

/* Responsive */
@media (max-width: 768px) {
    .container {
        padding: 0 15px;
    }
    
    .logo {
        font-size: 2rem;
    }
    
    .news-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
    
    
    .controls {
        flex-direction: column;
        gap: 1rem;
    }
}

@media (max-width: 480px) {
    .news-card {
        margin: 0 10px;
        min-height: 350px;
    }
    
    .news-content {
        padding: 1rem;
    }
    
    .news-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }
    
    .news-category {
        font-size: 0.7rem;
        padding: 0.2rem 0.6rem;
    }
    
    .news-source {
        font-size: 0.7rem;
        padding: 0.2rem 0.6rem;
    }
    
    .news-title {
        font-size: 1.1rem;
        line-height: 1.3;
    }
    
    .news-description {
        font-size: 0.9rem;
    }
}

/* Animaciones */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.news-card {
    animation: fadeInUp 0.6s ease forwards;
}

.news-card:nth-child(1) { animation-delay: 0.1s; }
.news-card:nth-child(2) { animation-delay: 0.2s; }
.news-card:nth-child(3) { animation-delay: 0.3s; }
.news-card:nth-child(4) { animation-delay: 0.4s; }
.news-card:nth-child(5) { animation-delay: 0.5s; }
.news-card:nth-child(6) { animation-delay: 0.6s; }
.news-card:nth-child(7) { animation-delay: 0.7s; }
.news-card:nth-child(8) { animation-delay: 0.8s; }
.news-card:nth-child(9) { animation-delay: 0.9s; }
.news-card:nth-child(10) { animation-delay: 1.0s; }
