/* ===== ESTILOS PARA RECOMENDACIONES ===== */

/* Hero Section de Recomendaciones */
.recommendations-hero {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    padding: 100px 0 80px;
    position: relative;
    overflow: hidden;
}

.recommendations-hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><defs><pattern id="grain" width="100" height="100" patternUnits="userSpaceOnUse"><circle cx="50" cy="50" r="1" fill="rgba(255,255,255,0.1)"/></pattern></defs><rect width="100" height="100" fill="url(%23grain)"/></svg>');
    opacity: 0.3;
}

.recommendations-hero .hero-stats {
    position: relative;
    z-index: 2;
}

.recommendations-hero .stat-item {
    padding: 20px;
    border-radius: 15px;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    transition: all 0.3s ease;
}

.recommendations-hero .stat-item:hover {
    transform: translateY(-5px);
    background: rgba(255, 255, 255, 0.2);
}

/* Formulario de Recomendaciones */
.category-check {
    padding: 15px;
    border: 2px solid #e9ecef;
    border-radius: 10px;
    transition: all 0.3s ease;
    cursor: pointer;
}

.category-check:hover {
    border-color: #667eea;
    background-color: #f8f9ff;
}

.category-check input[type="checkbox"]:checked + label {
    color: #667eea;
    font-weight: 600;
}

.category-check input[type="checkbox"]:checked {
    background-color: #667eea;
    border-color: #667eea;
}

/* Estilos para lista de categorías elegante */
.categories-list-container {
    background: #f8f9fa;
    border-radius: 15px;
    padding: 25px;
    border: 1px solid #e9ecef;
}

.category-list-item {
    background: white;
    border: 2px solid #e9ecef;
    border-radius: 12px;
    transition: all 0.3s ease;
    overflow: hidden;
    position: relative;
}

.category-list-item:hover {
    border-color: #667eea;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.1);
}

.category-list-item .form-check {
    margin: 0;
    padding: 0;
}

.category-list-item .form-check-input {
    position: absolute;
    top: 15px;
    right: 15px;
    width: 20px;
    height: 20px;
    border-radius: 6px;
    border: 2px solid #dee2e6;
    transition: all 0.3s ease;
}

.category-list-item .form-check-input:checked {
    background-color: #667eea;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.category-list-item .form-check-input:focus {
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.2);
}

.category-list-item .form-check-label {
    display: block;
    padding: 20px 50px 20px 20px;
    margin: 0;
    cursor: pointer;
    transition: all 0.3s ease;
    width: 100%;
}

.category-list-item:hover .form-check-label {
    background: rgba(102, 126, 234, 0.02);
}

.category-list-item .form-check-input:checked + .form-check-label {
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.1) 0%, rgba(118, 75, 162, 0.1) 100%);
    border-radius: 10px;
}

.category-info {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.category-name {
    font-size: 1rem;
    font-weight: 600;
    color: #333;
    margin: 0;
    display: flex;
    align-items: center;
    transition: all 0.3s ease;
}

.category-name i {
    color: #667eea;
    font-size: 1.1rem;
    width: 20px;
    text-align: center;
}

/* Estados de selección */
.category-list-item .form-check-input:checked + .form-check-label .category-name {
    color: #667eea;
}

.category-list-item .form-check-input:checked + .form-check-label .category-name i {
    color: #667eea;
}

/* Animaciones para categorías */
.category-list-item {
    animation: fadeInUp 0.6s ease forwards;
    opacity: 0;
}

.category-list-item:nth-child(1) { animation-delay: 0.1s; }
.category-list-item:nth-child(2) { animation-delay: 0.15s; }
.category-list-item:nth-child(3) { animation-delay: 0.2s; }
.category-list-item:nth-child(4) { animation-delay: 0.25s; }
.category-list-item:nth-child(5) { animation-delay: 0.3s; }
.category-list-item:nth-child(6) { animation-delay: 0.35s; }
.category-list-item:nth-child(7) { animation-delay: 0.4s; }
.category-list-item:nth-child(8) { animation-delay: 0.45s; }

/* Botones de selección rápida */
.btn-outline-primary,
.btn-outline-secondary {
    border-radius: 25px;
    padding: 8px 20px;
    font-weight: 500;
    transition: all 0.3s ease;
}

.btn-outline-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.3);
}

.btn-outline-secondary:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(108, 117, 125, 0.3);
}

/* Opciones de Estado de Ánimo */
.mood-option {
    transition: all 0.3s ease;
}

.mood-option input[type="radio"]:checked + label {
    background-color: #667eea !important;
    color: white !important;
    transform: scale(1.05);
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.3);
}

.mood-option label {
    padding: 20px 15px;
    border-radius: 15px;
    transition: all 0.3s ease;
    cursor: pointer;
    border: 2px solid #e9ecef;
}

.mood-option label:hover {
    border-color: #667eea;
    transform: translateY(-2px);
}

/* Opciones de Tiempo */
.time-option {
    transition: all 0.3s ease;
}

.time-option input[type="radio"]:checked + label {
    background-color: #17a2b8 !important;
    color: white !important;
    transform: scale(1.05);
    box-shadow: 0 5px 15px rgba(23, 162, 184, 0.3);
}

.time-option label {
    padding: 20px 15px;
    border-radius: 15px;
    transition: all 0.3s ease;
    cursor: pointer;
    border: 2px solid #e9ecef;
}

.time-option label:hover {
    border-color: #17a2b8;
    transform: translateY(-2px);
}

/* Opciones de Dificultad */
.difficulty-option {
    transition: all 0.3s ease;
}

.difficulty-option input[type="radio"]:checked + label {
    transform: scale(1.05);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}

.difficulty-option label {
    padding: 20px 15px;
    border-radius: 15px;
    transition: all 0.3s ease;
    cursor: pointer;
    border: 2px solid #e9ecef;
}

.difficulty-option label:hover {
    transform: translateY(-2px);
}

/* Cards de Libros */
.book-card {
    border: none;
    border-radius: 15px;
    overflow: hidden;
    transition: all 0.3s ease;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.book-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
}

.book-cover-container {
    position: relative;
    height: 200px;
    overflow: hidden;
}

.book-cover {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: all 0.3s ease;
}

.book-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: all 0.3s ease;
}

.book-card:hover .book-overlay {
    opacity: 1;
}

.book-card:hover .book-cover {
    transform: scale(1.1);
}

.book-title {
    font-size: 1rem;
    font-weight: 600;
    color: #333;
    margin-bottom: 5px;
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.book-author {
    font-size: 0.85rem;
    margin-bottom: 10px;
}

.book-category .badge {
    font-size: 0.75rem;
    padding: 4px 8px;
}

.book-stats {
    margin-top: 10px;
}

.book-stats small {
    font-size: 0.8rem;
}

/* Pestañas de Recomendaciones */
.nav-pills .nav-link {
    border-radius: 25px;
    padding: 12px 25px;
    margin: 0 5px;
    transition: all 0.3s ease;
    border: 2px solid transparent;
}

.nav-pills .nav-link:hover {
    background-color: #f8f9ff;
    border-color: #667eea;
}

.nav-pills .nav-link.active {
    background-color: #667eea;
    border-color: #667eea;
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.3);
}

/* Animaciones */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.book-card {
    animation: fadeInUp 0.6s ease forwards;
}

.book-card:nth-child(1) { animation-delay: 0.1s; }
.book-card:nth-child(2) { animation-delay: 0.2s; }
.book-card:nth-child(3) { animation-delay: 0.3s; }
.book-card:nth-child(4) { animation-delay: 0.4s; }
.book-card:nth-child(5) { animation-delay: 0.5s; }
.book-card:nth-child(6) { animation-delay: 0.6s; }

/* Modal de Resultados */
#resultsModal .modal-dialog {
    max-width: 80%;
}

#resultsModal .modal-body {
    max-height: 60vh;
    overflow-y: auto;
    padding: 2rem;
}

#resultsModal .book-card {
    transition: all 0.3s ease;
}

#resultsModal .book-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.15);
}

#resultsModal .book-cover-container {
    height: 180px;
}

#resultsModal .book-title {
    font-size: 0.9rem;
    line-height: 1.2;
}

#resultsModal .book-author {
    font-size: 0.8rem;
}

/* Mensaje de encabezado del modal */
#resultsModal .text-primary {
    color: #667eea !important;
    font-weight: 600;
}

#resultsModal .text-muted {
    font-size: 0.95rem;
}

/* Botón de "Leer Ahora" */
.btn-outline-primary {
    border-color: #667eea;
    color: #667eea;
    transition: all 0.3s ease;
}

.btn-outline-primary:hover {
    background-color: #667eea;
    border-color: #667eea;
    color: white;
    transform: translateY(-1px);
}

/* Animación de carga */
.loading-spinner {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid #f3f3f3;
    border-top: 3px solid #667eea;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

/* Responsive */
@media (max-width: 768px) {
    .recommendations-hero {
        padding: 80px 0 60px;
    }
    
    .recommendations-hero .stat-item {
        margin-bottom: 20px;
    }
    
    .mood-option label,
    .time-option label,
    .difficulty-option label {
        padding: 15px 10px;
        font-size: 0.9rem;
    }
    
    .book-cover-container {
        height: 150px;
    }
    
    .book-title {
        font-size: 0.9rem;
    }
    
    /* Lista de categorías responsive */
    .categories-list-container {
        padding: 15px;
    }
    
    .category-list-item .form-check-label {
        padding: 15px 45px 15px 15px;
    }
    
    .category-name {
        font-size: 0.9rem;
    }
    
    .category-list-item .form-check-input {
        top: 12px;
        right: 12px;
        width: 18px;
        height: 18px;
    }
    
    /* Modal responsive para móviles */
    #resultsModal .modal-dialog {
        max-width: 95%;
        margin: 1rem;
    }
    
    #resultsModal .modal-body {
        padding: 1rem;
        max-height: 50vh;
    }
    
    #resultsModal .book-cover-container {
        height: 150px;
    }
}

@media (max-width: 576px) {
    .recommendations-hero h1 {
        font-size: 2.5rem;
    }
    
    .recommendations-hero .lead {
        font-size: 1.1rem;
    }
    
    .category-check {
        padding: 10px;
    }
    
    .mood-option label,
    .time-option label,
    .difficulty-option label {
        padding: 12px 8px;
        font-size: 0.8rem;
    }
}
