/**
 * Estilos específicos para dispositivos móveis
 * Plugin Bíblia Digital
 */

/* Estilos gerais para dispositivos móveis */
@media screen and (max-width: 768px) {
    body, html {
        margin: 0 !important;
        padding: 0 !important;
        width: 100% !important;
        overflow-x: hidden !important;
    }
    
    .biblia-digital-container {
        padding: 0 !important;
        margin: 0 !important;
        width: 100% !important;
        max-width: 100% !important;
        overflow-x: hidden !important;
        left: 0 !important;
        right: 0 !important;
    }
    
    /* Remover margens e paddings desnecessários */
    .biblia-verses {
        padding: 0 !important;
        margin: 0 !important;
    }
    
    /* Melhorar navegação em telas pequenas */
    .book-grid, .chapter-grid {
        display: grid;
        grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
        gap: 15px;
        padding: 20px 0;
        margin: 0;
    }
    
    .book-item, .chapter-item {
        width: 120px !important;
        height: 50px !important;
        padding: 0 !important;
        font-size: 13px !important;
        text-align: center !important;
        min-height: 50px !important;
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        margin: 0 !important;
        white-space: normal !important;
        overflow: hidden !important;
        text-overflow: ellipsis !important;
        line-height: 1.4 !important;
        min-width: 120px !important;
        max-width: 120px !important;
        word-break: keep-all !important;
        text-transform: none !important;
        box-sizing: border-box !important;
        flex-shrink: 0 !important;
    }
    
    .book-item span, .chapter-item span {
        display: block;
        width: 100%;
        text-align: center;
        padding: 0 5px;
        word-break: keep-all;
    }
    
    /* Ajustes para versículos em telas pequenas */
    .biblia-verse {
        padding: 20px;
        margin: 0 0 2px 0 !important;
        border-radius: 0 !important;
        box-shadow: none !important;
        background-color: #f8f9fa;
        width: 100% !important;
        max-width: 100% !important;
        box-sizing: border-box;
        border: none !important;
    }
    
    .verse-number {
        padding: 3px 6px;
        font-size: 16px;
        margin-right: 12px;
        border-radius: 50%;
        min-width: 28px;
        min-height: 28px;
        display: inline-flex;
        align-items: center;
        justify-content: center;
    }
    
    .verse-text {
        line-height: 1.6;
        font-size: 18px;
        color: #666;
    }
    
    .verse-actions {
        margin-top: 16px;
        display: flex;
        justify-content: flex-start;
        gap: 12px;
    }
    
    .verse-actions button {
        padding: 8px;
        margin-right: 0;
        border-radius: 50%;
        width: 40px;
        height: 40px;
        display: flex;
        align-items: center;
        justify-content: center;
    }
    
    /* Melhorar a navegação entre capítulos */
    .chapter-nav-top, .chapter-nav-bottom {
        padding: 12px 0;
        display: flex;
        justify-content: space-between;
        align-items: center;
        margin: 0;
    }
    
    .chapter-title {
        padding: 12px 0;
        margin: 0 0 10px 0;
        text-align: center;
        font-size: 24px;
    }
    
    .back-to-chapters {
        padding: 8px 16px;
        border-radius: 20px;
        font-size: 14px;
        display: flex;
        align-items: center;
        gap: 6px;
        margin: 0;
    }
    
    .chapter-nav-bottom {
        position: sticky;
        bottom: 0;
        background: #fff;
        box-shadow: 0 -2px 10px rgba(0,0,0,0.1);
        z-index: 100;
        padding: 15px 0;
        border-top: 1px solid #eee;
        width: 100%;
        margin: 0;
    }
    
    /* Modo de leitura otimizado para telas pequenas */
    .reading-mode .biblia-verse {
        border-radius: 0;
        margin-bottom: 0;
        border-bottom: 1px solid rgba(0,0,0,0.05);
    }
    
    .reading-mode .verse-actions {
        opacity: 0.6;
    }
    
    /* Botão de alternar modo de leitura */
    .toggle-reading-mode {
        position: fixed;
        bottom: 70px;
        right: 15px;
        width: 50px;
        height: 50px;
        border-radius: 50%;
        background: #3498db;
        color: white;
        display: flex;
        align-items: center;
        justify-content: center;
        box-shadow: 0 2px 10px rgba(0,0,0,0.2);
        z-index: 1000;
        border: none;
    }
    
    /* Controles de navegação por gestos */
    .swipe-area {
        position: fixed;
        top: 0;
        height: 100%;
        width: 20%;
        z-index: 90;
    }
    
    .swipe-left {
        left: 0;
    }
    
    .swipe-right {
        right: 0;
    }
    
    .swipe-indicator {
        position: fixed;
        top: 50%;
        transform: translateY(-50%);
        background: rgba(0,0,0,0.3);
        color: white;
        padding: 15px 10px;
        border-radius: 5px;
        opacity: 0;
        transition: opacity 0.3s;
        z-index: 95;
    }
    
    .swipe-left-indicator {
        left: 10px;
    }
    
    .swipe-right-indicator {
        right: 10px;
    }
    
    /* Ajustes para a pesquisa em dispositivos móveis */
    .biblia-search-form {
        padding: 16px;
    }
    
    .biblia-search-form input[type="text"] {
        width: 100%;
        padding: 12px;
        font-size: 16px; /* Evita zoom automático em iOS */
        border-radius: 8px;
    }
    
    .biblia-search-form button {
        width: 100%;
        margin-top: 10px;
        padding: 12px;
        border-radius: 8px;
    }
    
    .search-results .result-item {
        padding: 16px;
        margin-bottom: 12px;
        border-radius: 12px;
    }
    
    /* Melhorias para os favoritos em dispositivos móveis */
    .favorites-container .favorite-item {
        padding: 16px;
        margin-bottom: 12px;
        border-radius: 12px;
    }
    
    /* Botão de voltar ao topo */
    .back-to-top {
        position: fixed;
        bottom: 15px;
        right: 15px;
        width: 50px;
        height: 50px;
        border-radius: 50%;
        background: #3498db;
        color: white;
        display: flex;
        align-items: center;
        justify-content: center;
        box-shadow: 0 2px 10px rgba(0,0,0,0.2);
        z-index: 1000;
        border: none;
        opacity: 0;
        transition: opacity 0.3s;
    }
    
    .back-to-top.visible {
        opacity: 1;
    }
}

/* Estilos específicos para telas muito pequenas (smartphones) */
@media screen and (max-width: 480px) {
    .biblia-digital-container {
        width: 100% !important;
        margin: 0 !important;
        padding: 0 !important;
    }
    
    .book-grid, .chapter-grid {
        grid-template-columns: repeat(auto-fill, minmax(50px, 1fr));
        gap: 6px;
    }
    
    .book-item, .chapter-item {
        font-size: 12px;
        min-height: 35px;
        padding: 8px 3px;
    }
    
    .biblia-verse {
        padding: 18px;
        margin: 0 0 2px 0 !important;
    }
    
    .verse-actions button {
        width: 36px;
        height: 36px;
    }
    
    .verse-actions .material-icons {
        font-size: 18px;
    }
    
    .chapter-title {
        font-size: 22px;
        margin: 6px 0 12px 0;
    }
}

/* Estilos específicos para iPhone e dispositivos com notch */
@media screen and (max-width: 480px) and (min-height: 800px) {
    .biblia-digital-container {
        padding-top: 5px !important;
        padding-bottom: 20px !important;
    }
    
    .chapter-nav-top {
        margin-top: 5px;
    }
    
    .chapter-nav-bottom {
        padding-bottom: 25px;
    }
}
