//* --- Reseteo Básico y Estilos Globales --- */
body {
    font-family: 'Roboto', sans-serif;
    background-color: #f4f7f6;
    color: #333;
    margin: 0;
    padding: 20px;
    display: flex;
    justify-content: center;
    align-items: flex-start;
    min-height: 100vh;
}

.container {
    width: 100%;
    max-width: 500px; /* Ancho máximo para vista de celular */
    background-color: white;
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    padding: 25px;
    box-sizing: border-box;
}

/* --- Encabezado --- */
header {
    text-align: center;
    border-bottom: 1px solid #eee;
    padding-bottom: 20px;
    margin-bottom: 20px;
}

header h1 {
    font-size: 2.5em;
    color: #6a4c9c; /* Tono morado del diseño */
    margin: 0;
}

header p {
    color: #777;
    margin-top: 5px;
}

/* --- Formulario de Búsqueda --- */
.search-form h2 {
    font-size: 1.2em;
    font-weight: 500;
    margin-bottom: 15px;
}

.categories {
    display: grid;
    grid-template-columns: 1fr 1fr; /* Dos columnas */
    gap: 15px; /* Espacio entre los botones */
    margin-bottom: 20px;
}

.category-btn {
    border: 1px solid #ddd;
    background-color: #f9f9f9;
    border-radius: 8px;
    padding: 20px 10px;
    font-size: 1.1em;
    cursor: pointer;
    transition: all 0.2s ease-in-out;
    text-align: center;
}

.category-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.08);
}

/* Colores de las categorías como en tu imagen */
.category-btn[data-category="Politica"] { background-color: #ffebee; border-color: #ffcdd2; }
.category-btn[data-category="Economia"] { background-color: #e8f5e9; border-color: #c8e6c9; }
.category-btn[data-category="Cultura"] { background-color: #fffde7; border-color: #fff9c4; }
.category-btn[data-category="Ciencia"] { background-color: #e3f2fd; border-color: #bbdefb; }

/* Estilo para el botón de categoría seleccionado */
.category-btn.selected {
    border-width: 2px;
    border-color: #6a4c9c;
    box-shadow: 0 0 10px rgba(106, 76, 156, 0.3);
}

.keywords {
    margin-bottom: 20px;
}

.keywords label {
    display: block;
    font-weight: 500;
    margin-bottom: 8px;
}

#keywords-input {
    width: 100%;
    padding: 12px;
    border: 1px solid #ccc;
    border-radius: 6px;
    font-size: 1em;
    box-sizing: border-box;
}

#search-btn {
    width: 100%;
    padding: 15px;
    border: none;
    border-radius: 8px;
    font-size: 1.2em;
    font-weight: 700;
    color: white;
    background-image: linear-gradient(to right, #6a4c9c, #8e6ac5);
    cursor: pointer;
    transition: background-color 0.2s;
}

#search-btn:disabled {
    background-image: none;
    background-color: #ccc;
    cursor: not-allowed;
}

/* --- Sección de Resultados --- */
.results {
    margin-top: 30px;
}

/* Loader (animación de "Buscando...") */
#loader {
    text-align: center;
    padding: 20px;
}
.spinner {
    border: 4px solid rgba(0, 0, 0, 0.1);
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border-left-color: #6a4c9c;
    animation: spin 1s ease infinite;
    margin: 0 auto 10px;
}
@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Clase para ocultar elementos */
.hidden {
    display: none;
}

/* Estilo para las tarjetas de noticias que aparecerán */
.news-card {
    background-color: #fff;
    border: 1px solid #eee;
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 15px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

.news-card h3 {
    margin: 0 0 10px 0;
    font-size: 1.2em;
}

.news-card p {
    margin: 0 0 15px 0;
    color: #555;
    font-size: 0.95em;
}

.news-card .meta {
    font-size: 0.85em;
    color: #888;
    margin-bottom: 15px;
}

.news-card .read-more {
    display: inline-block;
    text-decoration: none;
    color: white;
    background-color: #8e6ac5;
    padding: 8px 12px;
    border-radius: 5px;
    font-weight: 500;
    transition: background-color 0.2s;
}

.news-card .read-more:hover {
    background-color: #6a4c9c;
}

/* --- ¡NUEVO ESTILO PARA EL BOTÓN DE CARGAR MÁS! --- */
#load-more-btn {
    width: 100%;
    padding: 15px;
    margin-top: 20px;
    border: 2px solid #6a4c9c;
    background-color: transparent;
    color: #6a4c9c;
    border-radius: 8px;
    font-size: 1.1em;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s;
}

#load-more-btn:hover {
    background-color: #6a4c9c;
    color: white;
}