:root {
    --primary-color: #5e4123;
    --secondary-color: #8b7355;
    --accent-color: #a67c52;
    --light-bg: #fffdf6;
    --text-color: #4a3520;
    --text-light: #7a5a32;
    --border-color: #d8c9a7;
    --shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    --portuguese-btn: #0a4014;
    --hebrew-btn: #7d4e2c;
}

body {
    background: linear-gradient(135deg, #f5f0e1 0%, #e8dfc8 100%);
    font-family: 'Merriweather', serif;
    color: var(--text-color);
    line-height: 1.8;
    margin: 0;
    padding: 0;
    min-height: 100vh;
}

.page-container {
    display: flex;
    justify-content: center;
    padding: 20px;
}

.main-container {
    max-width: 900px;
    width: 100%;
    background: var(--light-bg);
    border-radius: 18px;
    box-shadow: var(--shadow);
    padding: 30px;
    margin: 20px 0;
    position: relative;
    overflow: hidden;
}

.main-container::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 8px;
    background: linear-gradient(90deg, var(--primary-color), var(--accent-color));
}

header {
    margin-bottom: 40px;
}

.main-title {
    font-family: 'Playfair Display', serif;
    font-size: 2.8rem;
    color: var(--primary-color);
    margin-bottom: 0.5rem;
    font-weight: 700;
    position: relative;
    display: inline-block;
}

.main-title::after {
    content: "";
    position: absolute;
    bottom: -10px;
    left: 50%;
    transform: translateX(-50%);
    width: 80px;
    height: 3px;
    background: var(--accent-color);
    border-radius: 3px;
}

.subtitle {
    font-size: 1.2rem;
    color: var(--secondary-color);
    font-style: italic;
}

.navigation-container {
    margin-bottom: 30px;
}

.search-form {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px; /* espaço entre input e botão */
    margin-bottom: 20px;
    flex-wrap: nowrap; /* evita quebrar linha */
}

.search-input {
    flex: 1 1 100px; /* permite crescer, mas com mínimo */
    width: 7ch;
    min-width: 100px;
    max-width: 120px;
    padding: 12px 16px;
    text-align: center;
    font-size: 1rem;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    box-sizing: border-box;
    background: white;
}

.search-input:focus {
    border-color: var(--accent-color);
    box-shadow: 0 0 0 0.25rem rgba(166, 124, 82, 0.25);
}

.search-btn {
    border-radius: 8px;
    padding: 12px 20px;
    font-weight: 600;
    background: var(--primary-color);
    border: none;
    color: white;
}

.search-btn:hover {
    background: var(--accent-color);
    transform: translateY(-1px);
}

.navigation-buttons {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 15px;
    margin-bottom: 20px;
}

.nav-btn {
    border-radius: 8px;
    padding: 8px 20px;
    font-weight: 500;
    border: 2px solid var(--border-color);
}

.nav-btn:hover {
    background-color: rgba(139, 115, 85, 0.1);
    border-color: var(--secondary-color);
}

.current-psalm {
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--primary-color);
    padding: 8px 25px;
    background: rgba(139, 115, 85, 0.1);
    border-radius: 8px;
}

.language-switcher {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-bottom: 20px;
}

.language-switcher .btn {
    border-radius: 8px;
    padding: 8px 20px;
    font-weight: 500;
    transition: all 0.3s ease;
}

.language-switcher .btn-pt {
    background-color: var(--portuguese-btn);
    color: white;
    border: none;
}

.language-switcher .btn-pt:hover {
    background-color: #1b5e20;
}

.language-switcher .btn-he {
    background-color: var(--hebrew-btn);
    color: white;
    border: none;
}

.language-switcher .btn-he:hover {
    background-color: #ac6c3e;
}

.psalm-container {
    margin-bottom: 40px;
}

.psalm-card {
    background: white;
    border-radius: 14px;
    box-shadow: var(--shadow);
    overflow: hidden;
    border: 1px solid var(--border-color);
}

.psalm-header {
    padding: 20px;
    background: linear-gradient(90deg, rgba(139, 115, 85, 0.1) 0%, rgba(255,255,255,1) 100%);
    border-bottom: 1px solid var(--border-color);
}

.psalm-header h2 {
    font-family: 'Playfair Display', serif;
    color: var(--primary-color);
    margin-bottom: 10px;
    font-size: 2rem;
}

.psalm-meta {
    display: flex;
    gap: 10px;
}

.psalm-content {
    padding: 25px;
}

.psalm-text {
    font-size: 1.1rem;
    line-height: 1.9;
    text-align: justify;
}

.hebrew-text {
    font-family: 'SBL Hebrew', 'Ezra SIL', 'Arial Hebrew', 'David', serif;
    font-size: 1.6rem;
    direction: rtl;
    text-align: right;
    line-height: 2.2;
    letter-spacing: 0.03em;
    color: #1a1a1a;
}

.psalm-footer {
    padding: 15px 25px;
    border-top: 1px solid var(--border-color);
    text-align: center;
}

.toggle-hebrew {
    border-radius: 20px;
    padding: 5px 20px;
    font-size: 0.9rem;
}

.audio-player {
    background: white;
    border-radius: 14px;
    box-shadow: var(--shadow);
    padding: 25px;
    margin-bottom: 30px;
    border: 1px solid var(--border-color);
}

.audio-header h3 {
    color: var(--primary-color);
    font-size: 1.5rem;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.audio-controls {
    display: grid;
    grid-template-columns: 1fr;
    gap: 20px;
}

.control-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.control-group label {
    font-weight: 500;
    color: var(--secondary-color);
    display: flex;
    align-items: center;
    gap: 8px;
}

.voice-select {
    padding: 10px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    font-size: 1rem;
}

.action-buttons {
    display: flex;
    gap: 15px;
    margin-top: 15px;
}

#readBtn, #stopBtn {
    border-radius: 8px;
    padding: 12px;
    font-weight: 600;
    flex: 1;
}

#readBtn {
    background: var(--primary-color);
    border: none;
    color: white;
}

#readBtn:hover {
    background: var(--accent-color);
}

#stopBtn {
    border: 2px solid #dc3545;
    color: #dc3545;
}

#stopBtn:hover {
    background: rgba(220, 53, 69, 0.1);
}

.help-section {
    text-align: center;
    margin-top: 30px;
}

.help-btn {
    border-radius: 20px;
    padding: 8px 25px;
    font-weight: 500;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: var(--secondary-color);
    color: white;
    border: none;
}

.help-btn:hover {
    background: var(--accent-color);
}

.modal-content {
    border-radius: 14px;
    border: 1px solid var(--border-color);
}

.modal-header {
    background: linear-gradient(90deg, var(--primary-color) 0%, var(--accent-color) 100%);
    color: white;
    border-radius: 14px 14px 0 0 !important;
    padding: 20px;
}

.modal-title {
    font-family: 'Playfair Display', serif;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 10px;
}

.modal-body {
    padding: 25px;
}

.info-item {
    margin-bottom: 20px;
}

.info-item h6 {
    color: var(--primary-color);
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
}

.info-item p {
    margin-left: 28px;
}

/* Rodapé */
.footer {
    text-align: center;
    margin-top: 60px;
    padding: 30px 20px;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
    border-radius: 14px;
    font-family: 'Merriweather', serif;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.footer p {
    margin: 0;
    font-size: 1.1rem;
    opacity: 0.9;
}

.footer p em {
    font-style: italic;
    font-weight: 600;
}

@media (max-width: 768px) {
    .main-container {
        padding: 20px;
    }
    
    .main-title {
        font-size: 2.2rem;
    }
    
    .psalm-content {
        padding: 15px;
    }
    
    .audio-player {
        padding: 15px;
    }

    /* Novas regras para os controles de áudio */
    .audio-controls {
        gap: 10px;
    }

    .control-group {
        flex-direction: row;
        align-items: center;
        justify-content: space-between;
    }

    .control-group label {
        font-size: 0.9rem;
        min-width: 70px; /* Largura fixa para os rótulos */
    }

    .voice-select {
        padding: 8px;
        font-size: 0.9rem;
        width: 100%;
    }

    /* Ajuste para os controles de range (volume e velocidade) */
    input[type="range"] {
        width: 100%;
        max-width: 150px;
    }

    /* Ajuste para os botões de ação */
    .action-buttons {
        flex-direction: column;
        gap: 10px;
    }

    #readBtn, #stopBtn {
        padding: 10px;
        font-size: 0.9rem;
    }

    /* Ajuste para o seletor de voz */
    .voice-select-wrapper {
        width: 100%;
    }
}

@media (max-width: 480px) {
    .control-group {
        flex-direction: column;
        align-items: flex-start;
    }

    input[type="range"] {
        max-width: 100%;
    }

    .audio-header h3 {
        font-size: 1.2rem;
    }
}