/*
========================================
File: song-analysis-page.css
========================================
*/
/* --- Header da Música (Hero) --- */
´

/* --- Layout Principal --- */
.song-analysis-layout {
    display: grid;
    grid-template-columns: 1fr;
    /* Mobile First */
    gap: var(--spacing-8);
    margin-top: var(--spacing-8);
}

@media (min-width: 1024px) {

    /* lg */
    .song-analysis-layout {
        grid-template-columns: minmax(0, 2fr) 1fr;
        /* Conteúdo principal e sidebar */
    }
}

/* --- Header de Conteúdo da Música (Novo) --- */
.song-content-header {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: var(--spacing-4);
    margin-bottom: var(--spacing-8);
}

.song-content-header__artwork {
    width: 120px;
    height: 120px;
    border-radius: var(--border-radius-md);
    box-shadow: var(--shadow-lg);
    object-fit: cover;
}

.song-content-header__title {
    font-size: var(--fs-4xl);
    font-weight: 800;
    color: var(--color-text-primary);
    line-height: 1.1;
}

.song-content-header__artist {
    font-size: var(--fs-lg);
    color: var(--color-text-secondary);
    margin-top: -0.5rem;
}

.song-content-header__artist a:hover {
    text-decoration: underline;
    color: var(--color-text-primary);
}

@media (min-width: 768px) {
    .song-content-header {
        flex-direction: row;
        text-align: left;
        gap: var(--spacing-6);
    }

    .song-content-header__artwork {
        width: 150px;
        height: 150px;
    }

    .song-content-header__title {
        font-size: var(--fs-5xl);
    }
}


/* --- Abas de Idioma --- */
.language-tabs {
    display: flex;
    gap: var(--spacing-2);
    border-bottom: 1px solid var(--color-border);
    margin-bottom: var(--spacing-6);
}

.language-tabs__btn {
    padding: var(--spacing-3) var(--spacing-4);
    margin-bottom: -1px;
    /* Alinhar com borda do container */
    border: none;
    background: none;
    cursor: pointer;
    font-size: var(--fs-sm);
    font-weight: 500;
    color: var(--color-text-secondary);
    border-bottom: 2px solid transparent;
    transition: var(--transition-fast);
}

.language-tabs__btn:hover {
    color: var(--color-text-primary);
}

.language-tabs__btn.active {
    color: var(--color-primary);
    border-bottom-color: var(--color-primary);
}

/* --- Painel da Letra --- */
.lyrics-pane {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-4);
    /* Espaço maior entre as linhas */
}

.lyric-line {
    padding: var(--spacing-2) 0;
    cursor: pointer;
    font-size: var(--fs-lg);
    line-height: 1.7;
    color: var(--color-text-secondary);
    transition: color 0.2s;
    position: relative;
}

.lyric-line:hover {
    color: var(--color-text-primary);
}

.lyric-line.active {
    color: var(--color-primary);
    font-weight: 500;
}

.lyric-line.annotated::after {
    content: '';
    position: absolute;
    left: -1rem;
    /* Posiciona à esquerda */
    top: 50%;
    transform: translateY(-50%);
    width: 4px;
    height: 4px;
    background-color: var(--color-primary);
    border-radius: 50%;
}


/* --- Sidebar de Análise (Desktop) e Action Sheet (Mobile) --- */
.analysis-panel {
    position: sticky;
    top: 8rem;
    background-color: var(--color-bg-content);
    border-radius: var(--border-radius-lg);
    max-height: calc(100vh - 7rem);
    display: flex;
    flex-direction: column;
}

.analysis-panel__content {
    padding: var(--spacing-6);
    overflow-y: auto;
    flex-grow: 1;
}

.analysis-panel__content::-webkit-scrollbar {
    width: 5px;
}

.analysis-panel__content::-webkit-scrollbar-track {
    background: transparent;
}

.analysis-panel__content::-webkit-scrollbar-thumb {
    background: var(--color-bg-elevated);
    border-radius: 3px;
}

.song-hero {
    position: relative;
    padding: var(--spacing-8) 0;
    overflow: hidden;
    min-height: 300px;
    display: flex;
    align-items: flex-end;
}

.song-hero__background {
    position: absolute;
    inset: 0;
    background-size: cover;
    background-position: center;
    filter: blur(20px) brightness(0.4);
    transform: scale(1.2);
}

.song-hero__overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, var(--color-bg-dark) 0%, rgba(10, 10, 10, 0.8) 40%, transparent 100%);
}

.song-hero__content {
    position: relative;
    z-index: 10;
    display: flex;
    flex-direction: column;
    gap: var(--spacing-6);
    align-items: center;
    text-align: center;
}

.song-hero__artwork {
    width: 180px;
    height: 180px;
    border-radius: var(--border-radius-md);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    object-fit: cover;
}

.song-hero__title {
    font-size: var(--fs-4xl);
    font-weight: 800;
    color: var(--color-text-primary);
    line-height: 1.1;
}

.song-hero__meta {
    font-size: var(--fs-lg);
    color: var(--color-text-secondary);
    margin-top: -1rem;
    display: flex;
    align-items: center;
    gap: var(--spacing-2);
}

.song-hero__meta a:hover {
    color: var(--color-text-primary);
    text-decoration: underline;
}

@media (min-width: 768px) {
    .song-hero {
        min-height: 350px;
    }

    .song-hero__content {
        flex-direction: row;
        text-align: left;
    }

    .song-hero__artwork {
        width: 220px;
        height: 220px;
    }

    .song-hero__title {
        font-size: var(--fs-5xl);
    }
}

/* --- Layout Principal --- */
.song-analysis-layout {
    display: grid;
    grid-template-columns: 1fr;
    gap: var(--spacing-8);
    margin-top: var(--spacing-8);
}

@media (min-width: 1024px) {
    .song-analysis-layout {
        grid-template-columns: minmax(0, 2fr) 1fr;
    }
}

/* --- Coluna da Letra --- */
.lyrics-column__header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--spacing-4);
}

.lyrics-column__title {
    font-size: var(--fs-2xl);
    font-weight: 700;
    color: var(--color-text-primary);
}

.lyrics-column__toggle-translation {
    display: flex;
    align-items: center;
    gap: var(--spacing-2);
    font-size: var(--fs-sm);
}

/* Estilo do Switch Toggle */
.switch {
    position: relative;
    display: inline-block;
    width: 40px;
    height: 22px;
}

.switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: absolute;
    cursor: pointer;
    inset: 0;
    background-color: var(--color-bg-elevated);
    transition: .4s;
    border-radius: 22px;
}

.slider:before {
    position: absolute;
    content: "";
    height: 16px;
    width: 16px;
    left: 3px;
    bottom: 3px;
    background-color: var(--color-text-secondary);
    transition: .4s;
    border-radius: 50%;
}

input:checked+.slider {
    background-color: var(--color-primary);
}

input:checked+.slider:before {
    transform: translateX(18px);
    background-color: white;
}

.lyrics-pane {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-1);
}

.lyric-line-wrapper {
    padding: var(--spacing-2) var(--spacing-3);
    border-radius: var(--border-radius-md);
    transition: background-color 0.2s;
    position: relative;
}

/* Animação de Foco */
.lyrics-pane.is-focused .lyric-line-wrapper:not(.active) {
    opacity: 0.5;
    transition: opacity 0.3s;
}

.lyric-line-wrapper:hover {
    background-color: var(--color-bg-elevated);
}

.lyric-line-wrapper.active {
    background-color: var(--color-primary-darker);
}

.lyric-line {
    font-size: var(--fs-lg);
    line-height: 1.7;
    color: var(--color-text-secondary);
    cursor: pointer;
}

.lyric-line-wrapper.active .lyric-line {
    color: var(--color-text-primary);
}

.lyric-translation {
    font-size: var(--fs-sm);
    color: var(--color-primary);
    padding-top: var(--spacing-1);
    font-style: italic;
    max-height: 0;
    opacity: 0;
    overflow: hidden;
    transition: max-height 0.3s ease-out, opacity 0.3s ease-out, padding-top 0.3s ease-out;
}

.show-translations .lyric-line-wrapper:hover .lyric-translation,
.show-translations .lyric-line-wrapper.active .lyric-translation {
    max-height: 100px;
    /* Suficiente para a tradução */
    opacity: 1;
    padding-top: var(--spacing-2);
}

.add-annotation-btn-pro {
    position: absolute;
    right: var(--spacing-3);
    top: 50%;
    transform: translateY(-50%);
    background-color: transparent;
    color: var(--color-text-tertiary);
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: var(--transition-fast);
    border: 1px solid transparent;
}

.lyric-line-wrapper:hover .add-annotation-btn-pro {
    opacity: 1;
}

.add-annotation-btn-pro:hover {
    background-color: var(--color-bg-elevated);
    color: var(--color-text-primary);
    border-color: var(--color-border);
}

.lyric-line-wrapper.annotated .add-annotation-btn-pro {
    color: var(--color-primary);
    opacity: 1;
}

/* --- Sidebar de Análise Refinada --- */
.analysis-sidebar-pro {
    position: sticky;
    top: 6rem;
    max-height: calc(100vh - 7rem);
    display: flex;
    flex-direction: column;
}

.analysis-sidebar-pro__content {
    background-color: var(--color-bg-content);
    border-radius: var(--border-radius-lg);
    padding: var(--spacing-6);
    flex-grow: 1;
    overflow-y: auto;
}

.analysis-sidebar-pro__content::-webkit-scrollbar {
    width: 5px;
}

.analysis-sidebar-pro__content::-webkit-scrollbar-track {
    background: transparent;
}

.analysis-sidebar-pro__content::-webkit-scrollbar-thumb {
    background: var(--color-bg-elevated);
    border-radius: 3px;
}

.analysis-sidebar-pro__content>*:not(:first-child) {
    animation: slideInUp 0.4s ease-out backwards;
}

.interpretation-card {
    background-color: var(--color-bg-dark);
    padding: var(--spacing-3);
    border-radius: var(--border-radius-md);
    margin-bottom: var(--spacing-2);
}

.interpretation-card__text {
    font-size: var(--fs-sm);
    margin-bottom: var(--spacing-3);
}

.interpretation-card__footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: var(--fs-xs);
    color: var(--color-text-tertiary);
}

.interpretation-card__author {
    display: flex;
    align-items: center;
    gap: var(--spacing-2);
    font-weight: 500;
}

.interpretation-card__votes {
    display: flex;
    align-items: center;
    gap: var(--spacing-2);
}

.interpretation-card__votes button {
    background: none;
    border: none;
    color: inherit;
    cursor: pointer;
    padding: var(--spacing-1);
    transition: color 0.2s;
}

.interpretation-card__votes button:hover {
    color: var(--color-text-primary);
}

/* --- Seções Adicionais --- */
.ai-insights,
.community-qa {
    margin-top: var(--spacing-12);
    padding: var(--spacing-6);
    background-color: var(--color-bg-content);
    border-radius: var(--border-radius-lg);
}

.section-title {
    display: flex;
    align-items: center;
    gap: var(--spacing-3);
    font-size: var(--fs-2xl);
    font-weight: 700;
    color: var(--color-text-primary);
    margin-bottom: var(--spacing-4);
}

.extra-section {
    margin-top: var(--spacing-12);
    padding: var(--spacing-6);
    background: linear-gradient(to bottom, var(--color-bg-content), var(--color-bg-dark));
    border-top: 1px solid var(--color-border);
    border-radius: var(--border-radius-lg);
}

.section-title i {
    color: var(--color-primary);
}

/* Mobile Action Sheet */
@media (max-width: 1023px) {
    .analysis-panel {
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        top: auto;
        z-index: 1200;
        max-height: 85vh;
        border-radius: 1rem 1rem 0 0;
        transform: translateY(100%);
        transition: transform 0.3s ease-in-out;
        box-shadow: 0 -10px 30px rgba(0, 0, 0, 0.3);
    }

    .lyrics-pane {
        padding-left: 15px;
    }

    .analysis-panel.open {
        transform: translateY(0);
    }

    .analysis-panel__header {
        cursor: grab;
        /* Para indicar que pode ser arrastado */
    }

    .analysis-panel__drag-handle {
        width: 40px;
        height: 4px;
        background-color: var(--color-border);
        border-radius: 2px;
        margin: 0 auto var(--spacing-4);
    }

    .language-tabs {
        overflow-x: auto;
        display: flex;
        width: 95dvw;
        margin-left: -10px;
        scrollbar-width: none;
        top: 108px;
        position: sticky;
        background-color: rgba(10, 10, 10, 0.8);
        backdrop-filter: blur(8px);
        z-index: 9;
    }

    .language-tabs__btn {
        flex-shrink: 0;
        white-space: nowrap;
        display: inline-flex;
    }
}

/* --- Mobile Bottom Sheet (Sidebar de Análise) --- */
@media (max-width: 1023px) {
    .analysis-sidebar {
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        top: auto;
        z-index: 60;
        max-height: 80vh;
        border-radius: 1rem 1rem 0 0;
        transform: translateY(100%);
        transition: transform 0.3s ease-in-out;
        padding-top: var(--spacing-4);
    }

    .analysis-sidebar.open {
        transform: translateY(0);
    }

    .analysis-sidebar__drag-handle {
        width: 40px;
        height: 4px;
        background-color: var(--color-border);
        border-radius: 2px;
        margin: 0 auto var(--spacing-4);
    }

    .page-overlay {
        position: fixed;
        inset: 0;
        background-color: rgba(0, 0, 0, 0.5);
        z-index: 59;
        opacity: 0;
        visibility: hidden;
        transition: opacity 0.3s, visibility 0.3s;
    }

    .page-overlay.open {
        opacity: 1;
        visibility: visible;
    }
}

.is-mobile-only {
    display: block;
    /* ou flex, etc. */
}

@media (min-width: 1024px) {

    /* lg */
    .is-mobile-only {
        display: none;
    }
}

/*
========================================
File: song-analysis-pro.css (ADIÇÕES)
========================================
*/

/* ... (Todos os estilos anteriores permanecem os mesmos) ... */

/* --- Seção de Comentários --- */
.comments-section {
    margin-top: var(--spacing-12);
    padding-top: var(--spacing-8);
    border-top: 1px solid var(--color-border);
}

.comments-section__header {
    display: flex;
    align-items: center;
    gap: var(--spacing-3);
    margin-bottom: var(--spacing-6);
}

.comments-section__title {
    font-size: var(--fs-2xl);
    font-weight: 700;
    color: var(--color-text-primary);
}

.comments-section__count {
    background-color: var(--color-bg-elevated);
    color: var(--color-text-secondary);
    font-size: var(--fs-sm);
    font-weight: 500;
    padding: var(--spacing-1) var(--spacing-2);
    border-radius: var(--border-radius-md);
}

/* Formulário para Novo Comentário */
.new-comment-form {
    display: flex;
    gap: var(--spacing-4);
    align-items: flex-start;
    margin-bottom: var(--spacing-8);
}

.new-comment-form__avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
    margin-top: var(--spacing-2);
}

.new-comment-form__input-wrapper {
    flex-grow: 1;
}

.new-comment-form__textarea {
    width: 100%;
    background-color: var(--color-bg-elevated);
    border: 1px solid var(--color-border);
    color: var(--color-text-primary);
    padding: var(--spacing-3);
    border-radius: var(--border-radius-md);
    font-size: var(--fs-sm);
    min-height: 80px;
    resize: vertical;
    transition: var(--transition-fast);
}

.new-comment-form__textarea:focus {
    outline: none;
    box-shadow: 0 0 0 2px var(--color-primary);
    border-color: var(--color-primary);
}

.new-comment-form__actions {
    margin-top: var(--spacing-2);
    text-align: right;
}

/* Lista de Comentários */
.comments-list {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-6);
}

.comment-item {
    display: flex;
    gap: var(--spacing-4);
    align-items: flex-start;
}

.comment-item__avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
}

.comment-item__content {
    flex-grow: 1;
}

.comment-item__header {
    display: flex;
    align-items: center;
    gap: var(--spacing-2);
    margin-bottom: var(--spacing-1);
}

.comment-item__author {
    font-weight: 600;
    font-size: var(--fs-sm);
    color: var(--color-text-primary);
}

.comment-item__date {
    font-size: var(--fs-xs);
    color: var(--color-text-tertiary);
}

.comment-item__text {
    font-size: var(--fs-sm);
    line-height: 1.7;
    color: var(--color-text-secondary);
}

.comment-item__actions {
    margin-top: var(--spacing-2);
    display: flex;
    gap: var(--spacing-4);
}

.comment-item__action-btn {
    background: none;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: var(--spacing-1);
    font-size: var(--fs-xs);
    font-weight: 500;
    color: var(--color-text-tertiary);
    transition: var(--transition-fast);
}

.comment-item__action-btn:hover {
    color: var(--color-primary);
}

/*
========================================
File: song-analysis-pro.css (ADIÇÕES)
========================================
*/

/* ... (Estilos anteriores permanecem os mesmos) ... */

/* --- Componente de CTA para Login --- */
.login-cta {
    background-color: var(--color-bg-elevated);
    border: 1px solid var(--color-border);
    border-radius: var(--border-radius-lg);
    padding: var(--spacing-6);
    text-align: center;
    margin-bottom: var(--spacing-8);
}

.login-cta__title {
    font-size: var(--fs-lg);
    font-weight: 600;
    color: var(--color-text-primary);
    margin-bottom: var(--spacing-2);
}

.login-cta__text {
    font-size: var(--fs-sm);
    color: var(--color-text-secondary);
    margin-bottom: var(--spacing-6);
    max-width: 400px;
    margin-left: auto;
    margin-right: auto;
}

.login-cta__actions {
    display: flex;
    justify-content: center;
    gap: var(--spacing-3);
    flex-wrap: wrap;
}

/* Botão secundário para o CTA */
.btn--secondary {
    background-color: transparent;
    border-color: var(--color-border);
    color: var(--color-text-secondary);
}

.btn--secondary:hover {
    background-color: var(--color-bg-elevated);
    border-color: var(--color-text-tertiary);
    color: var(--color-text-primary);
}

/* Classe de controle para visibilidade */
.hidden {
    display: none !important;
}