/* ==========================================
   SEÇÕES DOS RESULTADOS
   ========================================== */

   .book-section {
    margin-bottom: 3rem;
    animation: fadeIn 0.8s ease-out;
    position: relative;
}

.book-section::after {
    content: '';
    display: block;
    position: absolute;
    bottom: -1.5rem;
    left: 10%;
    width: 80%;
    height: 1px;
    background: linear-gradient(to right, transparent, var(--border-color) 20%, var(--border-color) 80%, transparent);
}

.book-section:last-child::after {
    display: none;
}

.book-source {
    font-size: 1.5rem;
    margin-bottom: 1.2rem;
    color: var(--primary-color);
    font-weight: 600;
    position: relative;
    display: inline-block;
}

.book-source::after {
    content: '';
    display: block;
    width: 50%;
    height: 3px;
    background-color: var(--primary-color);
    position: absolute;
    bottom: -0.5rem;
    left: 0;
    border-radius: 2px;
}

.books-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 1.8rem;
    margin-top: 2rem;
}

.recommendations-divider {
    margin: 3rem 0;
    border: none;
    height: 1px;
    background-color: var(--border-color);
}

/* ==========================================
   DESCRIÇÃO DO LIVRO ORIGINAL E ABORDAGEM
   ========================================== */

.book-origin-description {
    background-color: var(--highlight-color);
    border-left: 4px solid var(--primary-color);
    padding: 1.2rem 1.5rem;
    margin-bottom: 1.8rem;
    border-radius: 0 8px 8px 0;
    font-style: italic;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    position: relative;
    overflow: hidden;
}

.book-origin-description::before {
    content: '"';
    position: absolute;
    top: -0.5rem;
    left: 0.5rem;
    font-size: 4rem;
    color: var(--primary-color);
    opacity: 0.1;
    font-family: Georgia, serif;
}

.book-origin-description p {
    margin: 0;
    color: var(--text-color);
    opacity: 0.9;
    font-size: 1rem;
    line-height: 1.6;
    position: relative;
    text-align: justify;
}

.recommendation-approach {
    background-color: var(--container-bg);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 1.2rem 1.5rem;
    margin-bottom: 1.8rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    position: relative;
}

.recommendation-approach h4 {
    margin: 0 0 0.8rem 0;
    font-size: 1.1rem;
    color: var(--primary-color);
    display: flex;
    align-items: center;
}

.recommendation-approach h4::before {
    content: '';
    display: inline-block;
    width: 1.2rem;
    height: 1.2rem;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%237C4DFF'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M13 16h-1v-4h-1m1-4h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z'%3E%3C/path%3E%3C/svg%3E");
    background-size: contain;
    margin-right: 0.5rem;
}

.recommendation-approach p {
    margin: 0;
    font-size: 1rem;
    line-height: 1.6;
    text-align: justify;
}

/* ==========================================
   CARTÕES DE LIVROS RECOMENDADOS
   ========================================== */

.book-card {
    border: 1px solid var(--border-color);
    border-radius: 12px;
    overflow: hidden;
    background-color: var(--background-color);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    position: relative;
    display: flex;
    flex-direction: column;
    height: 100%;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.08);
}

.book-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 15px 25px rgba(0, 0, 0, 0.1);
    border-color: var(--primary-color);
}

.book-cover {
    width: 100%;
    height: auto;
    object-fit: contain;
    display: block;
    border-bottom: 1px solid var(--border-color);
    transition: all 0.3s ease;
}

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

.book-info {
    padding: 1.2rem;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}

.book-title {
    font-size: 1.2rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: var(--text-color);
    line-height: 1.4;
}

.book-author {
    font-size: 0.95rem;
    margin-bottom: 0.8rem;
    color: var(--text-color);
    opacity: 0.8;
}

.book-description {
    font-size: 0.95rem;
    margin-bottom: 1.2rem;
    color: var(--text-color);
    opacity: 0.9;
    line-height: 1.6;
    flex-grow: 1;
    text-align: justify;
    /* Removida a limitação de linhas para mostrar descrição completa */
    /* display: -webkit-box;
    -webkit-line-clamp: 5;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis; */
}

.book-link {
    display: block;
    text-align: center;
    padding: 0.8rem;
    background-color: var(--primary-color);
    color: white;
    border-radius: 6px;
    text-decoration: none;
    font-weight: 500;
    transition: all 0.2s ease;
    margin-top: auto;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

.book-link:hover {
    background-color: var(--secondary-color);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

.book-rank {
    position: absolute;
    top: 12px;
    left: 12px;
    background-color: var(--primary-color);
    color: white;
    padding: 0.4rem 0.8rem;
    border-radius: 50px;
    font-weight: bold;
    z-index: 2;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
    font-size: 0.9rem;
}

.book-match {
    position: absolute;
    top: 12px;
    right: 12px;
    background-color: rgba(0, 0, 0, 0.7);
    color: white;
    padding: 0.4rem 0.8rem;
    border-radius: 50px;
    font-weight: bold;
    z-index: 2;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
    font-size: 0.9rem;
}

/* Animar os cards para aparecerem gradualmente */
.book-card {
    opacity: 0;
    transform: translateY(20px);
    animation: fadeInUp 0.6s forwards;
}

.book-card:nth-child(2) {
    animation-delay: 0.2s;
}

.book-card:nth-child(3) {
    animation-delay: 0.4s;
}

/* ==========================================
   CRITÉRIOS E DETALHES
   ========================================== */

.details-btn {
    display: block;
    width: 100%;
    background-color: var(--highlight-color);
    color: var(--text-color);
    font-size: 0.9rem;
    padding: 0.7rem;
    margin-top: 0.8rem;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
    text-align: center;
    position: relative;
}

.details-btn:hover {
    background-color: var(--border-color);
    color: var(--primary-color);
}

.details-btn::after {
    content: '';
    position: absolute;
    right: 1rem;
    top: 50%;
    transform: translateY(-50%);
    width: 0.8rem;
    height: 0.8rem;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='currentColor'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M19 9l-7 7-7-7'%3E%3C/path%3E%3C/svg%3E");
    background-size: contain;
    background-repeat: no-repeat;
    transition: transform 0.2s ease;
}

.details-btn.active::after {
    transform: translateY(-50%) rotate(180deg);
}

.criteria-details {
    margin-top: 1rem;
    padding: 1rem;
    background-color: var(--background-color);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    font-size: 0.9rem;
    animation: fadeIn 0.3s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.criteria-details h4 {
    margin: 0 0 1rem 0;
    color: var(--primary-color);
    font-size: 1rem;
    text-align: center;
    position: relative;
}

.criteria-details h4::before,
.criteria-details h4::after {
    content: '';
    position: absolute;
    top: 50%;
    height: 1px;
    width: 20%;
    background-color: var(--border-color);
}

.criteria-details h4::before {
    left: 0;
}

.criteria-details h4::after {
    right: 0;
}

.criteria-details p {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.7rem;
    padding-bottom: 0.7rem;
    border-bottom: 1px solid var(--border-color);
}

.criteria-details p:last-child {
    margin-bottom: 0;
    padding-bottom: 0;
    border-bottom: none;
}

.criteria-details p span:first-child {
    font-weight: 500;
}

.criteria-details p span:last-child {
    font-weight: 600;
    color: var(--primary-color);
    position: relative;
    background: rgba(124, 77, 255, 0.1);
    padding: 0.2rem 0.5rem;
    border-radius: 3px;
    width: 60px;
    display: inline-block;
    text-align: center;
    white-space: nowrap;
}

/* Para escurecer suavemente o container quando os detalhes estão expandidos */
.book-card-expanded {
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.15);
}

/* ==========================================
   ANIMAÇÕES
   ========================================== */

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

/* ==========================================
   MINI CARTÃO DO LIVRO ORIGINAL
   ========================================== */

/* Mini cartão removido conforme solicitado */

/* ==========================================
   COMPARTILHAMENTO E FEEDBACK
   ========================================== */

.share-container, .feedback-container, .restart-container {
    margin-top: 3rem;
    padding-top: 2rem;
    border-top: 1px solid var(--border-color);
    animation: fadeIn 1s ease;
}

.share-buttons {
    display: flex;
    gap: 1rem;
    margin-top: 1rem;
    justify-content: center;
}

.share-btn {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1.2rem;
    cursor: pointer;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

.share-btn:hover {
    transform: translateY(-5px) scale(1.1);
    box-shadow: 0 6px 15px rgba(0, 0, 0, 0.2);
}

.share-btn.facebook {
    background-color: #3b5998;
}

.share-btn.twitter {
    background-color: #1da1f2;
}

.share-btn.whatsapp {
    background-color: #25d366;
}

.share-btn.copy {
    background-color: #607d8b;
}

.rating {
    display: flex;
    gap: 0.8rem;
    margin: 1.5rem 0;
    font-size: 1.8rem;
    color: var(--text-color);
    justify-content: center;
}

.rating i {
    cursor: pointer;
    transition: all 0.3s ease;
}

.rating i:hover, .rating i.active {
    color: #FFD700;
    transform: scale(1.3) rotate(5deg);
}

textarea#feedback-text {
    width: 100%;
    min-height: 120px;
    padding: 1rem;
    margin-bottom: 1.5rem;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    background-color: var(--background-color);
    color: var(--text-color);
    resize: vertical;
    font-family: inherit;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

textarea#feedback-text:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(124, 77, 255, 0.2);
}

.restart-container {
    text-align: center;
}

#restart-btn {
    width: auto;
    display: inline-block;
    padding: 0.8rem 2rem;
    font-size: 1rem;
    background-color: var(--primary-color);
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
}

#restart-btn:hover {
    background-color: var(--secondary-color);
    box-shadow: 0 6px 15px rgba(0, 0, 0, 0.15);
    transform: translateY(-3px);
}

/* Responsividade para dispositivos móveis */
@media (max-width: 768px) {
    .books-grid {
        grid-template-columns: 1fr;
    }
    
    .book-origin-description,
    .recommendation-approach {
        padding: 1rem;
    }
    
    .share-buttons {
        justify-content: space-around;
    }
}