/**
 * Bible Widget Styles - Monte Moriah
 * Integrado con estilo.css existente
 * Versión: 1.0.0
 */

/* Variables consistentes con tu diseño */
:root {
    --mm-primary: #a67c52;
    --mm-primary-dark: #8b6b4f;
    --mm-primary-light: #c9b6a2;
    --mm-bg-cream: #f6eee6;
    --mm-bg-light: #faf3ec;
    --mm-text: #4a5c6e;
    --mm-text-dark: #2c3e4f;
    --mm-white: #ffffff;
    --mm-shadow: rgba(70, 50, 30, 0.15);
    --mm-transition: all 0.3s ease;
}

/* Botón flotante */
.bible-widget-toggle {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 70px;
    height: 70px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--mm-primary), var(--mm-primary-dark));
    border: 3px solid var(--mm-primary-light);
    cursor: pointer;
    box-shadow: 0 4px 20px var(--mm-shadow);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    transition: var(--mm-transition);
    animation: biblePulse 2s infinite;
}

.bible-widget-toggle:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 30px var(--mm-shadow);
}

.bible-widget-toggle svg {
    width: 38px;
    height: 38px;
    fill: var(--mm-white);
}

@keyframes biblePulse {
    0%, 100% { 
        box-shadow: 0 4px 20px var(--mm-shadow); 
    }
    50% { 
        box-shadow: 0 4px 30px rgba(166, 124, 82, 0.5); 
    }
}

/* Contenedor principal */
.bible-widget-container {
    position: fixed;
    bottom: 110px;
    right: 30px;
    width: 380px;
    max-width: calc(100vw - 60px);
    max-height: 550px;
    background: var(--mm-white);
    border: 2px solid var(--mm-primary-light);
    border-radius: 32px;
    box-shadow: 0 15px 35px -10px var(--mm-shadow);
    z-index: 9998;
    display: none;
    flex-direction: column;
    overflow: hidden;
    animation: bibleSlideIn 0.3s ease;
}

.bible-widget-container.active {
    display: flex;
}

@keyframes bibleSlideIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Header */
.bible-widget-header {
    background: linear-gradient(135deg, var(--mm-primary), var(--mm-primary-dark));
    color: var(--mm-white);
    padding: 15px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 2px solid var(--mm-primary-light);
}

.bible-widget-header h3 {
    margin: 0;
    font-size: 17px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 10px;
    font-family: 'Segoe UI', 'Roboto', sans-serif;
}

.bible-widget-header h3 svg {
    width: 22px;
    height: 22px;
    fill: var(--mm-white);
}

.bible-widget-close {
    background: none;
    border: none;
    color: var(--mm-white);
    cursor: pointer;
    padding: 5px;
    border-radius: 8px;
    transition: var(--mm-transition);
    display: flex;
    align-items: center;
    justify-content: center;
}

.bible-widget-close:hover {
    background: rgba(255, 255, 255, 0.2);
}

/* Área de chat */
.bible-widget-chat {
    flex: 1;
    padding: 15px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 12px;
    min-height: 300px;
    background: var(--mm-bg-light);
}

.bible-message {
    max-width: 85%;
    padding: 12px 16px;
    border-radius: 20px;
    line-height: 1.6;
    font-size: 14px;
    animation: bibleMessageIn 0.3s ease;
    font-family: 'Segoe UI', 'Roboto', sans-serif;
}

@keyframes bibleMessageIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.bible-message-user {
    align-self: flex-end;
    background: var(--mm-primary);
    color: var(--mm-white);
    border-bottom-right-radius: 8px;
}

.bible-message-pastor {
    align-self: flex-start;
    background: var(--mm-white);
    color: var(--mm-text-dark);
    border: 1px solid var(--mm-primary-light);
    border-bottom-left-radius: 8px;
}

.bible-message-error {
    align-self: center;
    background: #ffe6e6;
    color: #cc0000;
    border: 1px solid #cc0000;
    text-align: center;
    font-size: 13px;
    max-width: 90%;
}

.bible-verse {
    font-style: italic;
    color: var(--mm-primary-dark);
    background: var(--mm-bg-cream);
    padding: 8px 12px;
    border-radius: 12px;
    margin: 8px 0;
    border-left: 3px solid var(--mm-primary);
    display: block;
}

/* Indicador de escritura */
.bible-typing-indicator {
    display: flex;
    gap: 5px;
    padding: 12px 16px;
    background: var(--mm-white);
    border: 1px solid var(--mm-primary-light);
    border-radius: 20px;
    width: fit-content;
    align-self: flex-start;
}

.bible-typing-dot {
    width: 8px;
    height: 8px;
    background: var(--mm-primary);
    border-radius: 50%;
    animation: bibleTyping 1.4s infinite;
}

.bible-typing-dot:nth-child(2) { animation-delay: 0.2s; }
.bible-typing-dot:nth-child(3) { animation-delay: 0.4s; }

@keyframes bibleTyping {
    0%, 60%, 100% { transform: translateY(0); }
    30% { transform: translateY(-5px); }
}

/* Área de input */
.bible-widget-input-area {
    padding: 15px;
    background: var(--mm-white);
    border-top: 1px solid var(--mm-primary-light);
    display: flex;
    gap: 10px;
}

.bible-widget-input {
    flex: 1;
    padding: 12px 18px;
    border: 2px solid var(--mm-primary-light);
    border-radius: 40px;
    font-size: 14px;
    outline: none;
    transition: var(--mm-transition);
    font-family: 'Segoe UI', 'Roboto', sans-serif;
    color: var(--mm-text-dark);
}

.bible-widget-input:focus {
    border-color: var(--mm-primary);
    box-shadow: 0 0 10px rgba(166, 124, 82, 0.2);
}

.bible-widget-input::placeholder {
    color: #9aa5b1;
}

.bible-widget-send {
    width: 45px;
    height: 45px;
    border-radius: 50%;
    background: var(--mm-primary);
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--mm-transition);
}

.bible-widget-send:hover:not(:disabled) {
    background: var(--mm-primary-dark);
    transform: scale(1.05);
}

.bible-widget-send:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.bible-widget-send svg {
    width: 20px;
    height: 20px;
    fill: var(--mm-white);
}

/* Welcome message */
.bible-welcome {
    text-align: center;
    padding: 30px 20px;
    color: var(--mm-text);
}

.bible-welcome svg {
    width: 55px;
    height: 55px;
    fill: var(--mm-primary);
    margin-bottom: 15px;
    background: var(--mm-bg-cream);
    padding: 15px;
    border-radius: 50%;
}

.bible-welcome h4 {
    margin: 10px 0 8px;
    color: var(--mm-primary-dark);
    font-size: 18px;
    font-family: 'Segoe UI', 'Roboto', sans-serif;
}

.bible-welcome p {
    font-size: 14px;
    color: var(--mm-text);
    margin: 0;
    line-height: 1.6;
}

/* Responsive */
@media (max-width: 480px) {
    .bible-widget-toggle {
        bottom: 20px;
        right: 20px;
        width: 60px;
        height: 60px;
    }
    
    .bible-widget-toggle svg {
        width: 32px;
        height: 32px;
    }
    
    .bible-widget-container {
        bottom: 90px;
        right: 20px;
        left: 20px;
        width: auto;
        max-height: 70vh;
        border-radius: 24px;
    }
    
    .bible-widget-header h3 {
        font-size: 15px;
    }
}

/* Accesibilidad */
.bible-widget-toggle:focus,
.bible-widget-close:focus,
.bible-widget-send:focus,
.bible-widget-input:focus {
    outline: 3px solid var(--mm-primary-light);
    outline-offset: 2px;
}

/* Scrollbar personalizado */
.bible-widget-chat::-webkit-scrollbar {
    width: 6px;
}

.bible-widget-chat::-webkit-scrollbar-track {
    background: var(--mm-bg-light);
    border-radius: 3px;
}

.bible-widget-chat::-webkit-scrollbar-thumb {
    background: var(--mm-primary-light);
    border-radius: 3px;
}

.bible-widget-chat::-webkit-scrollbar-thumb:hover {
    background: var(--mm-primary);
}