/* --- Importación de Fuentes de Google --- */
@import url('https://fonts.googleapis.com/css2?family=Lora:ital,wght@0,400..700;1,400..700&family=Nunito+Sans:ital,opsz,wght@0,6..12,200..1000;1,6..12,200..1000&display=swap');

/* --- Variables Globales de Diseño (Colores y Fuentes) --- */
:root {
    --primary-color: #2c3e50;
    --accent-color: #e8642d;
    --light-text-color: #7f8c8d;
    --bg-color: #FDFCF9;
    --border-color: #ecf0f1;
    --card-bg-color: #ffffff;
    --error-color: #c0392b;
    --success-color: #27ae60;
    --font-headings: 'Lora', serif;
    --font-body: 'Nunito Sans', sans-serif;
    --box-shadow: 0 4px 15px rgba(0, 0, 0, 0.07);
    --border-radius: 12px;
}

/* --- Estilos Generales y Reseteo Básico --- */
*, *::before, *::after {
    box-sizing: border-box;
}

body {
    font-family: var(--font-body);
    font-size: 16px;
    line-height: 1.7;
    background-color: var(--bg-color);
    color: var(--primary-color);
    margin: 0;
    padding: 20px;
    display: flex;
    justify-content: center;
    align-items: flex-start;
    min-height: 100vh;
}

/* --- Estructura Principal y Contenedor --- */
.container {
    width: 100%;
    max-width: 800px;
    padding: 20px 0;
}

header {
    text-align: center;
    margin-bottom: 40px;
}

header .logo-container img {
    max-height: 80px;
    width: auto;
    margin-bottom: 10px;
}

header p {
    font-size: 1.1em;
    color: var(--light-text-color);
    margin-top: -5px;
}

main {
    width: 100%;
}

footer {
    text-align: center;
    margin-top: 50px;
    padding-top: 20px;
    border-top: 1px solid var(--border-color);
    font-size: 0.9em;
    color: var(--light-text-color);
}

footer a {
    color: var(--light-text-color);
    text-decoration: none;
    transition: color 0.3s ease;
}

footer a:hover {
    color: var(--accent-color);
    text-decoration: underline;
}

/* --- Tipografía --- */
h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-headings);
    color: var(--primary-color);
    margin-top: 0;
    margin-bottom: 0.75em;
    line-height: 1.3;
}

h1 { font-size: 2.5em; }
h2 { font-size: 2em; }
h3 { font-size: 1.5em; }

p {
    margin-top: 0;
    margin-bottom: 1em;
}

.subtitle {
    font-size: 1.2em;
    color: var(--light-text-color);
    margin-top: -15px;
    margin-bottom: 30px;
}

/* --- Estilo de la Tarjeta Principal --- */
.card {
    background-color: var(--card-bg-color);
    border-radius: var(--border-radius);
    padding: 30px 40px;
    box-shadow: var(--box-shadow);
    border: 1px solid var(--border-color);
}

/* --- Estilos de Formularios --- */
.form-group {
    margin-bottom: 25px;
}

label {
    display: block;
    font-weight: 600;
    margin-bottom: 8px;
    font-size: 1em;
}

label i {
    margin-right: 8px;
    color: var(--accent-color);
}

input[type="text"],
input[type="email"],
textarea,
select {
    width: 100%;
    padding: 14px 18px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    font-family: var(--font-body);
    font-size: 1em;
    background-color: #f8f9fa;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

input:focus, textarea:focus, select:focus {
    outline: none;
    border-color: var(--accent-color);
    box-shadow: 0 0 0 3px rgba(232, 100, 45, 0.15);
}

textarea {
    resize: vertical;
    min-height: 100px;
}

.char-counter {
    display: block;
    text-align: right;
    font-size: 0.85em;
    color: var(--light-text-color);
    margin-top: 5px;
}

.submit-btn {
    display: block;
    width: 100%;
    padding: 15px 20px;
    font-family: var(--font-body);
    font-size: 1.1em;
    font-weight: 700;
    color: #fff;
    background-color: var(--accent-color);
    border: none;
    border-radius: 8px;
    cursor: pointer;
    text-align: center;
    transition: background-color 0.3s ease, transform 0.2s ease;
}

.submit-btn:hover {
    background-color: #d15420;
    transform: translateY(-2px);
}

/* ================================================================
   ESTILOS ESPECÍFICOS PARA LA PÁGINA DE RESULTADOS (result.php)
================================================================
*/

/* --- Bloque de Recomendación de Libros --- */
.book-recommendation { 
    border: 1px solid var(--border-color); 
    border-radius: 8px; 
    padding: 20px 25px; 
    margin-top: 25px; 
    background: #fff; 
    box-shadow: 0 2px 4px rgba(0,0,0,0.05); 
}

.book-title-link { 
    text-decoration: none; 
}

.book-title-link:hover h4 { 
    color: var(--accent-color); 
}

.book-recommendation h4 { 
    margin-top: 0; 
    color: var(--primary-color); 
    transition: color 0.2s ease-in-out; 
    font-size: 1.4em; 
}

.author { 
    font-style: italic; 
    color: var(--light-text-color); 
    margin-top: -10px; 
    margin-bottom: 15px; 
}

.author a { 
    color: var(--light-text-color); 
    text-decoration: none; 
    border-bottom: 1px dotted var(--light-text-color);
}

.author a:hover { 
    color: var(--primary-color); 
    border-bottom: 1px solid var(--primary-color); 
}

.synopsis { 
    line-height: 1.7; 
    font-size: 0.95em; 
}

.amazon-btn { 
    background-color: #ff9900; 
    display: inline-block; 
    margin-top: 15px; 
    text-decoration: none; 
    color: white !important; 
    padding: 10px 20px; 
    font-size: 1em; 
    border-radius: 6px; 
}
.amazon-btn:hover {
    background-color: #e68a00;
}


/* --- Enlace para Nueva Búsqueda --- */
.new-search-link { 
    text-align: center; 
    margin-top: 40px; 
}

.new-search-link a { 
    color: var(--accent-color); 
    text-decoration: none; 
    font-weight: 600; 
}

.new-search-link a:hover { 
    text-decoration: underline; 
}

/* --- Mensaje de Error --- */
.error-message { 
    padding: 10px 15px; 
    background-color: #fff5f5; 
    border: 1px solid #feb2b2; 
    border-radius: 8px; 
    color: #c53030; 
}

/* --- Banners de Afiliados --- */
.affiliate-banners { 
    display: grid; 
    grid-template-columns: 1fr; 
    gap: 20px; 
    margin-top: 40px; 
}

.banner-card { 
    border-radius: 10px; 
    padding: 25px; 
    display: flex; 
    flex-direction: column; 
    justify-content: space-between; 
    text-align: center; 
    transition: transform 0.3s ease, box-shadow 0.3s ease; 
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}

.banner-card:hover { 
    transform: translateY(-5px); 
    box-shadow: 0 8px 20px rgba(0,0,0,0.15); 
}

.banner-card.audible { 
    background: #fff; 
    color: #111; 
    border: 1px solid var(--border-color);
}

.audible-logo { 
    max-width: 190px; /* Aumentado de tamaño */
    width: auto; 
    margin-bottom: 15px; 
}

.banner-card.kindle { 
    background: linear-gradient(135deg, #1e3c40, #102a2d);
    color: white;
}

.kindle-unlimited-logo { 
    max-width: 180px; 
    margin-bottom: 15px;
    /* El logo SVG ya es blanco, no necesita filtro */
}

.banner-text { 
    font-size: 0.95em; 
    line-height: 1.5; 
    margin-top: 0; 
    margin-bottom: 20px; 
    flex-grow: 1; 
}

.banner-cta { 
    padding: 12px 20px; 
    border-radius: 50px; 
    font-weight: bold; 
    text-decoration: none; 
    display: inline-block; 
    transition: all 0.2s ease-in-out; 
    border: 1px solid transparent; 
}

.banner-card.audible .banner-cta { 
    background-color: #f79900; 
    color: #111; 
}

.banner-card.audible .banner-cta:hover { 
    background-color: #e68a00; 
}

.banner-card.kindle .banner-cta { 
    background-color: #f79900; 
    color: #111; 
}

.banner-card.kindle .banner-cta:hover { 
    background-color: #ffac33; 
}


/* --- Media Queries para Responsividad --- */
@media (max-width: 768px) {
    body {
        padding: 10px;
    }
    .card {
        padding: 25px 20px;
    }
    h1 {
        font-size: 2em;
    }
    .subtitle {
        font-size: 1.1em;
    }
}

@media (min-width: 768px) { 
    .affiliate-banners { 
        grid-template-columns: 1fr 1fr; 
    } 
}