/* Chemin du fichier: /public/assets/css/song.css */

/* Variables */
:root {
    --primary: #8A4FFF;
    --primary-light: #A77DFF;
    --primary-dark: #6E32DD;
    --secondary: #FF7BAC;
    --text: #333333;
    --text-light: #666666;
    --white: #FFFFFF;
    --bg-light: #F8F9FF;
    --card-shadow: 0 8px 20px rgba(138, 79, 255, 0.1);
    --radius: 12px;
    --radius-lg: 20px;
    --radius-sm: 8px;
    --transition: all 0.3s ease;
}

/* Container principal */
.song-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 40px 20px;
}

/* Header de la chanson */
.song-header {
    display: flex;
    flex-wrap: wrap;
    gap: 30px;
    margin-bottom: 40px;
    align-items: flex-start;
}

.song-cover-container {
    flex: 0 0 300px;
    position: relative;
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--card-shadow);
}

.song-cover-img {
    width: 100%;
    height: auto;
    display: block;
    transition: var(--transition);
}

.song-cover-container:hover .song-cover-img {
    transform: scale(1.05);
}

.play-button-large {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background-color: var(--primary);
    border: none;
    color: var(--white);
    font-size: 1.8rem;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    opacity: 0;
    transition: var(--transition);
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.3);
}

.song-cover-container:hover .play-button-large {
    opacity: 1;
}

.play-button-large:hover {
    background-color: var(--primary-dark);
    transform: translate(-50%, -50%) scale(1.1);
}

.song-info {
    flex: 1;
    min-width: 300px;
}

.song-title {
    font-size: 2.2rem;
    font-weight: 800;
    color: var(--primary-dark);
    margin-bottom: 15px;
    line-height: 1.2;
}

.song-creator {
    margin-bottom: 20px;
}

.creator-link {
    display: flex;
    align-items: center;
    text-decoration: none;
    color: var(--text);
    transition: var(--transition);
}

.creator-link:hover {
    color: var(--primary);
}

.creator-avatar {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    overflow: hidden;
    border: 2px solid var(--primary);
    margin-right: 15px;
}

.creator-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.creator-details {
    display: flex;
    align-items: center;
}

.creator-name {
    font-weight: 600;
    font-size: 1.1rem;
}

.admin-badge {
    display: inline-block;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: var(--white);
    font-size: 0.7rem;
    font-weight: 700;
    padding: 3px 8px;
    border-radius: 30px;
    margin-left: 10px;
}

.song-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    margin-bottom: 25px;
}

.song-meta-item {
    display: flex;
    align-items: center;
    color: var(--text-light);
    font-size: 0.9rem;
    padding: 8px 15px;
    background-color: var(--bg-light);
    border-radius: 30px;
}

.song-meta-item i {
    margin-right: 8px;
    color: var(--primary);
}

.song-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

.action-button {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 10px 20px;
    background-color: var(--white);
    border: 2px solid var(--primary-light);
    color: var(--primary);
    border-radius: 30px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
}

.action-button:hover {
    background-color: var(--primary);
    color: var(--white);
}

.action-button i {
    margin-right: 8px;
}

.action-button.liked {
    background-color: var(--primary-light);
    color: var(--white);
}

.action-button.download-button {
    background-color: var(--primary);
    color: var(--white);
    border-color: var(--primary);
}

.action-button.download-button:hover {
    background-color: var(--primary-dark);
}

/* Lecteur audio */
.song-player-container {
    margin-bottom: 40px;
}

.song-player {
    background-color: var(--bg-light);
    border-radius: var(--radius);
    padding: 20px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05);
}

.player-controls {
    display: flex;
    align-items: center;
    gap: 15px;
}

.player-button {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background-color: var(--primary);
    color: var(--white);
    border: none;
    font-size: 1.2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    flex-shrink: 0;
    transition: var(--transition);
}

.player-button:hover {
    background-color: var(--primary-dark);
}

.player-progress {
    display: flex;
    align-items: center;
    gap: 10px;
    flex: 1;
}

.progress-bar {
    position: relative;
    height: 8px;
    background-color: rgba(0, 0, 0, 0.1);
    border-radius: 4px;
    flex: 1;
    overflow: hidden;
    cursor: pointer;
}

.progress-background {
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    width: 100%;
    background-color: rgba(0, 0, 0, 0.05);
}

.progress-current {
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    width: 0%;
    background: linear-gradient(to right, var(--primary), var(--primary-light));
    transition: width 0.1s linear;
}

.progress-handle {
    position: absolute;
    top: 50%;
    left: 0%;
    transform: translate(-50%, -50%);
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background-color: var(--primary);
    box-shadow: 0 0 5px rgba(0, 0, 0, 0.2);
    opacity: 0;
    transition: opacity 0.2s;
}

.progress-bar:hover .progress-handle {
    opacity: 1;
}

#currentTime, #duration {
    font-size: 0.85rem;
    color: var(--text-light);
    width: 45px;
    text-align: center;
}

.player-volume {
    display: flex;
    align-items: center;
    gap: 10px;
    position: relative;
}

.volume-button {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background-color: var(--white);
    color: var(--primary);
    border: 2px solid var(--primary-light);
    font-size: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: var(--transition);
}

.volume-button:hover {
    background-color: var(--primary-light);
    color: var(--white);
}

.volume-slider {
    width: 0;
    overflow: hidden;
    transition: width 0.3s;
}

.player-volume:hover .volume-slider {
    width: 100px;
}

.volume-slider input[type="range"] {
    width: 100px;
    height: 8px;
    -webkit-appearance: none;
    background: rgba(0, 0, 0, 0.1);
    border-radius: 4px;
    outline: none;
}

.volume-slider input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: var(--primary);
    cursor: pointer;
}

.volume-slider input[type="range"]::-moz-range-thumb {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: var(--primary);
    cursor: pointer;
    border: none;
}

.no-audio-message {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 30px;
    background-color: var(--bg-light);
    border-radius: var(--radius);
    text-align: center;
}

.no-audio-message i {
    font-size: 2rem;
    color: var(--text-light);
    margin-bottom: 15px;
}

.no-audio-message p {
    color: var(--text-light);
    font-size: 1rem;
}

/* Onglets de contenu */
.song-tabs-container {
    margin-bottom: 50px;
}

.song-tabs {
    display: flex;
    border-bottom: 2px solid var(--bg-light);
    margin-bottom: 25px;
    overflow-x: auto;
    white-space: nowrap;
    scrollbar-width: none; /* Firefox */
}

.song-tabs::-webkit-scrollbar {
    display: none; /* Chrome, Safari, Opera */
}

.tab-button {
    padding: 12px 20px;
    background: none;
    border: none;
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-light);
    position: relative;
    cursor: pointer;
    transition: var(--transition);
}

.tab-button:hover {
    color: var(--primary);
}

.tab-button.active {
    color: var(--primary);
}

.tab-button.active::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 100%;
    height: 2px;
    background-color: var(--primary);
}

.tab-content {
    min-height: 300px;
}

.tab-pane {
    display: none;
}

.tab-pane.active {
    display: block;
    animation: fadeIn 0.3s ease;
}

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

.tab-pane h2 {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary-dark);
    margin-bottom: 20px;
}

.tab-pane h3 {
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--text);
    margin: 25px 0 15px;
}

.description-text, .lyrics-text, .additional-details {
    line-height: 1.8;
    color: var(--text);
    font-size: 1rem;
    white-space: pre-line;
}

.lyrics-text {
    white-space: pre-line;
    font-size: 1.1rem;
    line-height: 2;
}

/* Formulaire de commentaire */
.comment-form {
    display: flex;
    gap: 15px;
    margin-bottom: 30px;
}

.comment-form-avatar {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    overflow: hidden;
    flex-shrink: 0;
}

.comment-form-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

#commentForm {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

#commentText {
    width: 100%;
    min-height: 100px;
    padding: 15px;
    border: 1px solid #e0e0e0;
    border-radius: var(--radius-sm);
    font-family: inherit;
    font-size: 1rem;
    resize: vertical;
    transition: var(--transition);
}

#commentText:focus {
    border-color: var(--primary-light);
    outline: none;
    box-shadow: 0 0 0 2px rgba(138, 79, 255, 0.1);
}

.btn-submit {
    align-self: flex-end;
    padding: 10px 25px;
    background-color: var(--primary);
    color: var(--white);
    border: none;
    border-radius: 30px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
}

.btn-submit:hover {
    background-color: var(--primary-dark);
}

.login-to-comment {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 30px;
    background-color: var(--bg-light);
    border-radius: var(--radius);
    margin-bottom: 30px;
    text-align: center;
}

.login-to-comment p {
    margin-bottom: 15px;
    color: var(--text-light);
}

.btn-login {
    padding: 10px 25px;
    background-color: var(--primary);
    color: var(--white);
    border-radius: 30px;
    font-weight: 600;
    text-decoration: none;
    transition: var(--transition);
}

.btn-login:hover {
    background-color: var(--primary-dark);
}

/* Liste des commentaires */
.comments-list {
    display: flex;
    flex-direction: column;
    gap: 25px;
}

.comment-item {
    display: flex;
    gap: 15px;
}

.comment-avatar {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    overflow: hidden;
    flex-shrink: 0;
}

.comment-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.comment-content {
    flex: 1;
    background-color: var(--bg-light);
    padding: 15px;
    border-radius: var(--radius-sm);
    position: relative;
}

.comment-content::before {
    content: '';
    position: absolute;
    left: -10px;
    top: 15px;
    border-width: 10px 10px 10px 0;
    border-style: solid;
    border-color: transparent var(--bg-light) transparent transparent;
}

.comment-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.comment-author {
    font-weight: 600;
}

.comment-author a {
    color: var(--text);
    text-decoration: none;
    transition: var(--transition);
}

.comment-author a:hover {
    color: var(--primary);
}

.comment-date {
    font-size: 0.8rem;
    color: var(--text-light);
}

.comment-text {
    line-height: 1.6;
    margin-bottom: 15px;
}

.comment-actions {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 15px;
}

.like-comment-btn, .reply-comment-btn {
    display: flex;
    align-items: center;
    gap: 5px;
    padding: 5px 10px;
    background: none;
    border: none;
    color: var(--text-light);
    font-size: 0.9rem;
    cursor: pointer;
    transition: var(--transition);
}

.like-comment-btn:hover, .reply-comment-btn:hover {
    color: var(--primary);
}

.like-comment-btn.liked {
    color: var(--secondary);
}

.like-comment-btn.liked i {
    color: var(--secondary);
}

.comment-options {
    margin-left: auto;
    display: flex;
    gap: 10px;
}

.edit-comment-btn, .delete-comment-btn {
    display: flex;
    align-items: center;
    gap: 5px;
    padding: 5px 10px;
    background: none;
    border: none;
    color: var(--text-light);
    font-size: 0.85rem;
    cursor: pointer;
    transition: var(--transition);
}

.edit-comment-btn:hover {
    color: var(--primary);
}

.delete-comment-btn:hover {
    color: #e53935;
}

.edit-comment-form {
    margin-top: 15px;
}

.edit-comment-form textarea {
    width: 100%;
    min-height: 100px;
    padding: 12px;
    border: 1px solid #e0e0e0;
    border-radius: var(--radius-sm);
    font-family: inherit;
    font-size: 1rem;
    resize: vertical;
    margin-bottom: 10px;
}

.edit-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

.save-edit-btn, .cancel-edit-btn {
    padding: 8px 15px;
    border-radius: 20px;
    font-weight: 600;
    cursor: pointer;
    font-size: 0.9rem;
    transition: var(--transition);
}

.save-edit-btn {
    background-color: var(--primary);
    color: var(--white);
    border: none;
}

.save-edit-btn:hover {
    background-color: var(--primary-dark);
}

.cancel-edit-btn {
    background-color: transparent;
    color: var(--text-light);
    border: 1px solid #e0e0e0;
}

.cancel-edit-btn:hover {
    background-color: #f5f5f5;
}

/* Formulaire de réponse */
.reply-form {
    margin-top: 15px;
    padding: 15px;
    background-color: #f0f0f0;
    border-radius: var(--radius-sm);
}

.reply-form-header {
    margin-bottom: 10px;
}

.reply-form-header p {
    font-size: 0.9rem;
    color: var(--text-light);
    margin: 0;
}

.reply-input-container {
    display: flex;
    gap: 10px;
}

.reply-avatar {
    width: 35px;
    height: 35px;
    border-radius: 50%;
    overflow: hidden;
    flex-shrink: 0;
}

.reply-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.reply-input {
    flex: 1;
}

.reply-input textarea {
    width: 100%;
    min-height: 80px;
    padding: 12px;
    border: 1px solid #e0e0e0;
    border-radius: var(--radius-sm);
    font-family: inherit;
    font-size: 0.95rem;
    resize: vertical;
}

.reply-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 10px;
}

.submit-reply-btn, .cancel-reply-btn {
    padding: 8px 15px;
    border-radius: 20px;
    font-weight: 600;
    cursor: pointer;
    font-size: 0.9rem;
    transition: var(--transition);
}

.submit-reply-btn {
    background-color: var(--primary);
    color: var(--white);
    border: none;
}

.submit-reply-btn:hover {
    background-color: var(--primary-dark);
}

.cancel-reply-btn {
    background-color: transparent;
    color: var(--text-light);
    border: 1px solid #e0e0e0;
}

.cancel-reply-btn:hover {
    background-color: #f5f5f5;
}

/* Section des réponses */
.replies-section {
    margin-top: 15px;
}


.view-replies-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 5px 10px;
    background: none;
    border: none;
    color: var(--primary);
    font-size: 0.9rem;
    cursor: pointer;
    transition: var(--transition);
}

.view-replies-btn:hover {
    text-decoration: underline;
}

.replies-container {
    margin-top: 15px;
    padding-left: 20px;
    border-left: 2px solid #eee;
}

/* Message - Pas de commentaires */
.no-comments {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 40px 20px;
    text-align: center;
}

.no-comments-icon {
    font-size: 3rem;
    color: var(--text-light);
    margin-bottom: 15px;
    opacity: 0.5;
}

.no-comments p {
    color: var(--text);
    font-size: 1.1rem;
    margin-bottom: 5px;
}

.no-comments .sub-text {
    color: var(--text-light);
    font-size: 0.9rem;
}

/* Chansons similaires */
.related-songs {
    margin-top: 60px;
}

.related-songs h2 {
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--primary-dark);
    margin-bottom: 25px;
}

.related-songs-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 25px;
}

.song-card {
    background-color: var(--white);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05);
    transition: var(--transition);
}

.song-card:hover {
    transform: translateY(-8px);
    box-shadow: var(--card-shadow);
}

.song-cover {
    position: relative;
    padding-bottom: 100%; /* Aspect ratio 1:1 */
    overflow: hidden;
}

.song-cover img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: var(--transition);
}

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

.play-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: var(--transition);
}

.song-card:hover .play-overlay {
    opacity: 1;
}

.play-button {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background-color: var(--primary);
    color: var(--white);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
    transition: var(--transition);
}

.play-button:hover {
    transform: scale(1.1);
    background-color: var(--primary-dark);
}

.song-card-info {
    padding: 15px;
}

.song-card-title {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 5px;
    color: var(--text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.song-card-creator {
    font-size: 0.85rem;
    color: var(--text-light);
    margin: 0;
}

/* Modal de partage */
.share-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.share-modal.active {
    display: flex;
    animation: fadeIn 0.3s ease;
}

.share-modal-content {
    background-color: var(--white);
    border-radius: var(--radius);
    width: 100%;
    max-width: 500px;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
}

.share-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
    border-bottom: 1px solid #eee;
}

.share-modal-header h3 {
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--text);
    margin: 0;
}

.close-modal-btn {
    background: none;
    border: none;
    font-size: 1.5rem;
    color: var(--text-light);
    cursor: pointer;
    transition: var(--transition);
}

.close-modal-btn:hover {
    color: var(--text);
}

.share-modal-body {
    padding: 20px;
}

.share-modal-body p {
    margin-bottom: 20px;
    color: var(--text);
}

.share-buttons {
    display: flex;
    gap: 15px;
    margin-bottom: 25px;
}

.share-btn {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 15px;
    border-radius: var(--radius-sm);
    text-decoration: none;
    color: var(--white);
    transition: var(--transition);
}

.share-btn.facebook {
    background-color: #1877F2;
}

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

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

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

.share-btn i {
    font-size: 1.5rem;
    margin-bottom: 8px;
}

.share-link-container {
    margin-top: 20px;
}

.share-link-container label {
    display: block;
    margin-bottom: 10px;
    font-weight: 600;
    color: var(--text);
}

.share-link-input {
    display: flex;
    gap: 10px;
}

.share-link-input input {
    flex: 1;
    padding: 10px 15px;
    border: 1px solid #e0e0e0;
    border-radius: var(--radius-sm);
    font-size: 0.9rem;
}

.copy-link-btn {
    padding: 0 15px;
    background-color: var(--primary);
    color: var(--white);
    border: none;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: var(--transition);
}

.copy-link-btn:hover {
    background-color: var(--primary-dark);
}

.copy-link-btn.copied {
    background-color: #4CAF50;
}

/* Responsive */
@media (max-width: 991px) {
    .song-header {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }
    
    .song-cover-container {
        width: 250px;
    }
    
    .creator-link {
        justify-content: center;
    }
    
    .song-meta {
        justify-content: center;
    }
    
    .song-actions {
        justify-content: center;
    }
    
    .action-button {
        min-width: 140px;
    }
}

@media (max-width: 768px) {
    .song-container {
        padding: 20px 15px;
    }
    
    .song-title {
        font-size: 1.8rem;
    }
    
    .player-controls {
        flex-wrap: wrap;
        justify-content: center;
    }
    
    .player-progress {
        width: 100%;
        order: 3;
        margin-top: 15px;
    }
    
    .comment-form {
        flex-direction: column;
        align-items: center;
    }
    
    .comment-form-avatar {
        margin-bottom: 10px;
    }
    
    .related-songs-grid {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    }
    
    .share-buttons {
        flex-direction: column;
    }
}

@media (max-width: 576px) {
    .song-meta {
        flex-direction: column;
        align-items: center;
    }
    
    .song-actions {
        flex-direction: column;
        width: 100%;
    }
    
    .action-button {
        width: 100%;
    }
    
    .edit-actions, .reply-actions {
        flex-direction: column;
    }
    
    .comment-item {
        flex-direction: column;
        align-items: center;
    }
    
    .comment-avatar {
        margin-bottom: 10px;
    }
    
    .comment-content::before {
        display: none;
    }
    
    .comment-header {
        flex-direction: column;
        align-items: center;
    }
    
    .comment-date {
        margin-top: 5px;
    }
    
    .comment-actions {
        justify-content: center;
    }
    
    .comment-options {
        margin-left: 0;
        margin-top: 10px;
        width: 100%;
        justify-content: center;
    }
}