/* Estilos para el sistema de favoritos y búsqueda avanzada */

/* Botón de favoritos en versículos */
.favorite-btn {
    position: absolute;
    top: 5px;
    right: 5px;
    background: rgba(255, 255, 255, 0.9);
    border: 2px solid #e0e0e0;
    border-radius: 50%;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    opacity: 0;
    z-index: 10;
}

.verse:hover .favorite-btn {
    opacity: 1;
}

.favorite-btn:hover {
    transform: scale(1.1);
    border-color: #e74c3c;
    background: #fff;
}

.favorite-btn.favorited {
    background: #e74c3c;
    border-color: #e74c3c;
    color: white;
    opacity: 1;
}

.favorite-btn.favorited:hover {
    background: #c0392b;
    border-color: #c0392b;
}

.favorite-btn i {
    font-size: 14px;
}

/* Botón de favoritos en header */
#favoritesBtn {
    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;
    box-shadow: 0 2px 10px rgba(102, 126, 234, 0.3);
    position: relative;
}

#favoritesBtn:hover {
    transform: scale(1.1);
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
}

#favoritesBtn i {
    font-size: 16px;
}

/* Indicador de cantidad de favoritos */
#favoritesBtn.has-favorites::after {
    content: attr(data-count);
    position: absolute;
    top: -5px;
    right: -5px;
    background: #e74c3c;
    color: white;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 600;
    border: 2px solid white;
}

/* Panel de favoritos */
.favorites-panel {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: white;
    border-radius: 20px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    z-index: 10000;
    max-width: 800px;
    width: 90%;
    max-height: 80vh;
    overflow: hidden;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.favorites-panel.show {
    opacity: 1;
    visibility: visible;
}

.favorites-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 25px;
    border-bottom: 1px solid #f0f0f0;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.favorites-header h3 {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
}

.close-favorites {
    background: none;
    border: none;
    color: white;
    font-size: 24px;
    cursor: pointer;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: background-color 0.2s ease;
}

.close-favorites:hover {
    background: rgba(255, 255, 255, 0.2);
}

.favorites-content {
    display: flex;
    flex-direction: column;
    height: calc(80vh - 80px);
}

.favorites-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 25px;
    border-bottom: 1px solid #f0f0f0;
    background: #f8f9fa;
}

.favorites-search {
    flex: 1;
    margin-right: 20px;
}

.favorites-search input {
    width: 100%;
    padding: 10px 15px;
    border: 2px solid #e0e0e0;
    border-radius: 25px;
    font-size: 14px;
    outline: none;
    transition: border-color 0.3s ease;
}

.favorites-search input:focus {
    border-color: #667eea;
}

.favorites-actions {
    display: flex;
    gap: 10px;
}

.action-btn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 8px;
    padding: 8px 15px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 5px;
}

.action-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
}

.action-btn:last-child {
    background: linear-gradient(135deg, #e74c3c 0%, #c0392b 100%);
}

.action-btn:last-child:hover {
    box-shadow: 0 4px 15px rgba(231, 76, 60, 0.4);
}

.favorites-list {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
}

.favorite-item {
    background: white;
    border: 2px solid #f0f0f0;
    border-radius: 15px;
    padding: 20px;
    margin-bottom: 15px;
    transition: all 0.3s ease;
    position: relative;
}

.favorite-item:hover {
    border-color: #667eea;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.1);
    transform: translateY(-2px);
}

.favorite-content {
    margin-bottom: 15px;
}

.favorite-reference {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.favorite-reference strong {
    color: #667eea;
    font-size: 16px;
    font-weight: 600;
}

.favorite-date {
    color: #666;
    font-size: 12px;
}

.favorite-text {
    color: #333;
    font-size: 14px;
    line-height: 1.6;
    margin-bottom: 15px;
    font-style: italic;
}

.favorite-notes {
    margin-bottom: 15px;
}

.notes-input {
    width: 100%;
    min-height: 60px;
    padding: 10px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 14px;
    resize: vertical;
    outline: none;
    transition: border-color 0.3s ease;
}

.notes-input:focus {
    border-color: #667eea;
}

.favorite-actions {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
}

.favorite-action-btn {
    background: #f8f9fa;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    width: 35px;
    height: 35px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    color: #666;
}

.favorite-action-btn:hover {
    background: #667eea;
    border-color: #667eea;
    color: white;
    transform: scale(1.1);
}

.favorite-action-btn.remove-favorite:hover {
    background: #e74c3c;
    border-color: #e74c3c;
}

/* Estado vacío */
.empty-favorites {
    text-align: center;
    padding: 40px 20px;
    color: #666;
}

.empty-favorites i {
    font-size: 48px;
    color: #e0e0e0;
    margin-bottom: 15px;
}

.empty-favorites p {
    margin: 5px 0;
    font-size: 16px;
}

.empty-favorites p:last-child {
    font-size: 14px;
    color: #999;
}

/* Búsqueda avanzada */
.advanced-search {
    margin-top: 20px;
    border-top: 1px solid #e0e0e0;
    padding-top: 20px;
}

.advanced-search-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.advanced-search-header h4 {
    margin: 0;
    color: #333;
    font-size: 16px;
    font-weight: 600;
}

.toggle-advanced-search {
    background: none;
    border: none;
    color: #667eea;
    cursor: pointer;
    padding: 5px;
    border-radius: 5px;
    transition: background-color 0.2s ease;
}

.toggle-advanced-search:hover {
    background: #f0f0f0;
}

.advanced-search-filters {
    display: none;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 10px;
}

.advanced-search-filters.show {
    display: grid;
}

.filter-group {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.filter-group label {
    font-weight: 600;
    color: #333;
    font-size: 14px;
}

.filter-group select,
.filter-group input {
    padding: 8px 12px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 14px;
    outline: none;
    transition: border-color 0.3s ease;
}

.filter-group select:focus,
.filter-group input:focus {
    border-color: #667eea;
}

.filter-actions {
    grid-column: 1 / -1;
    display: flex;
    gap: 10px;
    justify-content: center;
    margin-top: 15px;
}

.filter-btn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 8px;
    padding: 10px 20px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.filter-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
}

.filter-btn:last-child {
    background: linear-gradient(135deg, #6c757d 0%, #495057 100%);
}

/* Notificaciones de favoritos */
.favorites-notification {
    position: fixed;
    top: 20px;
    right: 20px;
    background: white;
    border-radius: 10px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.15);
    padding: 15px 20px;
    z-index: 10001;
    transform: translateX(100%);
    transition: transform 0.3s ease;
    max-width: 300px;
    border-left: 4px solid #667eea;
}

.favorites-notification.show {
    transform: translateX(0);
}

.favorites-notification.success {
    border-left-color: #27ae60;
}

.favorites-notification.error {
    border-left-color: #e74c3c;
}

.favorites-notification.warning {
    border-left-color: #f39c12;
}

.favorites-notification.info {
    border-left-color: #3498db;
}

/* Responsive */
@media (max-width: 768px) {
    .favorites-panel {
        width: 95%;
        margin: 20px;
    }
    
    .favorites-toolbar {
        flex-direction: column;
        gap: 15px;
    }
    
    .favorites-search {
        margin-right: 0;
        width: 100%;
    }
    
    .favorites-actions {
        width: 100%;
        justify-content: center;
    }
    
    .favorite-item {
        padding: 15px;
    }
    
    .favorite-reference {
        flex-direction: column;
        align-items: flex-start;
        gap: 5px;
    }
    
    .advanced-search-filters {
        grid-template-columns: 1fr;
    }
}

/* Tema oscuro */
[data-theme="dark"] .favorites-panel {
    background: #2d3748;
    color: white;
}

[data-theme="dark"] .favorites-toolbar {
    background: #4a5568;
    border-bottom-color: #718096;
}

[data-theme="dark"] .favorites-search input {
    background: #4a5568;
    border-color: #718096;
    color: white;
}

[data-theme="dark"] .favorite-item {
    background: #4a5568;
    border-color: #718096;
}

[data-theme="dark"] .favorite-item:hover {
    border-color: #4299e1;
}

[data-theme="dark"] .favorite-reference strong {
    color: #4299e1;
}

[data-theme="dark"] .favorite-text {
    color: #e2e8f0;
}

[data-theme="dark"] .notes-input {
    background: #4a5568;
    border-color: #718096;
    color: white;
}

[data-theme="dark"] .favorite-action-btn {
    background: #4a5568;
    border-color: #718096;
    color: #a0aec0;
}

[data-theme="dark"] .advanced-search-filters {
    background: #4a5568;
}

[data-theme="dark"] .filter-group label {
    color: #e2e8f0;
}

[data-theme="dark"] .filter-group select,
[data-theme="dark"] .filter-group input {
    background: #4a5568;
    border-color: #718096;
    color: white;
}

[data-theme="dark"] .favorites-notification {
    background: #2d3748;
    color: white;
}

/* Animaciones */
@keyframes favoritesSlideIn {
    from {
        opacity: 0;
        transform: translate(-50%, -50%) scale(0.9);
    }
    to {
        opacity: 1;
        transform: translate(-50%, -50%) scale(1);
    }
}

.favorites-panel.show {
    animation: favoritesSlideIn 0.3s ease;
}

/* Scrollbar personalizado */
.favorites-list::-webkit-scrollbar {
    width: 6px;
}

.favorites-list::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 3px;
}

.favorites-list::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 3px;
}

.favorites-list::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
}

[data-theme="dark"] .favorites-list::-webkit-scrollbar-track {
    background: #4a5568;
}

[data-theme="dark"] .favorites-list::-webkit-scrollbar-thumb {
    background: #718096;
}

[data-theme="dark"] .favorites-list::-webkit-scrollbar-thumb:hover {
    background: #a0aec0;
} 