/* Estilos para el layout del chat y mejoras visuales */

/* Chat fijo */
.fixed-chat {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 350px;
    height: 500px;
    background: white;
    border-radius: 20px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transform: translateY(20px);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.fixed-chat.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.fixed-chat-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-radius: 20px 20px 0 0;
}

.fixed-chat-header h4 {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
}

.close-fixed-chat {
    background: none;
    border: none;
    color: white;
    font-size: 20px;
    cursor: pointer;
    padding: 0;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: background-color 0.2s ease;
}

.close-fixed-chat:hover {
    background: rgba(255, 255, 255, 0.2);
}

.fixed-chat-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.fixed-chat-messages {
    flex: 1;
    padding: 15px;
    overflow-y: auto;
    background: #f8f9fa;
}

.fixed-chat-welcome {
    text-align: center;
    color: #6c757d;
    padding: 20px;
}

.fixed-chat-welcome i {
    font-size: 32px;
    margin-bottom: 10px;
    color: #667eea;
}

.fixed-chat-welcome p {
    margin: 0;
    font-size: 14px;
}

.fixed-chat-message {
    margin-bottom: 10px;
}

.fixed-chat-message.user {
    text-align: right;
}

.fixed-chat-message.assistant {
    text-align: left;
}

.fixed-chat-bubble {
    display: inline-block;
    max-width: 80%;
    padding: 10px 15px;
    border-radius: 18px;
    font-size: 14px;
    line-height: 1.4;
}

.fixed-chat-message.user .fixed-chat-bubble {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-bottom-right-radius: 5px;
}

.fixed-chat-message.assistant .fixed-chat-bubble {
    background: white;
    color: #333;
    border: 1px solid #e0e0e0;
    border-bottom-left-radius: 5px;
}

.fixed-chat-input {
    display: flex;
    padding: 15px;
    background: white;
    border-top: 1px solid #e0e0e0;
    gap: 10px;
}

.fixed-chat-input textarea {
    flex: 1;
    border: 2px solid #e0e0e0;
    border-radius: 20px;
    padding: 10px 15px;
    font-size: 14px;
    resize: none;
    outline: none;
    transition: border-color 0.3s ease;
    max-height: 80px;
    min-height: 40px;
}

.fixed-chat-input textarea:focus {
    border-color: #667eea;
}

.fixed-chat-input button {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    flex-shrink: 0;
}

.fixed-chat-input button:hover {
    transform: scale(1.1);
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
}

/* Ajustes del layout de la Biblia */
.bible-interface.with-fixed-chat {
    margin-right: 370px;
}

/* Mejoras visuales para libros y capítulos */
.modern-book-bar,
.modern-chapter-bar {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border: 2px solid #e0e0e0;
    border-radius: 15px;
    padding: 15px 20px;
    margin: 10px 0;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    position: relative;
    overflow: hidden;
}

.modern-book-bar::before,
.modern-chapter-bar::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.4), transparent);
    transition: left 0.5s ease;
}

.modern-book-bar:hover::before,
.modern-chapter-bar:hover::before {
    left: 100%;
}

.modern-book-bar:hover,
.modern-chapter-bar:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    border-color: #667eea;
}

.modern-book-bar button,
.modern-chapter-bar button {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 50%;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-left: 10px;
}

.modern-book-bar button:hover,
.modern-chapter-bar button:hover {
    transform: scale(1.1);
    box-shadow: 0 2px 10px rgba(102, 126, 234, 0.4);
}

.modern-book-list {
    background: white;
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    border: 2px solid #e0e0e0;
    overflow: hidden;
    margin-top: 5px;
}

.modern-book-list .book-item {
    padding: 15px 20px;
    border-bottom: 1px solid #f0f0f0;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 15px;
}

.modern-book-list .book-item:last-child {
    border-bottom: none;
}

.modern-book-list .book-item:hover {
    background: linear-gradient(135deg, #f8f9ff 0%, #e8f0ff 100%);
    transform: translateX(5px);
}

.modern-book-list .book-item::before {
    content: '📁';
    font-size: 20px;
    opacity: 0.7;
}

.modern-book-list .book-item.selected {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.modern-book-list .book-item.selected::before {
    content: '📂';
    opacity: 1;
}

.modern-chapter-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(60px, 1fr));
    gap: 10px;
    padding: 20px;
    background: white;
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    border: 2px solid #e0e0e0;
    margin-top: 5px;
}

.modern-chapter-grid .chapter-item {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border: 2px solid #e0e0e0;
    border-radius: 12px;
    padding: 12px 8px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 600;
    font-size: 14px;
    position: relative;
    overflow: hidden;
}

.modern-chapter-grid .chapter-item::before {
    content: '📄';
    display: block;
    font-size: 16px;
    margin-bottom: 5px;
    opacity: 0.7;
}

.modern-chapter-grid .chapter-item:hover {
    transform: translateY(-3px) scale(1.05);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.15);
    border-color: #667eea;
    background: linear-gradient(135deg, #f8f9ff 0%, #e8f0ff 100%);
}

.modern-chapter-grid .chapter-item.selected {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-color: #667eea;
}

.modern-chapter-grid .chapter-item.selected::before {
    content: '📋';
    opacity: 1;
}

/* Layout responsive */
.mobile-layout .fixed-chat {
    width: calc(100vw - 40px);
    height: 60vh;
    bottom: 10px;
    right: 20px;
    left: 20px;
}

.mobile-layout .bible-interface.with-fixed-chat {
    margin-right: 0;
    margin-bottom: calc(60vh + 20px);
}

/* Tema oscuro */
[data-theme="dark"] .fixed-chat {
    background: #2d3748;
    color: white;
}

[data-theme="dark"] .fixed-chat-messages {
    background: #4a5568;
}

[data-theme="dark"] .fixed-chat-input {
    background: #2d3748;
    border-top-color: #4a5568;
}

[data-theme="dark"] .fixed-chat-input textarea {
    background: #4a5568;
    border-color: #718096;
    color: white;
}

[data-theme="dark"] .fixed-chat-message.assistant .fixed-chat-bubble {
    background: #4a5568;
    color: white;
    border-color: #718096;
}

[data-theme="dark"] .modern-book-bar,
[data-theme="dark"] .modern-chapter-bar {
    background: linear-gradient(135deg, #4a5568 0%, #2d3748 100%);
    border-color: #718096;
    color: white;
}

[data-theme="dark"] .modern-book-list,
[data-theme="dark"] .modern-chapter-grid {
    background: #2d3748;
    border-color: #718096;
}

[data-theme="dark"] .modern-book-list .book-item {
    border-bottom-color: #4a5568;
    color: white;
}

[data-theme="dark"] .modern-book-list .book-item:hover {
    background: linear-gradient(135deg, #4a5568 0%, #2d3748 100%);
}

[data-theme="dark"] .modern-chapter-grid .chapter-item {
    background: linear-gradient(135deg, #4a5568 0%, #2d3748 100%);
    border-color: #718096;
    color: white;
}

[data-theme="dark"] .modern-chapter-grid .chapter-item:hover {
    background: linear-gradient(135deg, #4a5568 0%, #2d3748 100%);
    border-color: #4299e1;
}

/* Animaciones adicionales */
@keyframes slideInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.fixed-chat.show {
    animation: slideInUp 0.3s ease;
}

/* Scrollbar personalizado */
.fixed-chat-messages::-webkit-scrollbar {
    width: 6px;
}

.fixed-chat-messages::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 3px;
}

.fixed-chat-messages::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 3px;
}

.fixed-chat-messages::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
}

[data-theme="dark"] .fixed-chat-messages::-webkit-scrollbar-track {
    background: #4a5568;
}

[data-theme="dark"] .fixed-chat-messages::-webkit-scrollbar-thumb {
    background: #718096;
}

[data-theme="dark"] .fixed-chat-messages::-webkit-scrollbar-thumb:hover {
    background: #a0aec0;
}

/* Mejoras de accesibilidad */
.fixed-chat:focus-within {
    outline: 2px solid #667eea;
    outline-offset: 2px;
}

.modern-book-bar:focus,
.modern-chapter-bar:focus {
    outline: 2px solid #667eea;
    outline-offset: 2px;
}

/* Estados de carga */
.fixed-chat.loading {
    opacity: 0.7;
    pointer-events: none;
}

.fixed-chat.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 30px;
    height: 30px;
    border: 3px solid #f3f3f3;
    border-top: 3px solid #667eea;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    transform: translate(-50%, -50%);
}

@keyframes spin {
    0% { transform: translate(-50%, -50%) rotate(0deg); }
    100% { transform: translate(-50%, -50%) rotate(360deg); }
} 