/* ============================================
   SEÇÃO DE REVIEWS – LAYOUT ORIGINAL + CORES 2026
   ============================================ */

/* Seção principal */
.reviews-section {
    margin-top: 2rem;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 16px;
    padding: 3rem;
    backdrop-filter: blur(2px);
    transition: background-color 0.2s ease;
}

.reviews-title {
    font-size: 1.2rem;
    font-weight: 700;
    color: #ffffff;
    margin-bottom: 1rem;
    padding-left: 0.75rem;
    border-left: 3px solid #e50914;
    letter-spacing: -0.2px;
}

/* Grid com exatamente 2 colunas – os cards quebram linha automaticamente */
.reviews-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);   /* máximo 2 reviews por linha */
    gap: 1rem;
}

.review-card {
    background: #1a1a1a;
    border-radius: 12px;
    padding: 1rem;
    transition: transform 0.2s, box-shadow 0.2s, border-color 0.2s;
    border: 1px solid #2c2c2c;
    display: flex;
    flex-direction: column;
    height: 100%;
	max-width: 260px;
}

.review-card:hover,
.review-card:focus-within {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.4);
    border-color: #e50914;
}

/* Cabeçalho: avatar + autor à esquerda, likes à direita – alinhamento centralizado */
.review-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    gap: 1rem;
}

.review-user-info {
    display: flex;
    align-items: center;
    gap: 12px;
    flex: 1;
    min-width: 0;
}

.review-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 1px solid #3a3a3a;
    object-fit: cover;
    background: #252525;
    flex-shrink: 0;
    display: block;
}

.review-author-details {
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.review-author {
    font-size: 0.85rem;
    font-weight: 700;
    color: #e0e0e0;
    margin: 0;
    line-height: 1.2;
    display: block;
}

.review-username {
    font-size: 0.7rem;
    color: #888;
    margin: 0;
    display: block;
}

/* Badges (likes) – lado direito */
.review-meta-badges {
    display: flex;
    align-items: center;
    gap: 8px;
}

.review-likes {
    display: flex;
    align-items: center;
    gap: 4px;
    background: rgba(255, 255, 255, 0.08);
    padding: 4px 10px;
    border-radius: 30px;
    font-size: 0.75rem;
    font-weight: 500;
    color: #fff;
}

.likes-icon {
    fill: #e50914;
    width: 14px;
    height: 14px;
}

.likes-count {
    line-height: 1;
}

/* Conteúdo do texto */
.review-content {
    flex: 1;
    margin-bottom: 0.75rem;
}

.review-text {
    font-size: 0.85rem;
    line-height: 1.5;
    color: #bcbcbc;
    margin: 0;
    display: -webkit-box;
    -webkit-line-clamp: 4;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Link “Ler mais” – alinhado à direita no final do card */
.review-footer {
    display: flex;
    justify-content: flex-end;
    margin-top: 0.5rem;
}

.review-link {
    font-size: 0.75rem;
    font-weight: 500;
    color: #aaa;
    text-decoration: none;
    transition: color 0.2s;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.review-link:hover,
.review-link:focus-visible {
    color: #e50914;
    text-decoration: none;
    outline: none;
}

.no-reviews {
    padding: 1rem;
    text-align: center;
    color: #aaa;
    font-size: 0.85rem;
    background: #1a1a1a;
    border-radius: 12px;
    border: 1px solid #2c2c2c;
}

/* ============================================
   CONTAINER DE REVIEWS NA PÁGINA DE DETALHES
   ============================================ */
#letterboxd-reviews-container {
    flex: 1 1 300px;
    min-width: 260px;
    align-self: flex-start;
    margin-top: 0;
}

/* Margem lateral em telas a partir de 1025px */
@media (min-width: 1025px) {
    #letterboxd-reviews-container {
        margin-left: 1rem;
    }
}

/* Tablet empilhado: força largura total e remove margens */
@media (max-width: 1024px) {
    #letterboxd-reviews-container {
        flex-basis: 100%;
        max-width: none;
        margin-top: 2rem;
        margin-left: 0;
    }
}

/* Desktop grande: limita largura máxima para não ocupar tudo */
@media (min-width: 1200px) {
    #letterboxd-reviews-container {
        max-width: 45%;
        margin-left: 2rem;
    }
}
/* nenhuma alteração no grid-template-columns – já é fixo 2 colunas */

/* Telas muito grandes */
@media (min-width: 1400px) {
    #letterboxd-reviews-container {
        max-width: 40%;
    }
}

/* ===== RESPONSIVIDADE DOS COMPONENTES INTERNOS ===== */
/* Mobile: uma única coluna */
@media (max-width: 768px) {
    .reviews-section {
        padding: 0.8rem;
        margin-top: 1.2rem;
    }
    .reviews-title {
        font-size: 1rem;
        margin-bottom: 0.8rem;
    }
    .reviews-grid {
        grid-template-columns: 1fr;   /* empilha tudo */
        gap: 0.8rem;
    }
    .review-card {
        padding: 0.8rem;
    }
    .review-avatar {
        width: 32px;
        height: 32px;
    }
    .review-author {
        font-size: 0.8rem;
    }
    .review-username {
        font-size: 0.65rem;
    }
    .review-likes {
        font-size: 0.7rem;
        padding: 2px 8px;
    }
    .review-text {
        font-size: 0.8rem;
        -webkit-line-clamp: 3;
    }
    .review-footer {
        justify-content: flex-end;
    }
}

/* ============================================
   INDICADOR DE CARREGAMENTO HTMX
   ============================================ */
.reviews-loading-indicator {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 2rem;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 16px;
    margin-top: 1rem;
}
.htmx-indicator {
    opacity: 0;
    transition: opacity 200ms ease-in;
}
.htmx-request .htmx-indicator {
    opacity: 1;
}

/* ============================================
   SPOILER
   ============================================ */
.spoiler-wrapper {
    position: relative;
}

.spoiler-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0,0,0,0.75);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    z-index: 2;
    transition: opacity 0.3s ease;
}

.spoiler-toggle-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background: rgba(255,255,255,0.1);
    border: 1px solid rgba(255,255,255,0.2);
    color: #fff;
    font-size: 0.85rem;
    font-weight: 600;
    padding: 0.5rem 1rem;
    border-radius: 30px;
    cursor: pointer;
    transition: background 0.2s, border-color 0.2s;
    backdrop-filter: blur(2px);
}

.spoiler-toggle-btn:hover {
    background: rgba(255,255,255,0.2);
    border-color: rgba(255,255,255,0.4);
}

.spoiler-icon {
    flex-shrink: 0;
}

.spoiler-text {
    filter: blur(8px);
    user-select: none;
    transition: filter 0.3s ease;
}

/* Estado revelado – remove blur e esconde overlay */
.spoiler-wrapper.revealed .spoiler-overlay {
    opacity: 0;
    pointer-events: none;
}

.spoiler-wrapper.revealed .spoiler-text {
    filter: none;
    user-select: auto;
}

/* ============================================
   SPINNER DE CARREGAMENTO
   ============================================ */
.spinner {
    animation: rotate 2s linear infinite;
    width: 40px;
    height: 40px;
}
.spinner .path {
    stroke: #e50914;
    stroke-linecap: round;
    animation: dash 1.5s ease-in-out infinite;
}

@keyframes rotate {
    100% { transform: rotate(360deg); }
}
@keyframes dash {
    0% { stroke-dasharray: 1, 150; stroke-dashoffset: 0; }
    50% { stroke-dasharray: 90, 150; stroke-dashoffset: -35; }
    100% { stroke-dasharray: 90, 150; stroke-dashoffset: -124; }
}

.loading-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.75rem;
    color: #aaa;
    font-size: 0.9rem;
}