/* Botão principal */
.bible-audio-btn {
    background: #24325c;
    color: white;
    border: none;
    padding: 14px 28px;
    font-size: 16px;
    font-weight: bold;
    border-radius: 50px;
    cursor: pointer;
    transition: all 0.3s ease;
    margin: 20px 0;
    box-shadow: 0 4px 15px rgba(36, 50, 92, 0.2);
}

.bible-audio-btn:hover {
    background: #1a2446;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(36, 50, 92, 0.3);
}

.bible-audio-btn:active {
    transform: translateY(0);
}

/* Modal */
.bible-audio-modal {
    display: none;
    position: fixed;
    z-index: 10000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    animation: fadeIn 0.3s;
}

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

.bible-audio-modal-content {
    background: #24325c;
    margin: 5% auto;
    padding: 0;
    width: 90%;
    max-width: 900px;
    border-radius: 15px;
    box-shadow: 0 10px 40px rgba(36, 50, 92, 0.3);
    animation: slideDown 0.3s;
    max-height: 85%;
    display: flex;
    flex-direction: column;
}

@keyframes slideDown {
    from {
        transform: translateY(-50px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.bible-audio-modal-header {
    padding: 20px 25px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 15px 15px 0 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: white;
    border-bottom: 2px solid rgba(255, 255, 255, 0.2);
}

.bible-audio-modal-header h2 {
    margin: 0;
    font-size: 24px;
    color: white;
}

.bible-audio-close {
    font-size: 35px;
    font-weight: bold;
    cursor: pointer;
    transition: 0.3s;
    color: white;
}

.bible-audio-close:hover {
    transform: scale(1.2);
    color: #ff6b6b;
}

.bible-audio-modal-body {
    padding: 25px;
    background: #f5f5f5;
    border-radius: 0 0 15px 15px;
    display: flex;
    gap: 25px;
    flex-wrap: wrap;
}

/* Playlist */
.bible-audio-playlist-container {
    flex: 1;
    min-width: 250px;
    background: white;
    border-radius: 10px;
    padding: 15px;
    box-shadow: 0 2px 10px rgba(36, 50, 92, 0.1);
    max-height: 500px;
    overflow-y: auto;
}

.bible-audio-playlist-container h3 {
    margin-top: 0;
    color: #24325c;
    font-size: 18px;
    border-bottom: 2px solid #24325c;
    padding-bottom: 10px;
}

.bible-playlist {
    list-style: none;
    padding: 0;
    margin: 0;
}

.playlist-loading {
    text-align: center;
    padding: 20px;
    color: #666;
}

.playlist-item {
    padding: 12px;
    margin-bottom: 10px;
    background: #f9f9f9;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-left: 3px solid transparent;
}

.playlist-item:hover {
    background: #f0f0f0;
    transform: translateX(5px);
}

.playlist-item.active {
    background: linear-gradient(135deg, #24325c15 0%, #24325c10 100%);
    border-left-color: #24325c;
    box-shadow: 0 2px 5px rgba(36, 50, 92, 0.1);
}

.playlist-item.loaded {
    border-left-color: #4caf50;
}

.playlist-item-info {
    flex: 1;
}

.verse-reference {
    font-weight: bold;
    color: #24325c;
    display: block;
    margin-bottom: 5px;
    font-size: 14px;
}

.verse-preview {
    font-size: 12px;
    color: #666;
    display: block;
    line-height: 1.4;
}

.playlist-item-controls {
    display: flex;
    gap: 8px;
    align-items: center;
}

.verse-status {
    font-size: 14px;
}

.verse-status.loading {
    animation: spin 1s linear infinite;
}

.verse-status.error {
    color: #ff4757;
}

.verse-status.loaded {
    color: #4caf50;
}

@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.play-verse-btn, .generate-verse-btn {
    background: #24325c;
    color: white;
    border: none;
    padding: 6px 12px;
    border-radius: 5px;
    cursor: pointer;
    font-size: 12px;
    transition: all 0.3s ease;
}

.play-verse-btn:hover, .generate-verse-btn:hover {
    background: #1a2446;
    transform: scale(1.05);
}

/* Player Container */
.bible-audio-player-container {
    flex: 1;
    min-width: 300px;
    background: white;
    border-radius: 10px;
    padding: 20px;
    box-shadow: 0 2px 10px rgba(36, 50, 92, 0.1);
}

.current-playing-info {
    background: #f0f0f0;
    padding: 12px;
    border-radius: 8px;
    margin-bottom: 20px;
    text-align: center;
    border: 1px solid #e0e0e0;
}

.playing-label {
    font-size: 12px;
    color: #666;
    display: block;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.playing-verse {
    font-size: 14px;
    color: #24325c;
    font-weight: bold;
    display: block;
    margin-top: 5px;
}

/* Player controls */
#bible-audio {
    width: 100%;
    border-radius: 8px;
}

#bible-audio:focus {
    outline: none;
}

.player-controls {
    display: flex;
    gap: 15px;
    justify-content: center;
    margin-top: 20px;
}

.player-control-btn {
    background: #24325c;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 14px;
    font-weight: 500;
}

.player-control-btn:hover:not(:disabled) {
    background: #1a2446;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(36, 50, 92, 0.3);
}

.player-control-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Loading */
.bible-audio-loading {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(36, 50, 92, 0.95);
    color: white;
    padding: 30px;
    border-radius: 15px;
    z-index: 10001;
    text-align: center;
    min-width: 250px;
    backdrop-filter: blur(5px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

.loading-spinner {
    border: 4px solid rgba(255, 255, 255, 0.3);
    border-top: 4px solid white;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
    margin: 0 auto 15px;
}

.bible-audio-loading p {
    margin: 0;
    font-size: 14px;
}

/* Responsividade */
@media (max-width: 768px) {
    .bible-audio-modal-content {
        width: 95%;
        margin: 10% auto;
        max-height: 90%;
    }
    
    .bible-audio-modal-body {
        flex-direction: column;
        padding: 15px;
        gap: 15px;
    }
    
    .bible-audio-playlist-container {
        max-height: 300px;
    }
    
    .player-control-btn {
        padding: 8px 16px;
        font-size: 12px;
    }
    
    .bible-audio-modal-header h2 {
        font-size: 20px;
    }
    
    .bible-audio-close {
        font-size: 30px;
    }
    
    .verse-reference {
        font-size: 12px;
    }
    
    .verse-preview {
        font-size: 11px;
    }
}

/* Scrollbar personalizada */
.bible-audio-playlist-container::-webkit-scrollbar {
    width: 8px;
}

.bible-audio-playlist-container::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 10px;
}

.bible-audio-playlist-container::-webkit-scrollbar-thumb {
    background: #24325c;
    border-radius: 10px;
}

.bible-audio-playlist-container::-webkit-scrollbar-thumb:hover {
    background: #1a2446;
}

/* Animações adicionais */
@keyframes pulse {
    0% {
        box-shadow: 0 0 0 0 rgba(36, 50, 92, 0.4);
    }
    70% {
        box-shadow: 0 0 0 10px rgba(36, 50, 92, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(36, 50, 92, 0);
    }
}

.playlist-item.active .verse-reference {
    animation: pulse 2s infinite;
}

/* Melhorias de acessibilidade */
.play-verse-btn:focus,
.generate-verse-btn:focus,
.player-control-btn:focus,
.bible-audio-btn:focus {
    outline: 2px solid #24325c;
    outline-offset: 2px;
}

/* Indicador de progresso */
#bible-audio {
    margin: 10px 0;
}

/* Estilo para o botão de compartilhar existente */
.share-verse-btn {
    background: transparent;
    border: none;
    cursor: pointer;
    margin-left: 10px;
    padding: 5px;
    transition: all 0.3s ease;
    vertical-align: middle;
    border-radius: 50%;
}

.share-verse-btn:hover {
    background: rgba(36, 50, 92, 0.1);
    transform: scale(1.1);
}

.share-verse-btn svg {
    transition: all 0.3s ease;
}

.share-verse-btn:hover svg {
    stroke: #24325c;
}

/* Estado de carregamento dos itens da playlist */
.playlist-item.loading {
    opacity: 0.7;
    cursor: wait;
}

/* Tooltip para os botões */
.play-verse-btn[title]:hover:after,
.generate-verse-btn[title]:hover:after {
    content: attr(title);
    position: absolute;
    background: #24325c;
    color: white;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
    margin-top: -30px;
    margin-left: -10px;
    white-space: nowrap;
    z-index: 1000;
}

/* Melhorias para telas muito pequenas */
@media (max-width: 480px) {
    .bible-audio-btn {
        padding: 12px 20px;
        font-size: 14px;
        width: 100%;
    }
    
    .playlist-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
    
    .playlist-item-controls {
        align-self: flex-end;
    }
    
    .verse-preview {
        font-size: 10px;
    }
    
    .player-controls {
        flex-direction: column;
    }
    
    .player-control-btn {
        width: 100%;
    }
}

/* Dark mode suporte (opcional) */
@media (prefers-color-scheme: dark) {
    .bible-audio-modal-body {
        background: #1a1a1a;
    }
    
    .bible-audio-playlist-container,
    .bible-audio-player-container {
        background: #2d2d2d;
    }
    
    .bible-audio-playlist-container h3 {
        color: #fff;
    }
    
    .playlist-item {
        background: #3d3d3d;
        color: #fff;
    }
    
    .playlist-item:hover {
        background: #4d4d4d;
    }
    
    .verse-reference {
        color: #7b9cff;
    }
    
    .verse-preview {
        color: #ccc;
    }
    
    .current-playing-info {
        background: #3d3d3d;
        color: #fff;
    }
    
    .playing-label {
        color: #ccc;
    }
    
    .playing-verse {
        color: #7b9cff;
    }
}